java/spacewalk-java.spec rel-eng/packages
by Michael Mraka
java/spacewalk-java.spec | 7 ++++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
New commits:
commit fed59c61b6774463be6c8352a56a89e9cc1772eb
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 22 17:13:28 2010 +0100
Automatic commit of package [spacewalk-java] release [1.3.11-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index d4dabe7..d8fc068 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -17,7 +17,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.3.10
+Version: 1.3.11
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -446,6 +446,11 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Mon Nov 22 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.3.11-1
+- 655519 - PE2.evr.as_vre_simple() -> evr_t_as_vre_simple(PE2.evr) (PG)
+- 655515 - changed DECODE to ANSI CASE (PG)
+- fixing several issues in system_overview query
+
* Fri Nov 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.3.10-1
- fixed wrongly rendered API doc
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 03aa68e..a068d1d 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.3.10-1 java/
+1.3.11-1 java/
13 years, 6 months
4 commits - backend/satellite_tools java/code schema/spacewalk
by Michael Mraka
backend/satellite_tools/spacewalk-data-fsck | 267 ++++++++++
java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml | 9
java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml | 4
schema/spacewalk/postgres/packages/rhn_entitlements.pkb | 16
4 files changed, 279 insertions(+), 17 deletions(-)
New commits:
commit 6adc120be621ea4c9c1463aa00308466f8134388
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 22 16:13:40 2010 +0100
added spacewalk-data-fsck
diff --git a/backend/satellite_tools/spacewalk-data-fsck b/backend/satellite_tools/spacewalk-data-fsck
new file mode 100755
index 0000000..2c3d3be
--- /dev/null
+++ b/backend/satellite_tools/spacewalk-data-fsck
@@ -0,0 +1,267 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+
+import sys
+import os
+import stat
+import re
+import hashlib
+from optparse import Option, OptionParser
+
+try:
+ from spacewalk.common import CFG, initCFG, initLOG, log_debug
+ from spacewalk.server import rhnSQL
+except:
+ _LIBPATH = "/usr/share/rhn"
+ # add to the path if need be
+ if _LIBPATH not in sys.path:
+ sys.path.append(_LIBPATH)
+ from common import CFG, initCFG, initLOG, log_debug
+ from server import rhnSQL
+
+LOG_FILE='/var/log/rhn/spacewalk-data-fsck.log'
+
+report_msg = {
+ 'file' : "%5d files scanned",
+ 'exists' : "ERROR: %5d files missing on disk",
+ 'dbexists' : "ERROR: %5d files missing in database",
+ 'size' : "ERROR: %5d file size mismatch(es)",
+ 'checksum' : "ERROR: %5d file checksum mismatch(es)",
+ 'nevrao' : "ERROR: %5d file NEVRAO mismatch(es)",
+ }
+report = {}
+
+def is_sha256_capable():
+ import rpm
+ ts = rpm.TransactionSet()
+ mi = ts.dbMatch('name', 'spacewalk-schema')
+ cmp = -1
+ try:
+ h = mi.next()
+ cmp = rpm.labelCompare([h['name'], h['version'], h['release']],
+ [h['name'], '0.8.1','1'])
+ except StopIteration:
+ pass
+ return (cmp > 0)
+
+
+def db_init():
+ initCFG('server')
+ rhnSQL.initDB(CFG.DEFAULT_DB)
+
+def package_query(options, bind_path=False):
+ query = """select %s
+ from %s
+ """
+ columns = "p.id, p.org_id, p.package_size, p.path"
+ tables = "rhnPackage p"
+ if options.checksum or options.nevrao:
+ if is_sha256_capable():
+ columns += ", c.checksum, c.checksum_type"
+ tables += " join rhnChecksumView c on p.checksum_id = c.id"
+ else:
+ columns += ", p.md5sum as checksum, 'md5sum' as checksum_type"
+ if options.nevrao:
+ columns += ", n.name, evr.epoch, evr.version, evr.release, a.label as arch"
+ tables += " join rhnPackageName n on p.name_id = n.id"
+ tables += " join rhnPackageEVR evr on p.evr_id = evr.id"
+ tables += " join rhnPackageArch a on p.package_arch_id = a.id"
+ if bind_path:
+ query += "where p.path = :path"
+ return query % (columns, tables)
+
+def check_db_vs_disk(options):
+ for k in report_msg.keys():
+ report[k] = 0
+ query = package_query(options)
+ h = rhnSQL.prepare(query)
+
+ path_prefix = CFG.MOUNT_POINT
+
+ h.execute()
+
+ while 1:
+ row = h.fetchone_dict()
+ if not row:
+ break
+
+ if row['path']:
+ abs_path = os.path.join(path_prefix, row['path'])
+ log(3,abs_path)
+ report['file'] += 1
+
+ if check_disk_exists(abs_path) == 1:
+ report['exists'] += 1
+ else:
+ if options.size:
+ report['size'] += check_disk_size(abs_path, row['package_size'])
+ if options.nevrao:
+ report['nevrao'] += check_disk_nevrao(abs_path, row.copy())
+ if options.checksum:
+ report['checksum'] += check_disk_checksum(abs_path,
+ row['checksum_type'], row['checksum'])
+ h.close()
+ error_found=0
+ for i in ['file', 'exists', 'size', 'nevrao', 'checksum']:
+ if report[i] > 0:
+ log(1, report_msg[i] % report[i])
+ if i != 'file':
+ error_found = 1
+ return error_found
+
+def check_disk_exists(abs_path):
+ ret = 0
+ if not os.path.isfile(abs_path):
+ log(1, "File missing: %s" % abs_path)
+ ret = 1
+ return ret
+
+def check_disk_size(abs_path, size):
+ file_size = os.stat(abs_path)[stat.ST_SIZE]
+ ret = 0
+ if file_size != size:
+ log(1, "File size mismatch: %s (%s vs. %s)" % (abs_path, size, file_size))
+ ret = 1
+ return ret
+
+def check_disk_nevrao(abs_path, row):
+ file = {};
+ (_redhat_,
+ file['org_id'],
+ file['checksum_prefix'],
+ file['name'],
+ file['evr'],
+ file['arch'],
+ file['checksum'],
+ file['basename']) = row['path'].split('/')
+ if not row['org_id']:
+ row['org_id'] = 'NULL'
+ else:
+ row['org_id'] = str(row['org_id'])
+ row['checksum_prefix'] = row['checksum'][:3]
+ if row['epoch']:
+ row['evr'] = row['epoch'] + ':'
+ else:
+ row['evr'] = ''
+ row['evr'] += row['version'] + '-' + row['release']
+ row['basename'] = "%s-%s-%s.%s.rpm" % (
+ row['name'], row['version'], row['release'], row['arch'])
+ ret = 0
+ for key in ('org_id', 'checksum_prefix', 'name', 'evr', 'arch', 'checksum',
+ 'basename'):
+ if file[key] != row[key]:
+ log(1, "File path mismatch: %s (%s: %s vs. %s)" % (abs_path, key, row[key],
+ file[key]))
+ ret = 1
+ return ret
+
+def check_disk_checksum(abs_path, checksum_type, checksum):
+ try:
+ fp = file(abs_path ,'rb')
+ file_checksum = hashlib.new(checksum_type, fp.read()).hexdigest()
+ fp.close()
+ except:
+ file_checksum = None
+ ret = 0
+ if file_checksum != checksum:
+ log(1, "File checksum mismatch: %s (%s: %s vs. %s)" %
+ (abs_path, checksum_type, checksum, file_checksum))
+ ret = 1
+ return ret
+
+def check_disk_vs_db(disk_content=None, db_content=None):
+ for k in report_msg.keys():
+ report[k] = 0
+ query = package_query(options, bind_path=True)
+ h = rhnSQL.prepare(query)
+ for root, dirs, files in os.walk(os.path.join(CFG.MOUNT_POINT, 'redhat')):
+ rel_root = root[len(CFG.MOUNT_POINT)+1:]
+ for f in files:
+ if f[:-4] == '.rpm':
+ continue
+
+ abs_path = os.path.join(root, f)
+ rel_path = os.path.join(rel_root, f)
+ log(3,abs_path)
+ report['file'] += 1
+
+ h.execute(path=rel_path)
+ row = h.fetchone_dict()
+
+ if not row:
+ report['dbexists'] += 1
+ not_in_db(abs_path, options)
+ continue
+
+ if options.size and options.fs_only:
+ report['size'] += check_disk_size(abs_path, row['package_size'])
+ if options.nevrao and options.fs_only:
+ report['nevrao'] += check_disk_nevrao(abs_path, row.copy())
+ if options.checksum and options.fs_only:
+ report['checksum'] += check_disk_checksum(abs_path,
+ row['checksum_type'], row['checksum'])
+ h.close()
+ error_found=0
+ for i in ['file', 'dbexists', 'size', 'nevrao', 'checksum']:
+ if report[i] > 0:
+ log(1, report_msg[i] % report[i])
+ if i != 'file':
+ error_found = 1
+ return error_found
+
+def not_in_db(path, options):
+ if options.remove:
+ log(1, "Removed file missing in db: %s" % (path))
+ os.unlink(path)
+ dirname = os.path.dirname(path)
+ while dirname != CFG.MOUNT_POINT:
+ try:
+ os.rmdir(dirname)
+ except OSError, e:
+ if e.errno == 39: #OSError: [Errno 39] Directory not empty
+ break
+ else:
+ raise e
+ dirname = os.path.dirname(dirname)
+ else:
+ log(1, "File missing in db: %s" % (path))
+
+def log(level, *args):
+ log_debug(level, *args)
+ if options.verbose >= level:
+ print (', '.join(map(lambda i: str(i), args)))
+
+if __name__ == '__main__':
+
+ options_table = [
+ Option("-v", "--verbose", action="count",
+ help="Increase verbosity"),
+ Option("-S", "--no-size", action="store_false", dest="size", default=True,
+ help="Don't check package size"),
+ Option("-C", "--no-checksum", action="store_false", dest="checksum", default=True,
+ help="Don't check package checksum"),
+ Option("-O", "--no-nevrao", action="store_false", dest="nevrao", default=True,
+ help="Don't check package name, epoch, version, release, arch, org"),
+ Option("-d", "--db-only", action="store_true",
+ help="Check only if packages from database are present on filesystem"),
+ Option("-f", "--fs-only", action="store_true",
+ help="Check only if packages from filesystem are in the database"),
+ Option("-r", "--remove", action="store_true",
+ help="Automaticaly remove packages from filesystem not present in database"),
+ ]
+ parser = OptionParser(option_list=options_table)
+ (options, args) = parser.parse_args()
+
+ initLOG(LOG_FILE, options.verbose or 0)
+
+ db_init()
+
+ exit_value=0
+ if not options.fs_only:
+ log(1, "Checking if packages from database are present on filesystem")
+ exit_value += check_db_vs_disk(options)
+ if not options.db_only:
+ log(1, "Checking if packages from filesystem are present in database")
+ exit_value += check_disk_vs_db(options)
+
+ sys.exit(exit_value)
commit 77ffaab00aea2d80b6fa92b0987860eff7d72f6a
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 22 16:00:48 2010 +0100
655509 - fixed namespace
diff --git a/schema/spacewalk/postgres/packages/rhn_entitlements.pkb b/schema/spacewalk/postgres/packages/rhn_entitlements.pkb
index a11b4fa..fbccdbc 100644
--- a/schema/spacewalk/postgres/packages/rhn_entitlements.pkb
+++ b/schema/spacewalk/postgres/packages/rhn_entitlements.pkb
@@ -873,7 +873,7 @@ language plpgsql;
) returns void
as $$
begin
- perform modify_org_service(customer_id_in, 'enterprise', 'Y');
+ perform rhn_entitlements.modify_org_service(customer_id_in, 'enterprise', 'Y');
end$$
language plpgsql;
@@ -882,7 +882,7 @@ language plpgsql;
) returns void
as $$
begin
- perform modify_org_service(customer_id_in, 'provisioning', 'Y');
+ perform rhn_entitlements.modify_org_service(customer_id_in, 'provisioning', 'Y');
end$$
language plpgsql;
@@ -891,7 +891,7 @@ language plpgsql;
) returns void
as $$
begin
- perform modify_org_service(customer_id_in, 'monitoring', 'Y');
+ perform rhn_entitlements.modify_org_service(customer_id_in, 'monitoring', 'Y');
end$$
language plpgsql;
@@ -900,7 +900,7 @@ language plpgsql;
) returns void
as $$
begin
- perform modify_org_service(customer_id_in, 'nonlinux', 'Y');
+ perform rhn_entitlements.modify_org_service(customer_id_in, 'nonlinux', 'Y');
end$$
language plpgsql;
@@ -909,7 +909,7 @@ language plpgsql;
) returns void
as $$
begin
- perform modify_org_service(customer_id_in, 'enterprise', 'N');
+ perform rhn_entitlements.modify_org_service(customer_id_in, 'enterprise', 'N');
end$$
language plpgsql;
@@ -918,7 +918,7 @@ language plpgsql;
) returns void
as $$
begin
- perform modify_org_service(customer_id_in, 'provisioning', 'N');
+ perform rhn_entitlements.modify_org_service(customer_id_in, 'provisioning', 'N');
end$$
language plpgsql;
@@ -927,7 +927,7 @@ language plpgsql;
) returns void
as $$
begin
- perform modify_org_service(customer_id_in, 'monitoring', 'N');
+ perform rhn_entitlements.modify_org_service(customer_id_in, 'monitoring', 'N');
end$$
language plpgsql;
@@ -936,7 +936,7 @@ language plpgsql;
) returns void
as $$
begin
- perform modify_org_service(customer_id_in, 'nonlinux', 'N');
+ perform rhn_entitlements.modify_org_service(customer_id_in, 'nonlinux', 'N');
end$$
language plpgsql;
commit b09afcd48c2e7826982586ae0745cb299bcf0b33
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 22 14:55:13 2010 +0100
655519 - PE2.evr.as_vre_simple() -> evr_t_as_vre_simple(PE2.evr) (PG)
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
index 7d146d1..ba4a889 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
@@ -1324,8 +1324,8 @@ ORDER BY last_modified
<query params="cid, eid">
SELECT P1.id,
PN.name,
- PE2.evr.as_vre_simple() || '.' || PA2.label AS current_nvrea,
- PE1.evr.as_vre_simple() || '.' || PA1.label AS new_nvrea
+ evr_t_as_vre_simple(PE2.evr) || '.' || PA2.label AS current_nvrea,
+ evr_t_as_vre_simple(PE1.evr) || '.' || PA1.label AS new_nvrea
FROM rhnPackage P1,
rhnPackageEVR PE1,
rhnPackageArch PA1,
commit 16279c453c08f0eb6366e6225f1bad22d31d3028
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 22 14:45:53 2010 +0100
655515 - changed DECODE to ANSI CASE (PG)
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
index 5fc2eee..52ec500 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
@@ -248,12 +248,7 @@ SELECT FL.file_id id, L.label LOCATIONS
SELECT AC.channel_id AS ID,
AC.channel_name AS NAME,
rhn_channel.user_role_check(AC.channel_id, :user_id, 'subscribe') AS HAS_PERM,
- DECODE(
-rhn_channel.org_channel_setting(AC.channel_id, :org_id,'not_globally_subscribable'),
-0,
-1,
-NULL
- ) AS GLOBALLY_SUBSCRIBABLE
+ CASE rhn_channel.org_channel_setting(AC.channel_id, :org_id,'not_globally_subscribable') WHEN 0 THEN 1 ELSE NULL END AS GLOBALLY_SUBSCRIBABLE
FROM rhnAvailableChannels AC
WHERE AC.org_id = :org_id
ORDER BY UPPER(AC.channel_name)
@@ -1196,4 +1191,4 @@ END;
</query>
</callable-mode>
-</datasource_modes>
\ No newline at end of file
+</datasource_modes>
13 years, 6 months
Changes to 'refs/tags/spacecmd-1.3.1-1'
by aparsons
Tag 'spacecmd-1.3.1-1' created by Aron Parsons <aparsons(a)redhat.com> at 2010-11-22 14:59 +0000
Tagging package [spacecmd] version [1.3.1-1] in directory [spacecmd/].
Changes since spacewalk-backend-1.3.10-1:
Aron Parsons (3):
655055 - honor the quiet flag when generating caches in spacecmd
spacecmd: fix uninitialized variable in snippet_create
Automatic commit of package [spacecmd] release [1.3.1-1].
---
rel-eng/packages/spacecmd | 2 +-
spacecmd/spacecmd.spec | 5 ++++-
spacecmd/src/lib/misc.py | 30 ++++++++++++++++++------------
spacecmd/src/lib/snippet.py | 14 +++++++-------
4 files changed, 30 insertions(+), 21 deletions(-)
---
13 years, 6 months
rel-eng/packages spacecmd/spacecmd.spec
by aparsons
rel-eng/packages/spacecmd | 2 +-
spacecmd/spacecmd.spec | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit b57e8f65006b1a1481d3db6d373b109f49752ba9
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Mon Nov 22 09:59:09 2010 -0500
Automatic commit of package [spacecmd] release [1.3.1-1].
diff --git a/rel-eng/packages/spacecmd b/rel-eng/packages/spacecmd
index 9a4ea51..2aacda1 100644
--- a/rel-eng/packages/spacecmd
+++ b/rel-eng/packages/spacecmd
@@ -1 +1 @@
-1.2.2-1 spacecmd/
+1.3.1-1 spacecmd/
diff --git a/spacecmd/spacecmd.spec b/spacecmd/spacecmd.spec
index d68a335..fbf4692 100644
--- a/spacecmd/spacecmd.spec
+++ b/spacecmd/spacecmd.spec
@@ -4,7 +4,7 @@
%endif
Name: spacecmd
-Version: 1.3.0
+Version: 1.3.1
Release: 1%{?dist}
Summary: Command-line interface to Spacewalk and Satellite servers
@@ -57,6 +57,9 @@ touch %{buildroot}/%{python_sitelib}/spacecmd/__init__.py
%doc %{_mandir}/man1/spacecmd.1.gz
%changelog
+* Mon Nov 22 2010 Aron Parsons <aparsons(a)redhat.com> 1.3.1-1
+- fix uninitialized variable in snippet_create
+- 655055 - honor the quiet flag when generating caches in spacecmd
* Fri Nov 05 2010 Aron Parsons <aparsons(a)redhat.com> 1.2.2-1
- spacecmd: fixed exception in kickstart_create due to typo
(aparsons(a)redhat.com)
13 years, 6 months
spacecmd/src
by aparsons
spacecmd/src/lib/snippet.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
New commits:
commit 1f15e226417a46f94c4b894c1c1b259a960d7e5b
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Mon Nov 22 09:57:47 2010 -0500
spacecmd: fix uninitialized variable in snippet_create
diff --git a/spacecmd/src/lib/snippet.py b/spacecmd/src/lib/snippet.py
index 7d0280a..6d4acdc 100644
--- a/spacecmd/src/lib/snippet.py
+++ b/spacecmd/src/lib/snippet.py
@@ -95,6 +95,8 @@ def do_snippet_create(self, args, update_name = ''):
(args, options) = parse_arguments(args, options)
+ contents = ''
+
if is_interactive(options):
# if update_name was passed, we're trying to update an existing snippet
if update_name:
@@ -103,7 +105,7 @@ def do_snippet_create(self, args, update_name = ''):
snippets = self.client.kickstart.snippet.listCustom(self.session)
for s in snippets:
if s.get('name') == update_name:
- options.contents = s.get('contents')
+ contents = s.get('contents')
break
if not options.name:
@@ -113,9 +115,7 @@ def do_snippet_create(self, args, update_name = ''):
nospacer = True, ignore_yes = True):
options.file = prompt_user('File:')
else:
- if not options.contents: options.contents = ''
-
- (options.contents, ignore) = editor(template = options.contents,
+ (contents, ignore) = editor(template = contents,
delete=True)
else:
if not options.name:
@@ -127,17 +127,17 @@ def do_snippet_create(self, args, update_name = ''):
return
if options.file:
- options.contents = read_file(options.file)
+ contents = read_file(options.file)
print
print 'Contents'
print '--------'
- print options.contents
+ print contents
if self.user_confirm():
self.client.kickstart.snippet.createOrUpdate(self.session,
options.name,
- options.contents)
+ contents)
####################
13 years, 6 months
spacecmd/src
by aparsons
spacecmd/src/lib/misc.py | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
New commits:
commit 372c89d225acfbd3306e47ecda36eca319aaf6d9
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Mon Nov 22 09:47:23 2010 -0500
655055 - honor the quiet flag when generating caches in spacecmd
diff --git a/spacecmd/src/lib/misc.py b/spacecmd/src/lib/misc.py
index 080a11f..8ed89d2 100644
--- a/spacecmd/src/lib/misc.py
+++ b/spacecmd/src/lib/misc.py
@@ -423,8 +423,9 @@ def generate_errata_cache(self, force=False):
if not force and datetime.now() < self.errata_cache_expire:
return
- # tell the user what's going on
- self.replace_line_buffer('** Generating errata cache **')
+ if not self.options.quiet:
+ # tell the user what's going on
+ self.replace_line_buffer('** Generating errata cache **')
channels = self.client.channel.listSoftwareChannels(self.session)
channels = [c.get('label') for c in channels]
@@ -446,8 +447,9 @@ def generate_errata_cache(self, force=False):
self.save_errata_cache()
- # restore the original line buffer
- self.replace_line_buffer()
+ if not self.options.quiet:
+ # restore the original line buffer
+ self.replace_line_buffer()
def save_errata_cache(self):
@@ -468,8 +470,9 @@ def generate_package_cache(self, force=False):
if not force and datetime.now() < self.package_cache_expire:
return
- # tell the user what's going on
- self.replace_line_buffer('** Generating package cache **')
+ if not self.options.quiet:
+ # tell the user what's going on
+ self.replace_line_buffer('** Generating package cache **')
channels = self.client.channel.listSoftwareChannels(self.session)
channels = [c.get('label') for c in channels]
@@ -496,8 +499,9 @@ def generate_package_cache(self, force=False):
self.save_package_caches()
- # restore the original line buffer
- self.replace_line_buffer()
+ if not self.options.quiet:
+ # restore the original line buffer
+ self.replace_line_buffer()
def save_package_caches(self):
@@ -553,8 +557,9 @@ def generate_system_cache(self, force=False):
if not force and datetime.now() < self.system_cache_expire:
return
- # tell the user what's going on
- self.replace_line_buffer('** Generating system cache **')
+ if not self.options.quiet:
+ # tell the user what's going on
+ self.replace_line_buffer('** Generating system cache **')
systems = self.client.system.listSystems(self.session)
@@ -567,8 +572,9 @@ def generate_system_cache(self, force=False):
self.save_system_cache()
- # restore the original line buffer
- self.replace_line_buffer()
+ if not self.options.quiet:
+ # restore the original line buffer
+ self.replace_line_buffer()
def save_system_cache(self):
13 years, 6 months
Changes to 'refs/tags/spacewalk-backend-1.3.10-1'
by Lukas Zapletal
Tag 'spacewalk-backend-1.3.10-1' created by Lukas Zapletal <lzap+git(a)redhat.com> at 2010-11-22 12:20 +0000
Tagging package [spacewalk-backend] version [1.3.10-1] in directory [backend/].
Changes since spacewalk-backend-1.3.9-1:
Lukas Zapletal (3):
Revert "Changing time to timestamp in SQL select (PG)"
Reverting two commits on packages.py
Automatic commit of package [spacewalk-backend] release [1.3.10-1].
Tomas Lestach (1):
fixing several issues in system_overview query
---
backend/satellite_tools/exporter/exportLib.py | 2 -
backend/server/handlers/app/packages.py | 12 +++---
backend/spacewalk-backend.spec | 6 ++-
java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml | 19 +++++-----
rel-eng/packages/spacewalk-backend | 2 -
5 files changed, 23 insertions(+), 18 deletions(-)
---
13 years, 6 months
3 commits - backend/satellite_tools backend/server backend/spacewalk-backend.spec rel-eng/packages
by Lukas Zapletal
backend/satellite_tools/exporter/exportLib.py | 2 +-
backend/server/handlers/app/packages.py | 12 ++++++------
backend/spacewalk-backend.spec | 6 +++++-
rel-eng/packages/spacewalk-backend | 2 +-
4 files changed, 13 insertions(+), 9 deletions(-)
New commits:
commit 0e613d66fc687c7530396854d2118bf439d866f2
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Mon Nov 22 13:20:42 2010 +0100
Automatic commit of package [spacewalk-backend] release [1.3.10-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 572c222..3a633c4 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.9
+Version: 1.3.10
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -669,6 +669,10 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Mon Nov 22 2010 Lukas Zapletal 1.3.10-1
+- Reverting two commits on packages.py
+- Revert "Changing time to timestamp in SQL select (PG)"
+
* Mon Nov 22 2010 Lukas Zapletal 1.3.9-1
- Solving nonexisting Numeric->Varchar case in packages.py (PG)
- Package data are being deleted from view rather than from table (PG)
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 7b454cd..f72f9a6 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.3.9-1 backend/
+1.3.10-1 backend/
commit 63104ba3d92437ddeab278b016e28b455e93d762
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Mon Nov 22 13:18:01 2010 +0100
Reverting two commits on packages.py
Reverts a924d23d6ca13bfa931b3f96b2401061898e993f (Solving nonexisting
Numeric->Varchar case in packages.py (PG) and
d3c1de4ddc8bb082390e999e7feeaaebc38c372b (Force EVR to be strings in the
backend (PG)).
Explicit numeric cast and explicit string cast did not help here. I need to
find other solution.
diff --git a/backend/server/handlers/app/packages.py b/backend/server/handlers/app/packages.py
index 5e522cf..f4f8d36 100644
--- a/backend/server/handlers/app/packages.py
+++ b/backend/server/handlers/app/packages.py
@@ -478,11 +478,11 @@ class Packages(RPC_Base):
rhnChecksumView c
where
pn.name = :pkg_name
- and ( pe.epoch = cast(:pkg_epoch as varchar(16)) or
+ and ( pe.epoch = :pkg_epoch or
( pe.epoch is null and :pkg_epoch is null )
)
- and pe.version = cast(:pkg_version as varchar(512))
- and pe.release = cast(:pkg_rel as varchar(512))
+ and pe.version = :pkg_version
+ and pe.release = :pkg_rel
and ( p.org_id = :orgid or
( p.org_id is null and :orgid is null )
)
@@ -507,9 +507,9 @@ class Packages(RPC_Base):
query_args = {
'pkg_name': pkg_info['name'],
- 'pkg_epoch': str(pkg_epoch),
- 'pkg_version': str(pkg_info['version']),
- 'pkg_rel': str(pkg_info['release']),
+ 'pkg_epoch': pkg_epoch,
+ 'pkg_version': pkg_info['version'],
+ 'pkg_rel': pkg_info['release'],
'pkg_arch': pkg_info['arch'],
'orgid': org_id,
}
commit 4a4c694a97d8e6c34fc2b85e49c124734ed6f19c
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Mon Nov 22 12:16:57 2010 +0100
Revert "Changing time to timestamp in SQL select (PG)"
The proper fix here is to RENAME all columns named "time" to non-reserved
word in PostgreSQL. Or we could also change time to "TIME" in all DDL SQL
files and refer using the same syntax ("TIME"). The renaming approach seems
to be easier and more elegant.
This reverts commit 2b48bce13184d80c2ec066840e7341371427a7a6.
diff --git a/backend/satellite_tools/exporter/exportLib.py b/backend/satellite_tools/exporter/exportLib.py
index 9a007bb..52a533b 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(current_timestamp, 'YYYYMMDDHH24MISS') time
+ TO_CHAR(time, 'YYYYMMDDHH24MISS') time
from rhnPackageChangeLog
where package_id = :package_id
""")
13 years, 6 months
java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml | 19 +++++-----
1 file changed, 10 insertions(+), 9 deletions(-)
New commits:
commit 0b9c3a84de11b07e4feb2fe4956baaa6f408c322
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Mon Nov 22 11:42:53 2010 +0100
fixing several issues in system_overview query
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
index 7e51982..5f6722f 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
@@ -1151,15 +1151,16 @@ ORDER BY S.ID
SERVER_ADMINS, GROUP_COUNT, NOTE_COUNT, MODIFIED, CHANNEL_LABELS, CHANNEL_ID, HISTORY_COUNT,
LAST_CHECKIN_DAYS_AGO, PENDING_UPDATES, OS, RELEASE, SERVER_ARCH_NAME, LAST_CHECKIN, LOCKED,
config_files_with_differences,
- ( SELECT CASE
- MAX(CASE PS.state WHEN 'OK' THEN 1 WHEN 'PENDING' THEN 2 WHEN 'UNKNOWN' THEN 3 WHEN 'WARNING' THEN 4 WHEN 'CRITICAL' THEN 5 END)
- WHEN 1 THEN 'OK' WHEN 2 THEN 'PENDING' WHEN 4 THEN 'WARNING' WHEN 5 THEN 'CRITICAL' END ST
- FROM rhn_probe_state PS, rhn_check_probe CP
- LEFT OUTER JOIN rhnServerOverview OV ON OV.server_id = CP.host_id
- WHERE PS.probe_id = CP.probe_id
- GROUP BY OV.server_id ) MONITORING_STATUS
- FROM rhnServerOverview OV
- WHERE server_id IN (%s)
+ MONITORING_STATUS.ST AS MONITORING_STATUS
+ FROM rhnServerOverview OV LEFT OUTER JOIN
+ ( SELECT CP.host_id, DECODE(
+ MAX(DECODE(PS.state, 'OK', 1, 'PENDING', 2, 'UNKNOWN', 3, 'WARNING', 4, 'CRITICAL', 5)),
+ 1, 'OK', 2, 'PENDING', 3, 'UNKNOWN', 4, 'WARNING', 5, 'CRITICAL') ST
+ FROM rhn_check_probe CP, rhn_probe_state PS
+ WHERE PS.probe_id = CP.probe_id
+ GROUP BY CP.host_id ) MONITORING_STATUS
+ ON OV.server_id = MONITORING_STATUS.host_id
+ WHERE server_id IN (%s)
ORDER BY UPPER(NVL(SERVER_NAME, '(none)')), SERVER_ID
</query>
13 years, 6 months
Changes to 'refs/tags/spacewalk-backend-1.3.9-1'
by Lukas Zapletal
Tag 'spacewalk-backend-1.3.9-1' created by Lukas Zapletal <lzap+git(a)redhat.com> at 2010-11-22 07:17 +0000
Tagging package [spacewalk-backend] version [1.3.9-1] in directory [backend/].
Changes since rhn-client-tools-1.3.1-1:
Lukas Zapletal (4):
Changing time to timestamp in SQL select (PG)
Package data are being deleted from view rather than from table (PG)
Solving nonexisting Numeric->Varchar case in packages.py (PG)
Automatic commit of package [spacewalk-backend] release [1.3.9-1].
---
backend/satellite_tools/exporter/exportLib.py | 2 +-
backend/satellite_tools/spacewalk-remove-channel | 2 +-
backend/server/handlers/app/packages.py | 6 +++---
backend/spacewalk-backend.spec | 7 ++++++-
rel-eng/packages/spacewalk-backend | 2 +-
5 files changed, 12 insertions(+), 7 deletions(-)
---
13 years, 6 months