2 commits - java/code
by Jan Pazdziora
java/code/src/com/redhat/rhn/common/db/datasource/xml/Set_queries.xml | 30 ++++------
1 file changed, 12 insertions(+), 18 deletions(-)
New commits:
commit ab201038dce7ce61b007ca3dc9c11118aafca5a3
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 21 22:54:37 2010 +0100
Rewrite remove_unowned_errata and remove_nonrhn_unowned_errata not to use rowid.
Addressing
2010-12-21 03:52:33,018 [TP-Processor3] ERROR com.redhat.rhn.common.db.datasource.CachedStatement - Error while processing cached statement sql: DELETE
FROM rhnSet S
WHERE rowid IN(SELECT s.rowid
FROM rhnSet S, web_contact WC
WHERE S.user_id = ?
AND S.user_id = WC.id
AND S.label = ?
AND NOT EXISTS(SELECT 1
FROM dual
WHERE EXISTS (SELECT 1
FROM rhnErrata E
WHERE E.id = S.element
AND E.org_id = WC.org_id
)
OR EXISTS (SELECT 1
FROM rhnErrataTmp ET
WHERE ET.id = S.element
AND ET.org_id = WC.org_id
)
)
)
com.redhat.rhn.common.db.WrappedSQLException: ERROR: column s.rowid does not exist
at com.redhat.rhn.common.translation.SqlExceptionTranslator.postgreSqlException(SqlExceptionTranslator.java:56)
at com.redhat.rhn.common.translation.SqlExceptionTranslator.sqlException(SqlExceptionTranslator.java:45)
at com.redhat.rhn.common.db.NamedPreparedStatement.execute(NamedPreparedStatement.java:141)
at com.redhat.rhn.common.db.datasource.CachedStatement.execute(CachedStatement.java:453)
at com.redhat.rhn.common.db.datasource.CachedStatement.execute(CachedStatement.java:430)
at com.redhat.rhn.common.db.datasource.CachedStatement.executeUpdate(CachedStatement.java:270)
at com.redhat.rhn.common.db.datasource.WriteMode.executeUpdate(WriteMode.java:33)
at com.redhat.rhn.domain.rhnset.SetCleanup.cleanup(SetCleanup.java:124)
at com.redhat.rhn.domain.rhnset.RhnSetFactory.save(RhnSetFactory.java:148)
at com.redhat.rhn.manager.rhnset.RhnSetManager.store(RhnSetManager.java:88)
at com.redhat.rhn.manager.errata.ErrataManager.deleteErrata(ErrataManager.java:547)
at com.redhat.rhn.manager.errata.ErrataManager.deleteErratum(ErrataManager.java:604)
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Set_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Set_queries.xml
index 87ae7ff..bba7ba5 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Set_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Set_queries.xml
@@ -174,11 +174,11 @@ SELECT user_id, label, element, element_two, element_three
<query params="user_id, label">
DELETE
FROM rhnSet S
- WHERE rowid IN(SELECT s.rowid
- FROM rhnSet S, web_contact WC
- WHERE S.user_id = :user_id
- AND S.user_id = WC.id
- AND S.label = :label
+ WHERE S.user_id = :user_id
+ AND S.label = :label
+ and exists (
+ select 1 from web_contact WC
+ where S.user_id = WC.id
AND NOT EXISTS(SELECT 1
FROM rhnErrata E
WHERE E.id = S.element
@@ -197,11 +197,11 @@ DELETE
<query params="user_id, label">
DELETE
FROM rhnSet S
- WHERE rowid IN(SELECT s.rowid
- FROM rhnSet S, web_contact WC
- WHERE S.user_id = :user_id
- AND S.user_id = WC.id
- AND S.label = :label
+ WHERE S.user_id = :user_id
+ AND S.label = :label
+ and exists (
+ select 1 from web_contact WC
+ where S.user_id = WC.id
AND NOT EXISTS(SELECT 1
FROM rhnErrata E
WHERE E.id = S.element
commit 38799a9da797de947e1606b42d82bf7d4a58bb7c
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 21 22:47:23 2010 +0100
No need to subselect from dual.
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Set_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Set_queries.xml
index 18d46dc..87ae7ff 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Set_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Set_queries.xml
@@ -180,18 +180,15 @@ DELETE
AND S.user_id = WC.id
AND S.label = :label
AND NOT EXISTS(SELECT 1
- FROM dual
- WHERE EXISTS (SELECT 1
FROM rhnErrata E
WHERE E.id = S.element
AND E.org_id = WC.org_id
)
- OR EXISTS (SELECT 1
+ AND NOT EXISTS(SELECT 1
FROM rhnErrataTmp ET
WHERE ET.id = S.element
AND ET.org_id = WC.org_id
)
- )
)
</query>
</write-mode>
@@ -206,18 +203,15 @@ DELETE
AND S.user_id = WC.id
AND S.label = :label
AND NOT EXISTS(SELECT 1
- FROM dual
- WHERE EXISTS (SELECT 1
FROM rhnErrata E
WHERE E.id = S.element
AND (E.org_id = WC.org_id OR E.org_id IS NULL)
)
- OR EXISTS (SELECT 1
+ AND NOT EXISTS(SELECT 1
FROM rhnErrataTmp ET
WHERE ET.id = S.element
AND ET.org_id = WC.org_id
)
- )
)
</query>
</write-mode>
13 years, 4 months
Changes to 'refs/tags/spacewalk-backend-1.3.32-1'
by Jan Pazdziora
Tag 'spacewalk-backend-1.3.32-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2010-12-21 21:45 +0000
Tagging package [spacewalk-backend] version [1.3.32-1] in directory [backend/].
Changes since spacecmd-1.3.5-1:
Jan Pazdziora (1):
Automatic commit of package [spacewalk-backend] release [1.3.32-1].
---
backend/spacewalk-backend.spec | 10 +++++++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
---
13 years, 4 months
backend/spacewalk-backend.spec rel-eng/packages
by Jan Pazdziora
backend/spacewalk-backend.spec | 10 +++++++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
New commits:
commit d51d93e02962693ff256e388e12897f3452f23ed
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 21 22:45:42 2010 +0100
Automatic commit of package [spacewalk-backend] release [1.3.32-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 53aae72..c244457 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -11,7 +11,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2 and Python
-Version: 1.3.31
+Version: 1.3.32
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -684,6 +684,14 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Tue Dec 21 2010 Jan Pazdziora 1.3.32-1
+- Need to alias column with AS for PostgreSQL.
+- use difflib instead of external "diff -u" (msuchy(a)redhat.com)
+- move function ostr_to_sym from config_common/file_utils to spacewalk-backend-
+ libs (msuchy(a)redhat.com)
+- 634963 - print diffs for "rhncfg-manager diff-revisions" if we differ in
+ selinux context, ownership or attributes (msuchy(a)redhat.com)
+
* Tue Dec 21 2010 Jan Pazdziora 1.3.31-1
- Need to remove gentree from Makefile as well.
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index d08b24e..be867f0 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.3.31-1 backend/
+1.3.32-1 backend/
13 years, 4 months
Changes to 'refs/tags/spacecmd-1.3.5-1'
by aparsons
Tag 'spacecmd-1.3.5-1' created by Aron Parsons <aparsons(a)redhat.com> at 2010-12-21 21:31 +0000
Tagging package [spacecmd] version [1.3.5-1] in directory [spacecmd/].
Changes since osad-5.9.48-1:
Aron Parsons (6):
spacecmd: don't try to load non-existent config sections
spacecmd: fix logic regarding which configuration files to load
spacecmd: attempt to re-login as the same user if the cached credentials are invalid
spacecmd: discard the password variable once we use it
spacecmd: renamed current user variable to avoid confusion
Automatic commit of package [spacecmd] release [1.3.5-1].
Jan Pazdziora (1):
Need to alias column with AS for PostgreSQL.
---
backend/satellite_tools/exporter/exportLib.py | 2 +-
rel-eng/packages/spacecmd | 2 +-
spacecmd/spacecmd.spec | 8 +++++++-
spacecmd/src/bin/spacecmd | 22 ++++++++++++----------
spacecmd/src/lib/misc.py | 20 +++++++++++++-------
spacecmd/src/lib/shell.py | 2 +-
6 files changed, 35 insertions(+), 21 deletions(-)
---
13 years, 4 months
6 commits - rel-eng/packages spacecmd/spacecmd.spec spacecmd/src
by aparsons
rel-eng/packages/spacecmd | 2 +-
spacecmd/spacecmd.spec | 8 +++++++-
spacecmd/src/bin/spacecmd | 22 ++++++++++++----------
spacecmd/src/lib/misc.py | 20 +++++++++++++-------
spacecmd/src/lib/shell.py | 2 +-
5 files changed, 34 insertions(+), 20 deletions(-)
New commits:
commit b93fea105f60250a83b681f17b23d5635151e410
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Tue Dec 21 16:31:07 2010 -0500
Automatic commit of package [spacecmd] release [1.3.5-1].
diff --git a/rel-eng/packages/spacecmd b/rel-eng/packages/spacecmd
index a8fec68..a7cdb78 100644
--- a/rel-eng/packages/spacecmd
+++ b/rel-eng/packages/spacecmd
@@ -1 +1 @@
-1.3.4-1 spacecmd/
+1.3.5-1 spacecmd/
diff --git a/spacecmd/spacecmd.spec b/spacecmd/spacecmd.spec
index de2b7f9..a5f2e91 100644
--- a/spacecmd/spacecmd.spec
+++ b/spacecmd/spacecmd.spec
@@ -4,7 +4,7 @@
%endif
Name: spacecmd
-Version: 1.3.4
+Version: 1.3.5
Release: 1%{?dist}
Summary: Command-line interface to Spacewalk and Satellite servers
@@ -61,6 +61,12 @@ touch %{buildroot}/%{python_sitelib}/spacecmd/__init__.py
%doc %{_mandir}/man1/spacecmd.1.gz
%changelog
+* Tue Dec 21 2010 Aron Parsons <aparsons(a)redhat.com> 1.3.5-1
+- discard the password variable once we use it
+- attempt to re-login as the same user if the cached credentials are invalid
+- fix logic regarding which configuration files to load
+- don't try to load non-existent config sections
+
* Tue Dec 21 2010 Aron Parsons <aparsons(a)redhat.com> 1.3.4-1
- support server-specific configuration sections in the configuration file
- added support for a system-wide configuration file
commit b60636091c11eb167649c243b72eba76ee09f6aa
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Tue Dec 21 16:26:40 2010 -0500
spacecmd: renamed current user variable to avoid confusion
diff --git a/spacecmd/src/lib/misc.py b/spacecmd/src/lib/misc.py
index dd24491..355dd03 100644
--- a/spacecmd/src/lib/misc.py
+++ b/spacecmd/src/lib/misc.py
@@ -283,7 +283,7 @@ def do_login(self, args):
self.client.user.listUsers(self.session)
except:
logging.warning('Cached credentials are invalid')
- self.username = ''
+ self.current_user = ''
self.session = ''
# attempt to login if we don't have a valid session yet
@@ -335,7 +335,7 @@ def do_login(self, args):
self.load_caches(server)
# keep track of who we are and who we're connected to
- self.username = username
+ self.current_user = username
self.server = server
logging.info('Connected to %s as %s' % (server_url, username))
@@ -353,7 +353,7 @@ def do_logout(self, args):
self.client.auth.logout(self.session)
self.session = ''
- self.username = ''
+ self.current_user = ''
self.server = ''
self.do_clear_caches('')
@@ -364,8 +364,8 @@ def help_whoami(self):
print 'usage: whoami'
def do_whoami(self, args):
- if len(self.username):
- print self.username
+ if len(self.current_user):
+ print self.current_user
else:
logging.warning("You are not logged in")
diff --git a/spacecmd/src/lib/shell.py b/spacecmd/src/lib/shell.py
index 4c3fa8d..1ac4733 100644
--- a/spacecmd/src/lib/shell.py
+++ b/spacecmd/src/lib/shell.py
@@ -50,7 +50,7 @@ class SpacewalkShell(Cmd):
def __init__(self, options, conf_dir, config_parser):
self.session = ''
- self.username = ''
+ self.current_user = ''
self.server = ''
self.ssm = {}
self.config = {}
commit 63c566601868d40e254e1399d0e6f454a5df8634
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Tue Dec 21 16:24:59 2010 -0500
spacecmd: discard the password variable once we use it
diff --git a/spacecmd/src/lib/misc.py b/spacecmd/src/lib/misc.py
index 2a25ee7..dd24491 100644
--- a/spacecmd/src/lib/misc.py
+++ b/spacecmd/src/lib/misc.py
@@ -307,6 +307,9 @@ def do_login(self, args):
# login to the server
try:
self.session = self.client.auth.login(username, password)
+
+ # don't keep the password around
+ password = None
except:
logging.error('Invalid credentials')
return False
commit e0cead7167ed81ec795eb6ee251be8f433b1378c
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Tue Dec 21 16:23:28 2010 -0500
spacecmd: attempt to re-login as the same user if the cached credentials are invalid
diff --git a/spacecmd/src/lib/misc.py b/spacecmd/src/lib/misc.py
index 87a59c0..2a25ee7 100644
--- a/spacecmd/src/lib/misc.py
+++ b/spacecmd/src/lib/misc.py
@@ -283,7 +283,7 @@ def do_login(self, args):
self.client.user.listUsers(self.session)
except:
logging.warning('Cached credentials are invalid')
- username = ''
+ self.username = ''
self.session = ''
# attempt to login if we don't have a valid session yet
commit 40753b86381ef27ef100f2bc0e0a1b24e1bc0138
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Tue Dec 21 16:21:05 2010 -0500
spacecmd: fix logic regarding which configuration files to load
diff --git a/spacecmd/src/bin/spacecmd b/spacecmd/src/bin/spacecmd
index 025fc23..63ad9b9 100755
--- a/spacecmd/src/bin/spacecmd
+++ b/spacecmd/src/bin/spacecmd
@@ -87,16 +87,8 @@ if __name__ == '__main__':
else:
shell.config['server'] = 'localhost'
- # load options from a configuration file
- if os.path.isfile(user_conf_file):
- files_read = config.read( [ _SYSTEM_CONF_FILE, user_conf_file ] )
-
- for item in files_read:
- logging.debug('Read configuration from %s' % item)
-
- # load the default configuration section
- shell.load_config_section('spacecmd')
- else:
+ # create an empty configuration file if one's not present
+ if not os.path.isfile(user_conf_file):
try:
# create ~/.spacecmd
if not os.path.isdir(conf_dir):
@@ -104,12 +96,22 @@ if __name__ == '__main__':
os.mkdir(conf_dir, 0700)
# create a template configuration file
+ logging.debug('Creating configuration file: %s' % user_conf_file)
handle = open(user_conf_file, 'w')
handle.write('[spacecmd]\n')
handle.close()
except IOError:
logging.error('Could not create %s' % user_conf_file)
+ # load options from configuration files
+ files_read = config.read( [ _SYSTEM_CONF_FILE, user_conf_file ] )
+
+ for item in files_read:
+ logging.debug('Read configuration from %s' % item)
+
+ # load the default configuration section
+ shell.load_config_section('spacecmd')
+
# run a single command from the command line
if len(args):
try:
commit 851b8b0919674b616cf48f9a151a517e18522de3
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Tue Dec 21 16:20:05 2010 -0500
spacecmd: don't try to load non-existent config sections
diff --git a/spacecmd/src/lib/misc.py b/spacecmd/src/lib/misc.py
index f83d23e..87a59c0 100644
--- a/spacecmd/src/lib/misc.py
+++ b/spacecmd/src/lib/misc.py
@@ -202,8 +202,7 @@ def do_login(self, args):
return False
# load the server-specific configuration
- if self.config_parser.has_section(server):
- self.load_config_section(server)
+ self.load_config_section(server)
# an argument passed to the function get precedence
if len(args):
@@ -877,6 +876,10 @@ def replace_line_buffer(self, msg = None):
def load_config_section(self, section):
config_opts = [ 'server', 'username', 'password', 'nossl' ]
+ if not self.config_parser.has_section(section):
+ logging.debug('Configuration section [%s] does not exist' % section)
+ return
+
logging.debug('Loading configuration section [%s]' % section)
for key in config_opts:
13 years, 4 months
backend/satellite_tools
by Jan Pazdziora
backend/satellite_tools/exporter/exportLib.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 24f12b8d816cb72d601132548c7c7e082efb8805
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 21 22:27:15 2010 +0100
Need to alias column with AS for PostgreSQL.
Addressing
Exporting: ('syntax error at or near "time" at character 100
', 0, "
select
name, text,
TO_CHAR(time, 'YYYYMMDDHH24MISS') time
from rhnPackageChangeLog
where package_id = %(package_id)s
")
16:24:14
SQLStatementPrepareError caught in dump_packages.
diff --git a/backend/satellite_tools/exporter/exportLib.py b/backend/satellite_tools/exporter/exportLib.py
index 3d18a72..9fc40ab 100644
--- a/backend/satellite_tools/exporter/exportLib.py
+++ b/backend/satellite_tools/exporter/exportLib.py
@@ -691,7 +691,7 @@ class _PackageDumper(BaseRowDumper):
h = rhnSQL.prepare("""
select
name, text,
- TO_CHAR(time, 'YYYYMMDDHH24MISS') time
+ TO_CHAR(time, 'YYYYMMDDHH24MISS') as time
from rhnPackageChangeLog
where package_id = :package_id
""")
13 years, 4 months
Changes to 'refs/tags/osad-5.9.48-1'
by Jan Pazdziora
Tag 'osad-5.9.48-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2010-12-21 20:08 +0000
Tagging package [osad] version [5.9.48-1] in directory [client/tools/osad/].
Changes since spacecmd-1.3.4-1:
Jan Pazdziora (4):
Use params in prepare to support the anonymous PL/pgSQL in PostgreSQL; also use sequence_nextval.
Use current_timestamp instead of sysdate.
Need to use date_diff_in_days instead of date arithmetics for PostgreSQL.
Automatic commit of package [osad] release [5.9.48-1].
Miroslav Suchý (1):
use difflib instead of external "diff -u"
---
backend/server/handlers/config_mgmt/rhn_config_management.py | 25 ++++-------
client/tools/osad/osad.spec | 5 +-
client/tools/osad/src/osa_dispatcher.py | 23 +++++-----
rel-eng/packages/osad | 2
4 files changed, 29 insertions(+), 26 deletions(-)
---
13 years, 4 months
client/tools rel-eng/packages
by Jan Pazdziora
client/tools/osad/osad.spec | 5 ++++-
rel-eng/packages/osad | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 3870761b21e33795d41ab5aee155ca0064c6652b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 21 21:08:03 2010 +0100
Automatic commit of package [osad] release [5.9.48-1].
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 04c7e6b..85293de 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -9,7 +9,7 @@ Group: System Environment/Daemons
License: GPLv2
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.9.47
+Version: 5.9.48
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -246,6 +246,9 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
# $Id$
%changelog
+* Tue Dec 21 2010 Jan Pazdziora 5.9.48-1
+- SQL changes for PostgreSQL support.
+
* Fri Dec 10 2010 Michael Mraka <michael.mraka(a)redhat.com> 5.9.47-1
- 661998 - removed looping symlink
- fixed symlink creation
diff --git a/rel-eng/packages/osad b/rel-eng/packages/osad
index b99d340..5357cab 100644
--- a/rel-eng/packages/osad
+++ b/rel-eng/packages/osad
@@ -1 +1 @@
-5.9.47-1 client/tools/osad/
+5.9.48-1 client/tools/osad/
13 years, 4 months
client/tools
by Jan Pazdziora
client/tools/osad/src/osa_dispatcher.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 51d7ecf1e3a2d81ef56d134823f535c0b8f41f1e
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 21 20:57:06 2010 +0100
Need to use date_diff_in_days instead of date arithmetics for PostgreSQL.
Addressing
2010/12/21 14:19:20 -04:00 25939 0.0.0.0: osad/jabber_lib.main('ERROR', 'Traceback (most recent call last):
File "/usr/share/rhn/osad/jabber_lib.py", line 121, in main
self.process_forever(c)
File "/usr/share/rhn/osad/jabber_lib.py", line 179, in process_forever
self.process_once(client)
File "/usr/share/rhn/osad/osa_dispatcher.py", line 167, in process_once
self._tcp_server.notify_jabber_nodes()
File "/usr/share/rhn/osad/osa_dispatcher.py", line 299, in notify_jabber_nodes
h.execute()
File "/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/sql_base.py", line 166, in execute
return apply(self._execute_wrapper, (self._execute, ) + p, kw)
File "/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 263, in _execute_wrapper
raise rhnSQL.SQLStatementPrepareError(0, str(e), self.sql)
SQLStatementPrepareError: (\'column "sysdate" does not exist at character 85\
\', 0, "\
select a.id, sa.server_id, pc.jabber_id,\
(earliest_action - sysdate) * 86400 delta\
from\
rhnServerAction sa,\
rhnAction a,\
rhnPushClient pc\
where pc.server_id = sa.server_id\
and sa.action_id = a.id\
and sa.status in (0, 1) -- Queued or picked up\
and not exists (\
-- This is like saying \'this action has no\
-- prerequisite or has a prerequisite that has completed\
-- (status = 2)\
select 1\
from rhnServerAction sap\
where sap.server_id = sa.server_id\
and sap.action_id = a.prerequisite\
and sap.status != 2\
)\
order by earliest_action\
")
')
diff --git a/client/tools/osad/src/osa_dispatcher.py b/client/tools/osad/src/osa_dispatcher.py
index df865e5..3595717 100644
--- a/client/tools/osad/src/osa_dispatcher.py
+++ b/client/tools/osad/src/osa_dispatcher.py
@@ -336,7 +336,7 @@ class UpstreamServer(SocketServer.TCPServer):
# smaller than rhnAction
_query_get_pending_clients = rhnSQL.Statement("""
select a.id, sa.server_id, pc.jabber_id,
- (earliest_action - sysdate) * 86400 delta
+ date_diff_in_days(current_timestamp, earliest_action) * 86400 delta
from
rhnServerAction sa,
rhnAction a,
13 years, 4 months
client/tools
by Jan Pazdziora
client/tools/osad/src/osa_dispatcher.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit b8271630803cef9d704a86c0c0f076e1b318a219
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 21 20:19:47 2010 +0100
Use current_timestamp instead of sysdate.
Addressing
2010/12/21 14:17:30 -04:00 25858 0.0.0.0: osad/jabber_lib.main('ERROR', 'Traceback (most recent call last):
File "/usr/share/rhn/osad/jabber_lib.py", line 121, in main
self.process_forever(c)
File "/usr/share/rhn/osad/jabber_lib.py", line 179, in process_forever
self.process_once(client)
File "/usr/share/rhn/osad/osa_dispatcher.py", line 146, in process_once
self.reap_pinged_clients()
File "/usr/share/rhn/osad/osa_dispatcher.py", line 185, in reap_pinged_clients
ret = h.execute(online_id=online_id, offline_id=offline_id)
File "/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/sql_base.py", line 166, in execute
return apply(self._execute_wrapper, (self._execute, ) + p, kw)
File "/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 263, in _execute_wrapper
raise rhnSQL.SQLStatementPrepareError(0, str(e), self.sql)
SQLStatementPrepareError: (\'column "sysdate" does not exist at character 144\
\', 0, \'\
update rhnPushClient\
set state_id = %(offline_id)s\
where state_id = %(online_id)s\
and last_ping_time is not null\
and sysdate > next_action_time\
\')
')
diff --git a/client/tools/osad/src/osa_dispatcher.py b/client/tools/osad/src/osa_dispatcher.py
index b914a6d..df865e5 100644
--- a/client/tools/osad/src/osa_dispatcher.py
+++ b/client/tools/osad/src/osa_dispatcher.py
@@ -174,7 +174,7 @@ class Runner(jabber_lib.Runner):
set state_id = :offline_id
where state_id = :online_id
and last_ping_time is not null
- and sysdate > next_action_time
+ and current_timestamp > next_action_time
""")
def reap_pinged_clients(self):
# Get the online and offline ids
13 years, 4 months