4 commits - backend/satellite_tools backend/server
by Michael Mraka
backend/satellite_tools/diskImportLib.py | 2
backend/satellite_tools/xmlSource.py | 3
backend/server/rhnPackage.py | 112 -------------------------------
backend/server/rhnSQL/sql_row.py | 14 ---
4 files changed, 3 insertions(+), 128 deletions(-)
New commits:
commit acdc28bffc53e19a9f4d9ab4ced48fd0298990ae
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Oct 21 22:00:39 2010 +0200
fixed NameError: name 'SourcePackageImport' is not defined
diff --git a/backend/satellite_tools/diskImportLib.py b/backend/satellite_tools/diskImportLib.py
index 06cd255..555f815 100644
--- a/backend/satellite_tools/diskImportLib.py
+++ b/backend/satellite_tools/diskImportLib.py
@@ -26,7 +26,7 @@ from spacewalk.server.rhnSQL.const import ORACLE, POSTGRESQL
import xmlSource
import xmlDiskSource
from spacewalk.server.importlib.channelImport import ChannelImport, ChannelFamilyImport
-from spacewalk.server.importlib.packageImport import PackageImport
+from spacewalk.server.importlib.packageImport import PackageImport, SourcePackageImport
from spacewalk.server.importlib import archImport
from spacewalk.server.importlib import blacklistImport
from spacewalk.server.importlib import productNamesImport
commit 712f7b913ee1572d05b82ec604f71eb947cc6ce1
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Oct 21 14:34:56 2010 +0200
removed redundant empty tagMaps
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index 88bc8e8..4d333ec 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -708,7 +708,6 @@ addItem(ErratumItem)
class ErrorItem(BaseItem):
item_name = 'rhn-error'
item_class = importLib.Error
- tagMap = {}
addItem(ErrorItem)
class ErrataFileItem(BaseChecksummedItem):
@@ -727,13 +726,11 @@ addItem(ErrataFileItem)
class BlacklistObsoleteItem(BaseItem):
item_name = 'rhn-blacklist-obsolete'
item_class = importLib.BlacklistObsoletes
- tagMap = {}
addItem(BlacklistObsoleteItem)
class ProductNamesItem(BaseItem):
item_name = 'rhn-product-name'
item_class = importLib.ProductName
- tagMap = {}
addItem(ProductNamesItem)
class KickstartableTreeItem(BaseItem):
commit c89830b90cb36bd6a79641553c5091c57af8fb8e
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Oct 11 16:22:24 2010 +0200
reused load_sql() for load()
diff --git a/backend/server/rhnSQL/sql_row.py b/backend/server/rhnSQL/sql_row.py
index 0cc61c2..7edcff2 100644
--- a/backend/server/rhnSQL/sql_row.py
+++ b/backend/server/rhnSQL/sql_row.py
@@ -94,19 +94,9 @@ class Row(UserDictCase):
# load an entry
def load(self, hashval):
- h = self.db.prepare("select * from %s where %s = :hashval" % (self.table, self.hashname))
- h.execute(hashval = hashval)
- ret = h.fetchone_dict()
- self.data = {}
- if not ret:
- self.real = 0
- return 0
- for k in ret.keys():
- self.data[k] = (ret[k], 0)
- self.real = 1
- return 1
+ return load_sql(self, "%s = :hashval" % self.hashname, {'hashval': hashval})
- # kind of the same as load, but we load it from a sql clause instead
+ # load from a sql clause
def load_sql(self, sql, pdict = {}):
h = self.db.prepare("select * from %s where %s" % (self.table, sql))
apply(h.execute, (), pdict)
commit e6faded456561eadbb8b4d7a685a51a4c63d73f6
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Oct 8 16:16:41 2010 +0200
XXX: not used currently; removing
diff --git a/backend/server/rhnPackage.py b/backend/server/rhnPackage.py
index 303898f..e9bfdff 100644
--- a/backend/server/rhnPackage.py
+++ b/backend/server/rhnPackage.py
@@ -295,115 +295,6 @@ def get_source_package_path_by_name(server_id, packageName):
rhnFlags.set("Download-Accelerator-Path", rs['path'])
return filePath
-
-# get source package path from [n,v,r,e,a]
-# XXX: not used currently
-def get_source_package_path_by_nvrea(server_id, pkg):
- log_debug(3, pkg)
- pkg = map(str, pkg)
- # Build the param dict
- param_dict = {
- 'name' : pkg[0],
- 'ver' : pkg[1],
- 'rel' : pkg[2],
- 'arch' : pkg[4],
- 'server_id' : server_id
- }
- if pkg[3] == '':
- epochStatement = "is NULL"
- else:
- epochStatement = "= :epoch"
- param_dict['epoch'] = pkg[3]
-
- statement = """
- select
- unique ps.path
- from
- rhnPackage p,
- rhnPackageSource ps,
- rhnPackageName pn,
- rhnPackageEVR pe,
- rhnPackageArch pa,
- rhnChannelPackage cp,
- rhnServerChannel sc
- where
- sc.server_id = :server_id
- and sc.channel_id = cp.channel_id
- and cp.package_id = p.id
- and p.source_rpm_id = ps.source_rpm_id
- and ((p.org_id is null and ps.org_id is null)
- or (p.org_id = ps.org_id))
- and p.name_id = pn.id
- and pn.name = :name
- and p.evr_id = pe.id
- and pe.version = :ver
- and pe.release = :rel
- and pe.epoch %s
- and p.package_arch_id = pa.id
- and pa.label = :arch
- """ % epochStatement
- h = rhnSQL.prepare(statement)
- apply(h.execute, (), param_dict)
-
- rs = h.fetchone_dict()
- if not rs:
- log_debug(4, "Error", "Non-existant package requested", server_id,
- pkg)
- raise rhnFault(17, _("Invalid RPM package %s requested") % pkg)
-
- filePath = "%s/%s" % (CFG.MOUNT_POINT, rs['path'])
- if not os.access(filePath, os.R_OK):
- # Package not found on the filesystem
- log_error("Package not found", filePath)
- raise rhnFault(17, _("Package not found"))
-
- # Set the flag for the proxy download accelerator
- rhnFlags.set("Download-Accelerator-Path", rs['path'])
- return filePath
-
-
-# get all channels that have this [n,v,r,e,a]
-# XXX: no use for this yet.
-def get_channels_for_package(pkg):
- log_debug(3, pkg)
- pkg = map(str, pkg)
- if pkg[3] == "":
- epochStatement = "is null"
- else:
- epochStatement = "= :epoch"
- statement = """
- select
- c.label
- from
- rhnChannel c,
- rhnPackage p,
- rhnPackageName pn,
- rhnPackageEVR pe,
- rhnPackageArch pa,
- rhnChannelPackage cp
- where
- p.name_id = pn.id
- and pn.name = :name
- and p.evr_id = pe.id
- and pe.version = :ver
- and pe.release = :rel
- and pe.epoch %s
- and p.package_arch_id = pa.id
- and pa.label = :arch
- and p.id = cp.package_id
- and cp.channel_id = c.id
- """ % epochStatement
- h = rhnSQL.prepare(statement)
- if pkg[3] == '':
- h.execute(name = pkg[0], ver = pkg[1], rel = pkg[2], arch = pkg[4])
- else:
- h.execute(name = pkg[0], ver = pkg[1], rel = pkg[2], arch = pkg[4], epoch=pkg[3],)
-
- ret = h.fetchall_dict()
- if not ret:
- return []
- return map(lambda c: c['label'], ret)
-
def get_path_for_checksum(org_id, checksum_type, checksum):
statement = """
select
@@ -487,6 +378,3 @@ if __name__ == '__main__':
print get_source_package_path_by_nvre(1000463284, ['kernel', '2.4.2', '2', ''])
print get_source_package_path_by_name(1000463284, 'kernel-2.4.2-2.src.rpm')
- # not used currently
- print get_source_package_path_by_nvrea(1000463284, ['kernel-headers', '2.4.2', '2', '', 'i386'])
- print get_channels_for_package(['kernel', '2.4.9', '31', '', 'i386'])
13 years, 6 months
Changes to 'refs/tags/spacewalk-schema-1.2.56-1'
by Lukas Zapletal
Tag 'spacewalk-schema-1.2.56-1' created by Lukas Zapletal <lzap+git(a)redhat.com> at 2010-10-27 09:40 +0000
Tagging package [spacewalk-schema] version [1.2.56-1] in directory [schema/spacewalk/].
Changes since spacewalk-java-1.2.74-1:
Lukas Zapletal (1):
Automatic commit of package [spacewalk-schema] release [1.2.56-1].
---
rel-eng/packages/spacewalk-schema | 2 +-
schema/spacewalk/spacewalk-schema.spec | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
---
13 years, 6 months
rel-eng/packages schema/spacewalk
by Lukas Zapletal
rel-eng/packages/spacewalk-schema | 2 +-
schema/spacewalk/spacewalk-schema.spec | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit c25aa63c9a75c6748bd00e815a5b19bf403920e6
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Wed Oct 27 11:40:59 2010 +0200
Automatic commit of package [spacewalk-schema] release [1.2.56-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema
index ed8e197..9e02f45 100644
--- a/rel-eng/packages/spacewalk-schema
+++ b/rel-eng/packages/spacewalk-schema
@@ -1 +1 @@
-1.2.55-1 schema/spacewalk/
+1.2.56-1 schema/spacewalk/
diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec
index 8c07211..46d8858 100644
--- a/schema/spacewalk/spacewalk-schema.spec
+++ b/schema/spacewalk/spacewalk-schema.spec
@@ -2,7 +2,7 @@ Name: spacewalk-schema
Group: Applications/Internet
Summary: Oracle SQL schema for Spacewalk server
-Version: 1.2.55
+Version: 1.2.56
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
@@ -59,6 +59,12 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/spacewalk-schema-upgrade*
%changelog
+* Wed Oct 27 2010 Lukas Zapletal 1.2.56-1
+- Addresing recursion with opened cursor in PostgreSQL
+- Function unsubscribe_server now in sync with Oracle
+- Function numtodsinterval now accepts days, minutes, hours (incl. fix)
+
+
* Mon Oct 25 2010 Lukas Zapletal 1.2.55-1
- Taskomatic schedule schema correction (sysdate)
13 years, 6 months
Changes to 'refs/tags/spacewalk-java-1.2.74-1'
by Lukas Zapletal
Tag 'spacewalk-java-1.2.74-1' created by Lukas Zapletal <lzap+git(a)redhat.com> at 2010-10-27 09:40 +0000
Tagging package [spacewalk-java] version [1.2.74-1] in directory [java/].
Changes since spacewalk-backend-1.2.40-1:
Lukas Zapletal (1):
Automatic commit of package [spacewalk-java] release [1.2.74-1].
---
java/spacewalk-java.spec | 20 +++++++++++++++++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 20 insertions(+), 2 deletions(-)
---
13 years, 6 months
java/spacewalk-java.spec rel-eng/packages
by Lukas Zapletal
java/spacewalk-java.spec | 20 +++++++++++++++++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 20 insertions(+), 2 deletions(-)
New commits:
commit d82c62c1e7389fda5aa93b59d8387e303de2be05
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Wed Oct 27 11:40:16 2010 +0200
Automatic commit of package [spacewalk-java] release [1.2.74-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index fdff815..71e430b 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -19,7 +19,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.2.73
+Version: 1.2.74
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -358,6 +358,24 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Wed Oct 27 2010 Lukas Zapletal 1.2.74-1
+- Fixing missing brace in Taskomatic query
+- Addressing issue in system overview
+- PostgreSQL needs FROM keyword in DELETE
+- Adding missing interval keyword to Taskomatic
+- Protocol config value is now used in Taskomatic
+- Getting taskomatic working on PostgreSQL
+- removing unneeded insmod on kickstart %pre script, since they are already
+ loaded
+- fixing query to run correctly, c.id was not valid because the join did not
+ come directly after rhnChannel c
+- adding missing import
+- 646892 - fixing issue where kickstart expiration would occur after current
+ date and not scheduled date of kickstart
+- removing need of setNvreUpper method in PackageOverview
+- fixing broken if statement in snippet
+- fixing broken query used by SSM System delete
+
* Mon Oct 25 2010 Lukas Zapletal 1.2.73-1
- Fixing Taskomatic blob handling (now binary)
- Support for PostgreSQL driver in Taskomatic
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 9303174..83cffa5 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.2.73-1 java/
+1.2.74-1 java/
13 years, 6 months
Changes to 'refs/tags/spacewalk-backend-1.2.40-1'
by Lukas Zapletal
Tag 'spacewalk-backend-1.2.40-1' created by Lukas Zapletal <lzap+git(a)redhat.com> at 2010-10-27 09:39 +0000
Tagging package [spacewalk-backend] version [1.2.40-1] in directory [backend/].
Changes since spacewalk-backend-1.2.39-1:
Jan Pazdziora (2):
Class ChannelProductsDumper does not seem to be used, removing.
Class FileWireSource does not seem to be used, removing.
Lukas Zapletal (15):
Function numtodsinterval now accepts days, minutes, hours
Getting taskomatic working on PostgreSQL
Function numtodsinterval fix (PostgreSQL)
Protocol config value is now used in Taskomatic
Adding missing interval keyword to Taskomatic (PG)
PostgreSQL needs FROM keyword in DELETE
Addressing issue in system overview (PG)
Function unsubscribe_server now in sync with Oracle
Fixing missing brace in Taskomatic query
Addresing recursion with opened cursor in PostgreSQL
Rewritten DECODE to ANSI CASE-WHEN syntax for yum
In PostgreSQL NUMERIC types are returned as int or float now
Fixing indentation
In PostgreSQL NUMERIC types are returned as int or float now
Automatic commit of package [spacewalk-backend] release [1.2.40-1].
---
backend/satellite_tools/exporter/exportLib.py | 19 ----
backend/satellite_tools/xmlWireSource.py | 47 ----------
backend/server/rhnChannel.py | 2
backend/server/rhnSQL/driver_postgresql.py | 47 +++++++---
backend/spacewalk-backend.spec | 9 +
java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml | 44 +++++----
java/code/src/com/redhat/rhn/frontend/dto/SystemOverview.java | 2
java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java | 3
rel-eng/packages/spacewalk-backend | 2
schema/spacewalk/postgres/packages/rhn_channel.pkb | 31 +++---
schema/spacewalk/postgres/procs/numtodsinterval.sql | 13 +-
11 files changed, 93 insertions(+), 126 deletions(-)
---
13 years, 6 months
backend/spacewalk-backend.spec rel-eng/packages
by Lukas Zapletal
backend/spacewalk-backend.spec | 9 ++++++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
New commits:
commit f11bb7bf8b2d50bf168f3e414c1b93ae2bc87b95
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Wed Oct 27 11:39:20 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.2.40-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 9cef607..56c9dfb 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.2.39
+Version: 1.2.40
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -670,6 +670,13 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Wed Oct 27 2010 Lukas Zapletal 1.2.40-1
+- In PostgreSQL NUMERIC types are returned as int or float now
+- Rewritten DECODE to ANSI CASE-WHEN syntax for yum
+- Class FileWireSource does not seem to be used, removing.
+- Class ChannelProductsDumper does not seem to be used, removing.
+
+
* Wed Oct 27 2010 Jan Pazdziora 1.2.39-1
- Previous commit leaves __single_query unused, removing.
- Six find_by_* functions do not seem to be called by our code, removing.
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 6fb38f4..f70e4bc 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.2.39-1 backend/
+1.2.40-1 backend/
13 years, 6 months
14 commits - backend/server java/code schema/spacewalk
by Lukas Zapletal
backend/server/rhnChannel.py | 2
backend/server/rhnSQL/driver_postgresql.py | 47 +++++++---
java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml | 44 +++++----
java/code/src/com/redhat/rhn/frontend/dto/SystemOverview.java | 2
java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java | 3
schema/spacewalk/postgres/packages/rhn_channel.pkb | 31 +++---
schema/spacewalk/postgres/procs/numtodsinterval.sql | 13 +-
7 files changed, 84 insertions(+), 58 deletions(-)
New commits:
commit 2f7642ce88ca59b530480e43e201a8786858d846
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Wed Oct 27 11:27:57 2010 +0200
In PostgreSQL NUMERIC types are returned as int or float now
diff --git a/backend/server/rhnSQL/driver_postgresql.py b/backend/server/rhnSQL/driver_postgresql.py
index b68d2f0..960ff74 100644
--- a/backend/server/rhnSQL/driver_postgresql.py
+++ b/backend/server/rhnSQL/driver_postgresql.py
@@ -100,6 +100,10 @@ class Procedure(Function):
def decimal2intfloat(dec, cursor):
"Convert a Decimal to an int or a float with no loss of information"
+ if dec is None:
+ return None
+ if not isinstance(dec, decimal.Decimal):
+ return dec
oldcontext = decimal.getcontext()
decimal.setcontext(decimal.Context(traps=[decimal.Inexact]))
try:
commit fc40acb8e7ff0e0631cbf8dd295ec33e294e8c37
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Wed Oct 27 11:26:40 2010 +0200
Fixing indentation
diff --git a/backend/server/rhnSQL/driver_postgresql.py b/backend/server/rhnSQL/driver_postgresql.py
index e8b82f4..b68d2f0 100644
--- a/backend/server/rhnSQL/driver_postgresql.py
+++ b/backend/server/rhnSQL/driver_postgresql.py
@@ -120,7 +120,7 @@ class Database(sql_base.Database):
""" Class for PostgreSQL database operations. """
def __init__(self, host=None, port=None, username=None,
- password=None, database=None):
+ password=None, database=None):
self.host = host
self.port = port
@@ -143,13 +143,13 @@ class Database(sql_base.Database):
try:
if self.host is None:
self.dbh = psycopg2.connect(database=self.database, user=self.username,
- password=self.password)
+ password=self.password)
else:
self.dbh = psycopg2.connect(database=self.database, user=self.username,
- password=self.password, host=self.host, port=self.port)
+ password=self.password, host=self.host, port=self.port)
# convert all DECIMAL types to float (let Python to choose one)
DEC2INTFLOAT = psycopg2.extensions.new_type(psycopg2.extensions.DECIMAL.values,
- 'DEC2INTFLOAT', decimal2intfloat)
+ 'DEC2INTFLOAT', decimal2intfloat)
psycopg2.extensions.register_type(DEC2INTFLOAT)
except Exception, e:
if reconnect:
@@ -158,16 +158,16 @@ class Database(sql_base.Database):
# Failed reconnect, time to error out:
raise apply(sql_base.SQLConnectError,
- [self.database, e.pgcode, e.pgerror, "Attempting Re-Connect to the database failed",])
+ [self.database, e.pgcode, e.pgerror, "Attempting Re-Connect to the database failed",])
def is_connected_to(self, backend, host, port, username, password,
- database):
+ database):
adjusted_port = -1
if port:
adjusted_port = port
return (backend == POSTGRESQL) and (self.host == host) and \
- (self.port == adjusted_port) and (self.username == username) \
- and (self.password == password) and (self.database == database)
+ (self.port == adjusted_port) and (self.username == username) \
+ and (self.password == password) and (self.database == database)
def check_connection(self):
try:
@@ -248,9 +248,9 @@ class Cursor(sql_base.Cursor):
def _execute_wrapper(self, function, *p, **kw):
params = ','.join(["%s: %s" % (key, value) for key, value \
- in kw.items()])
+ in kw.items()])
log_debug(5, "Executing SQL: \"%s\" with bind params: {%s}"
- % (self.sql, params))
+ % (self.sql, params))
if self.sql is None:
raise rhnException("Cannot execute empty cursor")
@@ -297,14 +297,14 @@ class Cursor(sql_base.Cursor):
return rowcount
def update_blob(self, table_name, column_name, where_clause, data,
- **kwargs):
+ **kwargs):
"""
PostgreSQL uses bytea columns instead of blobs. Nothing special
needs to be done to insert text into one.
"""
# NOTE: Injecting a :column_name parameter here
sql = "UPDATE %s SET %s = :%s %s" % (table_name, column_name,
- column_name, where_clause)
+ column_name, where_clause)
c = rhnSQL.prepare(sql)
kwargs[column_name] = data
apply(c.execute, (), kwargs)
commit a79823af829dac9382f6b061391c4dcc14a994a4
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Wed Oct 27 10:55:48 2010 +0200
In PostgreSQL NUMERIC types are returned as int or float now
diff --git a/backend/server/rhnSQL/driver_postgresql.py b/backend/server/rhnSQL/driver_postgresql.py
index 31e6ac1..e8b82f4 100644
--- a/backend/server/rhnSQL/driver_postgresql.py
+++ b/backend/server/rhnSQL/driver_postgresql.py
@@ -98,6 +98,23 @@ class Procedure(Function):
#if not (type(result) == 'tuple' and result[0] == ''):
#raise rhnSQL.SQLError("Unexpected result returned by procedure %s: %s" % (self.name, str(result)))
+def decimal2intfloat(dec, cursor):
+ "Convert a Decimal to an int or a float with no loss of information"
+ oldcontext = decimal.getcontext()
+ decimal.setcontext(decimal.Context(traps=[decimal.Inexact]))
+ try:
+ while True:
+ try:
+ # try to quantize to integer
+ return int(dec.quantize(decimal.Decimal(1)))
+ except decimal.Inexact:
+ # if not exact return float
+ return float(dec)
+ except:
+ # if anything bad happends return float as well
+ return float(dec)
+ finally:
+ decimal.setcontext(oldcontext)
class Database(sql_base.Database):
""" Class for PostgreSQL database operations. """
@@ -130,6 +147,10 @@ class Database(sql_base.Database):
else:
self.dbh = psycopg2.connect(database=self.database, user=self.username,
password=self.password, host=self.host, port=self.port)
+ # convert all DECIMAL types to float (let Python to choose one)
+ DEC2INTFLOAT = psycopg2.extensions.new_type(psycopg2.extensions.DECIMAL.values,
+ 'DEC2INTFLOAT', decimal2intfloat)
+ psycopg2.extensions.register_type(DEC2INTFLOAT)
except Exception, e:
if reconnect:
# Try one more time:
commit 2a6a07710ddd59b2a43f27f6651c3e3cac20dcad
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Tue Oct 26 13:32:58 2010 +0200
Rewritten DECODE to ANSI CASE-WHEN syntax for yum
diff --git a/backend/server/rhnChannel.py b/backend/server/rhnChannel.py
index ae097ef..0357fd9 100644
--- a/backend/server/rhnChannel.py
+++ b/backend/server/rhnChannel.py
@@ -709,7 +709,7 @@ def channels_for_server(server_id):
c.summary,
c.description,
c.gpg_key_url,
- decode(s.org_id, c.org_id, 1, 0) local_channel,
+ case s.org_id when c.org_id then 1 else 0 end local_channel,
TO_CHAR(c.last_modified, 'YYYYMMDDHH24MISS') last_modified
from
rhnChannelArch ca,
commit 0bb8c201eb593018ffcb66aded1321106acda81f
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Tue Oct 26 13:24:33 2010 +0200
Addresing recursion with opened cursor in PostgreSQL
ERROR: cursor "local_chk_server_parent_memb" already in use
diff --git a/schema/spacewalk/postgres/packages/rhn_channel.pkb b/schema/spacewalk/postgres/packages/rhn_channel.pkb
index 5ad5b79..306af77 100644
--- a/schema/spacewalk/postgres/packages/rhn_channel.pkb
+++ b/schema/spacewalk/postgres/packages/rhn_channel.pkb
@@ -447,21 +447,17 @@ update pg_settings set setting = 'rhn_channel,' || setting where name = 'search_
from rhnChannelFamily
where id = channel_family_id_in
and label = 'rhn-satellite';
- -- this is *EXACTLY* like check_server_parent_membership, but if we recurse
- -- with the package-level one, we get a "cursor already open", so we need a
- -- copy on our call stack instead. GROAN.
- local_chk_server_parent_memb cursor (
- server_id_in numeric,
- channel_id_in numeric ) for
- select c.id
+ child record;
+ BEGIN
+ -- In PostgreSQL recursion with opened cursors is not allowed so we use
+ -- FOR IN SELECT form which is ok.
+ FOR child IN select c.id
from rhnChannel c,
rhnServerChannel sc
where 1=1
and c.parent_channel = channel_id_in
and c.id = sc.channel_id
- and sc.server_id = server_id_in;
- BEGIN
- FOR child IN local_chk_server_parent_memb(server_id_in, channel_id_in)
+ and sc.server_id = server_id_in
LOOP
if unsubscribe_children_in = 1 then
perform rhn_channel.unsubscribe_server(server_id_in,
commit 1cff427cdc1a8307321a664e35f27d67e1eddcf7
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Tue Oct 26 12:52:14 2010 +0200
Fixing missing brace in Taskomatic query
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
index cadf234..d9a8c36 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
@@ -361,7 +361,7 @@ AND CC.confchan_type_id =
<query params="threshold">
SELECT enq.errata_id, enq.org_id, enq.channel_id
FROM rhnErrataNotificationQueue ENQ
- WHERE (enq.next_action < current_timestamp + numtodsinterval(:threshold, 'minute')
+ WHERE (enq.next_action < current_timestamp + numtodsinterval(:threshold, 'minute'))
ORDER BY next_action DESC
</query>
</mode>
commit e1f6736e8da39c2ab49c2979c05dacc7eb987d18
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Tue Oct 26 12:42:22 2010 +0200
Function unsubscribe_server now in sync with Oracle
diff --git a/schema/spacewalk/postgres/packages/rhn_channel.pkb b/schema/spacewalk/postgres/packages/rhn_channel.pkb
index 120fed3..5ad5b79 100644
--- a/schema/spacewalk/postgres/packages/rhn_channel.pkb
+++ b/schema/spacewalk/postgres/packages/rhn_channel.pkb
@@ -1,5 +1,6 @@
-- This file is not yet in sync with Oracle. Synced functions are:
--- subscribe_server + all subfunctions called
+-- subscribe_server + all subfunctions
+-- unsubscribe_server + all subfunctions
--
-- Copyright (c) 2008--2010 Red Hat, Inc.
--
@@ -428,7 +429,8 @@ update pg_settings set setting = 'rhn_channel,' || setting where name = 'search_
END$$ language plpgsql;
CREATE OR REPLACE FUNCTION unsubscribe_server(server_id_in IN NUMERIC, channel_id_in NUMERIC, immediate_in NUMERIC default 1, unsubscribe_children_in numeric default 0,
- deleting_server IN NUMERIC default 0 ) returns void
+ deleting_server in numeric default 0,
+ update_family_countsYN in numeric default 1) returns void
AS $$
declare
channel_family_id_val NUMERIC;
@@ -445,6 +447,9 @@ update pg_settings set setting = 'rhn_channel,' || setting where name = 'search_
from rhnChannelFamily
where id = channel_family_id_in
and label = 'rhn-satellite';
+ -- this is *EXACTLY* like check_server_parent_membership, but if we recurse
+ -- with the package-level one, we get a "cursor already open", so we need a
+ -- copy on our call stack instead. GROAN.
local_chk_server_parent_memb cursor (
server_id_in numeric,
channel_id_in numeric ) for
@@ -463,7 +468,8 @@ update pg_settings set setting = 'rhn_channel,' || setting where name = 'search_
child.id,
immediate_in,
unsubscribe_children_in,
- deleting_server);
+ deleting_server,
+ update_family_countsYN);
else
perform rhn_exception.raise_exception('channel_unsubscribe_child_exists');
end if;
@@ -510,16 +516,13 @@ update pg_settings set setting = 'rhn_channel,' || setting where name = 'search_
for ignore in channel_family_is_proxy(channel_family_id_val) loop
delete from rhnProxyInfo where server_id = server_id_in;
end loop;
-
- DELETE FROM rhnChannelFamilyLicenseConsent
- WHERE channel_family_id = channel_family_id_val
- AND server_id = server_id_in;
-
SELECT org_id INTO server_org_id_val
FROM rhnServer
WHERE id = server_id_in;
- perform rhn_channel.update_family_counts(channel_family_id_val, server_org_id_val);
+ if update_family_countsYN = 1 then
+ perform rhn_channel.update_family_counts(channel_family_id_val, server_org_id_val);
+ end if;
END$$ language plpgsql;
CREATE OR REPLACE FUNCTION family_for_channel(channel_id_in IN NUMERIC)
commit e5a6ebc1a8011b8ccf36766d8464205ad6f4380c
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Tue Oct 26 12:41:57 2010 +0200
Addressing issue in system overview (PG)
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/SystemOverview.java b/java/code/src/com/redhat/rhn/frontend/dto/SystemOverview.java
index 3faf9b6..e0eef68 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/SystemOverview.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/SystemOverview.java
@@ -621,7 +621,7 @@ public class SystemOverview extends BaseDto implements Serializable {
* null if not selectable
*/
public void setSelectable(Integer selectableIn) {
- setSelectable(new Long(selectableIn));
+ selectable = (selectableIn != null);
}
/**
commit 1be2d7e1a440cee01d4283615ba204d080210587
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Tue Oct 26 11:53:46 2010 +0200
PostgreSQL needs FROM keyword in DELETE
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
index 166ea21..cadf234 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
@@ -536,7 +536,7 @@ ORDER BY next_action DESC
<write-mode name="erratamailer_clean_work_queue">
<query params="">
- DELETE rhnPaidErrataTempCache
+ DELETE FROM rhnPaidErrataTempCache
</query>
</write-mode>
@@ -605,7 +605,7 @@ ORDER BY next_action DESC
<write-mode name="delete_task">
<query params="org_id, name, task_data, priority">
- DELETE rhnTaskQueue where org_id = :org_id and task_name = :name
+ DELETE FROM rhnTaskQueue where org_id = :org_id and task_name = :name
and task_data = :task_data and priority = :priority
</query>
</write-mode>
commit cc130bcc7df3ccecbdf285a333659048df71c444
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Tue Oct 26 11:41:38 2010 +0200
Adding missing interval keyword to Taskomatic (PG)
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
index 185a005..166ea21 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
@@ -197,7 +197,7 @@ SELECT id, channel_label, client, reason, force, bypass_filters, next_action
WHERE KS.state_id = KSS.id
AND ((KSS.label NOT IN ('created', 'complete', 'failed') AND KS.last_action < current_timestamp - interval '1' day)
OR
- (KSS.label = 'created' AND KS.last_action < current_timestamp - '6' day))
+ (KSS.label = 'created' AND KS.last_action < current_timestamp - interval '6' day))
AND (KS.kickstart_mode != 'default_session' OR KS.kickstart_mode is NULL)
</query>
</mode>
commit 83ad542ec692b7a7badb2f56836edf09bfa44122
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Tue Oct 26 11:19:58 2010 +0200
Protocol config value is now used in Taskomatic
diff --git a/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java b/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java
index 809bb53..a4323e7 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java
@@ -94,10 +94,9 @@ public class SchedulerKernel {
"org.postgresql.Driver");
props.setProperty(ds + ".driver", driver);
- // the format is jdbc:postgresql://localhost:5432/dbname
String dbHost = Config.get().getString(ConfigDefaults.DB_HOST);
String dbPort = Config.get().getString(ConfigDefaults.DB_PORT);
- String dbUrl = "jdbc:postgresql://" + dbHost + ":" + dbPort + "/" +
+ String dbUrl = dbProto + "://" + dbHost + ":" + dbPort + "/" +
dbName;
props.setProperty(ds + ".URL", dbUrl);
}
commit 9ffd90f3aef2545a3f8f28719677c338cd716423
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Tue Oct 26 11:19:14 2010 +0200
Function numtodsinterval fix (PostgreSQL)
diff --git a/schema/spacewalk/postgres/procs/numtodsinterval.sql b/schema/spacewalk/postgres/procs/numtodsinterval.sql
index 9c5a145..f20f0bf 100644
--- a/schema/spacewalk/postgres/procs/numtodsinterval.sql
+++ b/schema/spacewalk/postgres/procs/numtodsinterval.sql
@@ -14,7 +14,7 @@
-- in this software or its documentation.
--
-create or replace function numtodsinterval(sec_in in numeric, type_in in varchar)
+create or replace function numtodsinterval(num_in in numeric, type_in in varchar)
returns interval
as
$$
commit 03ec57ac9bab8cbfdd9398ca8052408a23240eb6
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Tue Oct 26 10:50:01 2010 +0200
Getting taskomatic working on PostgreSQL
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
index c3728e4..185a005 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
@@ -49,7 +49,7 @@ SELECT DISTINCT S.id, S.name, SI.checkin
rhnUserServerPerms USP
WHERE USP.user_id = :user_id
AND USP.server_id = SI.server_id
- AND (sysdate - SI.checkin) BETWEEN 1 AND (1 + :checkin_threshold)
+ AND date_diff_in_days(current_timestamp, SI.checkin) BETWEEN 1 AND (1 + :checkin_threshold)
AND SI.server_id = S.id
AND NOT EXISTS (
SELECT *
@@ -91,8 +91,8 @@ SELECT AT.name as type,
where sfv.server_id = usp.server_id
and sfv.label = 'ftr_daily_summary')
AND USP.server_id = SA.server_id
- AND sysdate - SA.modified > 0
- AND sysdate - SA.modified < 1
+ AND date_diff_in_days(current_timestamp, SA.modified) > 0
+ AND date_diff_in_days(current_timestamp, SA.modified) < 1
AND SA.status = AStat.id
AND SA.action_id = A.id
AND A.action_type = AT.id
@@ -108,7 +108,10 @@ INSERT
INTO rhnErrataNotificationQueue
(errata_id, org_id, next_action, channel_id)
SELECT DISTINCT
- :errata_id, wc.id, sysdate + :minutes / 1440, :channel_id
+ :errata_id,
+ wc.id,
+ current_timestamp + numtodsinterval(:minutes, 'minute'),
+ :channel_id
FROM web_customer wc,
rhnChannelErrata CE
WHERE CE.errata_id = :errata_id
@@ -170,13 +173,13 @@ SELECT id, channel_label, client, reason, force, bypass_filters, next_action
<write-mode name="repomd_mark_in_progress">
<query params="channel_label">
- UPDATE rhnRepoRegenQueue set next_action=null, modified=sysdate WHERE channel_label = :channel_label
+ UPDATE rhnRepoRegenQueue set next_action=null, modified=current_timestamp WHERE channel_label = :channel_label
</query>
</write-mode>
<write-mode name="repomd_clear_in_progress">
<query params="">
- UPDATE rhnRepoRegenQueue set next_action=sysdate, modified=sysdate WHERE next_action is null
+ UPDATE rhnRepoRegenQueue set next_action=current_timestamp, modified=current_timestamp WHERE next_action is null
</query>
</write-mode>
@@ -192,9 +195,9 @@ SELECT id, channel_label, client, reason, force, bypass_filters, next_action
SELECT KS.id, KSS.label, KS.action_id, KS.new_server_id, KS.old_server_id
FROM rhnKickstartSession KS, rhnKickstartSessionState KSS
WHERE KS.state_id = KSS.id
- AND ((KSS.label NOT IN ('created', 'complete', 'failed') AND KS.last_action < sysdate - 1)
+ AND ((KSS.label NOT IN ('created', 'complete', 'failed') AND KS.last_action < current_timestamp - interval '1' day)
OR
- (KSS.label = 'created' AND KS.last_action < sysdate - 6))
+ (KSS.label = 'created' AND KS.last_action < current_timestamp - '6' day))
AND (KS.kickstart_mode != 'default_session' OR KS.kickstart_mode is NULL)
</query>
</mode>
@@ -231,7 +234,7 @@ SELECT id, channel_label, client, reason, force, bypass_filters, next_action
<callable-mode name="synchprobestate_synch_proc">
<query params="">
- {call rhn_synch_probe_state}
+ { call rhn_synch_probe_state() }
</query>
</callable-mode>
@@ -264,7 +267,8 @@ inner join rhnServerGroup sg on (s.org_id = sg.org_id)
inner join rhnServerGroupType sgt on (sg.group_type = sgt.id)
where sgt.label in ('enterprise_entitled', 'provisioning_entitled')
and sg.max_members > 0
- and si.checkin between (sysdate + 1) and (sysdate + 1 + :checkin_threshold)
+ and si.checkin between (current_timestamp + interval '1' day)
+ and (current_timestamp + numtodsinterval(1 + :checkin_threshold, 'day')
</query>
</mode>
@@ -281,7 +285,7 @@ select distinct sg.org_id as id
select s.org_id
from rhnServer s, rhnServerINfo si
where s.id = si.SERVER_ID
- AND (sysdate - SI.checkin) BETWEEN 1 AND (1 + :checkin_threshold))
+ AND date_diff_in_days(current_timestamp, SI.checkin) BETWEEN 1 AND (1 + :checkin_threshold))
</query>
</mode>
@@ -299,7 +303,7 @@ SELECT /*+full(sa)*/ DISTINCT S.org_id as id
AND SG.max_members > 0
AND SG.org_id = S.org_id
AND S.id = SA.server_id
- AND SA.modified between sysdate - 1 and sysdate
+ AND SA.modified between current_timestamp - interval '1' day and current_timestamp
</query>
</mode>
@@ -335,7 +339,7 @@ FROM rhnConfigFile CF
WHERE CF.config_channel_id IN
(SELECT cc.Id
FROM rhnConfigChannel CC
- WHERE CC.created < sysdate - :window
+ WHERE CC.created < current_timestamp - numtodsinterval(:window, 'day')
AND CC.confchan_type_id =
(SELECT id FROM rhnConfigChannelType WHERE label = 'server_import'))
</query>
@@ -345,7 +349,7 @@ WHERE CF.config_channel_id IN
<query params="window">
SELECT CC.id
FROM rhnConfigChannel CC
-WHERE CC.created < sysdate - :window
+WHERE CC.created < current_timestamp - numtodsinterval(:window, 'day')
AND CC.confchan_type_id =
(SELECT id FROM rhnConfigChannelType WHERE label = 'server_import')
@@ -357,7 +361,7 @@ AND CC.confchan_type_id =
<query params="threshold">
SELECT enq.errata_id, enq.org_id, enq.channel_id
FROM rhnErrataNotificationQueue ENQ
- WHERE (enq.next_action < sysdate + :threshold/1440)
+ WHERE (enq.next_action < current_timestamp + numtodsinterval(:threshold, 'minute')
ORDER BY next_action DESC
</query>
</mode>
@@ -547,14 +551,14 @@ ORDER BY next_action DESC
<write-mode name="create_task_stats">
<query params="display_name">
INSERT INTO rhnDaemonState (LABEL, LAST_POLL)
- VALUES (:display_name, sysdate)
+ VALUES (:display_name, current_timestamp)
</query>
</write-mode>
<write-mode name="update_task_stats">
<query params="display_name">
UPDATE rhnDaemonState
- SET LAST_POLL = sysdate
+ SET LAST_POLL = current_timestamp
WHERE LABEL = :display_name
</query>
</write-mode>
@@ -569,7 +573,7 @@ ORDER BY next_action DESC
<mode name="get_current_time">
<query params="">
- SELECT sysdate
+ SELECT current_timestamp
FROM dual
</query>
</mode>
commit 86493d5bb1e7ae0db6a14301c456ae56dba7d029
Author: Lukas Zapletal <lzap+git(a)redhat.com>
Date: Tue Oct 26 10:49:25 2010 +0200
Function numtodsinterval now accepts days, minutes, hours
diff --git a/schema/spacewalk/postgres/procs/numtodsinterval.sql b/schema/spacewalk/postgres/procs/numtodsinterval.sql
index ded2883..9c5a145 100644
--- a/schema/spacewalk/postgres/procs/numtodsinterval.sql
+++ b/schema/spacewalk/postgres/procs/numtodsinterval.sql
@@ -19,12 +19,11 @@ returns interval
as
$$
begin
- if type_in != 'second' then
- raise exception 'Function numtodsinterval only supports conversion from [second], not from [%].', type_in;
- end if;
-
- return sec_in || ' ' || type_in;
+ if type_in = any(array['second', 'hour', 'minute', 'day']) then
+ return num_in || ' ' || type_in;
+ else
+ raise exception 'Function numtodsinterval only supports conversion from [second, hour, minte, day], not from [%].', type_in;
+ end if;
end;
$$ language plpgsql
stable;
-
13 years, 6 months
backend/satellite_tools
by Jan Pazdziora
backend/satellite_tools/xmlWireSource.py | 47 -------------------------------
1 file changed, 47 deletions(-)
New commits:
commit 561395b97b7302de8a5124335a15e1e630b97814
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Oct 27 09:19:35 2010 +0200
Class FileWireSource does not seem to be used, removing.
diff --git a/backend/satellite_tools/xmlWireSource.py b/backend/satellite_tools/xmlWireSource.py
index 7950ab1..19cb6bf 100644
--- a/backend/satellite_tools/xmlWireSource.py
+++ b/backend/satellite_tools/xmlWireSource.py
@@ -295,53 +295,6 @@ class XMLRPCWireSource(BaseWireSource):
return retval
-class FileWireSource(XMLRPCWireSource):
-
- """retrieve rpm (or arbitrary file) stream through an xmlrpc interface."""
-
- def __init__(self, systemid, sslYN):
- XMLRPCWireSource.__init__(self, systemid, sslYN)
- self.extinctErrorYN = 0
-
- def getRpmStream(self, chn, nvrea):
- """Fetch a file handle, given channel and nvrea
- """
- self.setServer(CFG.RHN_XMLRPC_HANDLER)
- stream = None
- try:
- stream = self._xmlrpc('package.get', (self.systemid, chn, nvrea))
- except (rpclib.Fault), e:
- if e.faultCode == -17:
- pass
- #log(-1, 2, ' WARNING: originating RPM is extinct: %s' % self.__makeFilename(nvrea))
- else:
- log(-1, 'ERROR: rpclib.Fault: %s' % e, stream=sys.stderr)
- self.extinctErrorYN = 1
- # Marked as erronous... handled elsewhere. Don't reraise.
- return stream
-
- def __makeFilename(self, nvrea):
- return "%s-%s-%s.%s.rpm" % (nvrea[0], nvrea[1], nvrea[2], nvrea[4])
-
- def getKickstartFileStream(self, ksLabel, relativePath):
- """Fetch a kickstart file handle, given kickstart label and the path
- """
- self.setServer(CFG.RHN_XMLRPC_HANDLER)
- stream = None
- try:
- stream = self._xmlrpc('kickstart.get_ks_file',
- (self.systemid, ksLabel, relativePath))
- except (rpclib.Fault), e:
- if e.faultCode == -17:
- pass
- #log2(-1, 2, ' WARNING: originating RPM is extinct: %s' % self.__makeFilename(nvrea))
- else:
- log2(-1, 2, 'ERROR: rpclib.Fault: %s' % e, stream=sys.stderr)
- self.extinctErrorYN = 1
- raise e
- return stream
-
-
class AuthWireSource(XMLRPCWireSource):
"""Simply authenticate this systemid as a satellite."""
13 years, 6 months
backend/satellite_tools
by Jan Pazdziora
backend/satellite_tools/exporter/exportLib.py | 19 -------------------
1 file changed, 19 deletions(-)
New commits:
commit ff78b8b59cb1d6c08dd67e5ddf355953208facc1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Oct 27 09:10:31 2010 +0200
Class ChannelProductsDumper does not seem to be used, removing.
diff --git a/backend/satellite_tools/exporter/exportLib.py b/backend/satellite_tools/exporter/exportLib.py
index 8c5f449..4161f8b 100644
--- a/backend/satellite_tools/exporter/exportLib.py
+++ b/backend/satellite_tools/exporter/exportLib.py
@@ -1501,25 +1501,6 @@ def _dbtime2timestamp(val):
return int(rhnLib.timestamp(val))
-class ChannelProductsDumper(BaseDumper):
-
- def set_iterator(self):
- h = rhnSQL.prepare("""
- select id, product, version, beta
- from rhnChannelProduct
- """)
- h.execute()
- return h
-
- def dump_subelement(self, data):
- attributes = {
- 'id' : "rhn-channel-product-id-%s" % (data['id']),
- 'product' : data['product'],
- 'version' : data['version'],
- 'beta' : data['beta'],
- }
- EmptyDumper(self._writer, 'rhn-channel-product', attributes).dump()
-
class ProductNamesDumper(BaseDumper):
tag_name = "rhn-product-names"
13 years, 6 months