client/rhel
by Miroslav Suchý
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 3dab836b0f7f4da095daec5c9618dd52f635dacd
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Oct 30 22:14:48 2009 +0100
532145 - define local variable ipaddr before it is used
addressing:
Traceback (most recent call last):
File "/usr/share/rhn/up2date_client/rhnregGui.py", line 949, in
populateProfile
if ipaddr:
exceptions.UnboundLocalError: local variable ipaddr referenced before
assignment
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
index 00987a5..a9b6d8e 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -932,6 +932,7 @@ class CreateProfilePage:
if not self.initProfile:
profileName = None
hostname = None
+ ipaddr = None
if self.hardware:
for hw in self.hardware:
if hw.has_key('class'):
13 years, 7 months
java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/common/messaging/ActionExecutor.java | 1
java/code/src/com/redhat/rhn/frontend/events/AbstractDatabaseAction.java | 29 ++++++----
java/code/src/com/redhat/rhn/frontend/events/CloneErrataAction.java | 1
java/code/src/com/redhat/rhn/frontend/events/CloneErrataEvent.java | 16 +++--
java/code/src/com/redhat/rhn/frontend/events/SsmUpgradePackagesAction.java | 2
5 files changed, 31 insertions(+), 18 deletions(-)
New commits:
commit 051fbedd31552ba0458215c65dd6dbbd8d2ad4b2
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Fri Oct 30 14:25:15 2009 -0400
531091 - fixing issue that would result in odd hibernate errors due to hibernate objects being used across hibernate sessions
Also improved the abstractDatabaseAction rollback if an action failed
diff --git a/java/code/src/com/redhat/rhn/common/messaging/ActionExecutor.java b/java/code/src/com/redhat/rhn/common/messaging/ActionExecutor.java
index f5448a5..900cee1 100644
--- a/java/code/src/com/redhat/rhn/common/messaging/ActionExecutor.java
+++ b/java/code/src/com/redhat/rhn/common/messaging/ActionExecutor.java
@@ -75,6 +75,7 @@ class ActionExecutor implements Runnable {
}
catch (Throwable t) {
LOG.error(t);
+ t.printStackTrace();
}
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/events/AbstractDatabaseAction.java b/java/code/src/com/redhat/rhn/frontend/events/AbstractDatabaseAction.java
index 5fabd58..3aceb12 100644
--- a/java/code/src/com/redhat/rhn/frontend/events/AbstractDatabaseAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/events/AbstractDatabaseAction.java
@@ -42,26 +42,37 @@ public abstract class AbstractDatabaseAction implements MessageAction {
/** {@inheritDoc} */
public void execute(EventMessage msg) {
- doExecute(msg);
-
- handleTransactions();
+ boolean commit = true;
+ try {
+ doExecute(msg);
+ }
+ catch (Exception e) {
+ commit = false;
+ e.printStackTrace();
+ }
+ finally {
+ handleTransactions(commit);
+ }
}
+
/**
* Commits the current thread transaction, as well as close the Hibernate session.
* <p/>
* Note that this call <em>MUST</em> take place for any database operations done in
* a message queue action for the transaction to be committed.
*/
- protected void handleTransactions() {
+ protected void handleTransactions(boolean commit) {
boolean committed = false;
try {
- HibernateFactory.commitTransaction();
- committed = true;
-
- if (log.isDebugEnabled()) {
- log.debug("Transaction committed");
+ if (commit) {
+ HibernateFactory.commitTransaction();
+ committed = true;
+
+ if (log.isDebugEnabled()) {
+ log.debug("Transaction committed");
+ }
}
}
catch (HibernateException e) {
diff --git a/java/code/src/com/redhat/rhn/frontend/events/CloneErrataAction.java b/java/code/src/com/redhat/rhn/frontend/events/CloneErrataAction.java
index f1f19c1..26b5ca4 100644
--- a/java/code/src/com/redhat/rhn/frontend/events/CloneErrataAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/events/CloneErrataAction.java
@@ -80,7 +80,6 @@ public class CloneErrataAction
}
ErrataCacheManager.insertCacheForChannelErrata(cids, errata);
}
- handleTransactions();
}
diff --git a/java/code/src/com/redhat/rhn/frontend/events/CloneErrataEvent.java b/java/code/src/com/redhat/rhn/frontend/events/CloneErrataEvent.java
index 540f3af..f194ebd 100644
--- a/java/code/src/com/redhat/rhn/frontend/events/CloneErrataEvent.java
+++ b/java/code/src/com/redhat/rhn/frontend/events/CloneErrataEvent.java
@@ -17,7 +17,9 @@ package com.redhat.rhn.frontend.events;
import com.redhat.rhn.common.hibernate.HibernateFactory;
import com.redhat.rhn.common.messaging.EventDatabaseMessage;
import com.redhat.rhn.domain.channel.Channel;
+import com.redhat.rhn.domain.channel.ChannelFactory;
import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.domain.user.UserFactory;
import org.hibernate.Transaction;
@@ -33,10 +35,10 @@ public class CloneErrataEvent implements EventDatabaseMessage {
- private Channel chan;
+ private Long chanId;
private Collection<Long> errata;
private Transaction txn;
- private User user;
+ private Long userId;
/**
* constructor
@@ -45,9 +47,9 @@ public class CloneErrataEvent implements EventDatabaseMessage {
* @param userIn the user
*/
public CloneErrataEvent(Channel chanIn, Collection<Long> errataIn, User userIn) {
- chan = chanIn;
+ chanId = chanIn.getId();
errata = errataIn;
- user = userIn;
+ userId = userIn.getId();
this.txn = HibernateFactory.getSession().getTransaction();
}
@@ -72,7 +74,7 @@ public class CloneErrataEvent implements EventDatabaseMessage {
* @return Returns the chan.
*/
public Channel getChan() {
- return chan;
+ return ChannelFactory.lookupById(chanId);
}
@@ -80,7 +82,7 @@ public class CloneErrataEvent implements EventDatabaseMessage {
* @param chanIn The chan to set.
*/
public void setChan(Channel chanIn) {
- this.chan = chanIn;
+ this.chanId = chanIn.getId();
}
@@ -104,7 +106,7 @@ public class CloneErrataEvent implements EventDatabaseMessage {
* @return Returns the user.
*/
public User getUser() {
- return user;
+ return UserFactory.lookupById(userId);
}
diff --git a/java/code/src/com/redhat/rhn/frontend/events/SsmUpgradePackagesAction.java b/java/code/src/com/redhat/rhn/frontend/events/SsmUpgradePackagesAction.java
index af22b5b..99ef025 100644
--- a/java/code/src/com/redhat/rhn/frontend/events/SsmUpgradePackagesAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/events/SsmUpgradePackagesAction.java
@@ -72,7 +72,7 @@ public class SsmUpgradePackagesAction extends AbstractDatabaseAction {
// Explicitly call handle transactions here so the operation creation above
// is persisted before the potentially long running logic below
- handleTransactions();
+ handleTransactions(true);
try {
scheduleUpgrades(user, event);
13 years, 7 months
Changes to 'refs/tags/spacewalk-backend-0.7.11-1'
by Jan Pazdziora
Tag 'spacewalk-backend-0.7.11-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2009-10-30 16:01 +0000
Tagging package [spacewalk-backend] version [0.7.11-1] in directory [backend/].
Changes since NPalert-1.126.11-1:
Jan Pazdziora (2):
reporting: add column type to the errata-list report.
Automatic commit of package [spacewalk-backend] release [0.7.11-1].
---
backend/satellite_tools/reports/data/errata-list | 3 +++
backend/spacewalk-backend.spec | 6 +++++-
rel-eng/packages/spacewalk-backend | 2 +-
3 files changed, 9 insertions(+), 2 deletions(-)
---
13 years, 7 months
backend/spacewalk-backend.spec rel-eng/packages
by Jan Pazdziora
backend/spacewalk-backend.spec | 6 +++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit b19e7dc61ddccf9932b3e4ceaa37f2f1d596f56f
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Oct 30 17:01:19 2009 +0100
Automatic commit of package [spacewalk-backend] release [0.7.11-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index e834994..31dd265 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -7,7 +7,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 0.7.10
+Version: 0.7.11
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -582,6 +582,10 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Fri Oct 30 2009 Jan Pazdziora 0.7.11-1
+- reporting: add column type to the errata-list report.
+- removed redundant else; we call associate_package anyway (Michael M.)
+
* Mon Oct 26 2009 Jan Pazdziora 0.7.10-1
- reporting: added --info options and documentation of reports and fields
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index cbed8c4..f2cae1c 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-0.7.10-1 backend/
+0.7.11-1 backend/
13 years, 7 months
backend/satellite_tools
by Jan Pazdziora
backend/satellite_tools/reports/data/errata-list | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit a0488d81f7a07e5a1f592997f7a473f9c3e891a5
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Oct 30 17:00:37 2009 +0100
reporting: add column type to the errata-list report.
diff --git a/backend/satellite_tools/reports/data/errata-list b/backend/satellite_tools/reports/data/errata-list
index 57a5fd1..06a1ce0 100755
--- a/backend/satellite_tools/reports/data/errata-list
+++ b/backend/satellite_tools/reports/data/errata-list
@@ -12,6 +12,7 @@ description:
columns:
advisory Advisory / errata identifier
+ type Advisory type (Enhancement, Bug Fix, Security)
cve List of CVE names (Common Vulnerabilities and Exposures Identifiers) addressed by the errata
synopsis Synopsis of the errata
systems_affected Number of systems to which this errata is applicable
@@ -24,6 +25,7 @@ multival_columns:
sql:
select rhnErrata.advisory_name as advisory,
+ rhnErrata.advisory_type as type,
rhnCVE.name as cve,
rhnErrata.synopsis,
count(*) as systems_affected
@@ -33,6 +35,7 @@ sql:
and rhnErrataCVE.cve_id = rhnCVE.id (+)
group by rhnErrata.id,
rhnErrata.advisory_name,
+ rhnErrata.advisory_type,
rhnCVE.name,
rhnErrata.synopsis
order by rhnErrata.advisory_name, rhnCVE.name
13 years, 7 months
Changes to 'refs/tags/NPalert-1.126.11-1'
by Michael Mraka
Tag 'NPalert-1.126.11-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2009-10-30 13:04 +0000
Tagging package [NPalert] version [1.126.11-1] in directory [monitoring/NPalert/].
Changes since spacewalk-java-0.7.15-1:
David Nutter (1):
Fix to use MethodMaker-provided accessor methods for list types.
Justin Sherrill (1):
531059 - fixing issue where certain characters in the org name would cause errors when trying to create things in cobbler
Michael Mraka (1):
Automatic commit of package [NPalert] release [1.126.11-1].
---
java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerCommand.java | 10 +++++++---
monitoring/NPalert/ContactGroup.pm | 2 +-
monitoring/NPalert/FileQueue.pm | 4 ++--
monitoring/NPalert/NPalert.spec | 6 +++++-
rel-eng/packages/NPalert | 2 +-
5 files changed, 16 insertions(+), 8 deletions(-)
---
13 years, 7 months
Branch 'sha256-support3' - backend/server
by Michael Mraka
backend/server/importlib/importLib.py | 7 +++++++
backend/server/importlib/packageImport.py | 13 +++++++------
2 files changed, 14 insertions(+), 6 deletions(-)
New commits:
commit 9c9f63cb3ddd3c43212f934255145180dbe2218b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Oct 30 09:50:08 2009 +0100
fixed errata sync part of satellite-sync
diff --git a/backend/server/importlib/importLib.py b/backend/server/importlib/importLib.py
index 856fe58..dbfde10 100644
--- a/backend/server/importlib/importLib.py
+++ b/backend/server/importlib/importLib.py
@@ -676,6 +676,11 @@ class GenericPackageImport(Import):
if not self.package_arches.has_key(package.arch):
self.package_arches[package.arch] = None
+ # FIXME: needs to be fixed for sha256
+ checksum = ('md5',package['md5sum'])
+ package['checksum'] = checksum
+ if not self.checksums.has_key(checksum):
+ self.checksums[checksum] = None
def _postprocessPackageNEVRA(self, package):
arch = self.package_arches[package.arch]
@@ -697,6 +702,8 @@ class GenericPackageImport(Import):
package['name_id'], package['evr_id'], package['package_arch_id'] = nevra
package['nevra_id'] = nevra_dict[nevra]
+ def _postprocessPackage(self, package):
+ package['checksum_id'] = self.checksums[package['checksum']]
# Exceptions
class ImportException(Exception):
diff --git a/backend/server/importlib/packageImport.py b/backend/server/importlib/packageImport.py
index 8c4932a..a2fca26 100644
--- a/backend/server/importlib/packageImport.py
+++ b/backend/server/importlib/packageImport.py
@@ -71,7 +71,8 @@ class ChannelPackageSubscription(GenericPackageImport):
if package.ignored:
continue
self._postprocessPackageNEVRA(package)
- package['checksum_id'] = self.checksums[package['checksum']]
+ #package['checksum_id'] = self.checksums[package['checksum']]
+ self._postprocessPackage(package)
if not CFG.ENABLE_NVREA:
# nvrea disabled, skip md5sum
nevrao = (
@@ -179,11 +180,11 @@ class ChannelPackageSubscription(GenericPackageImport):
# Replace the channel list with the uniquified list
package.channels = channels
- # FIXME: needs to be fixed for sha256
- checksum = ('md5',package['md5sum'])
- package['checksum'] = checksum
- if not self.checksums.has_key(checksum):
- self.checksums[checksum] = None
+# # FIXME: needs to be fixed for sha256
+# checksum = ('md5',package['md5sum'])
+# package['checksum'] = checksum
+# if not self.checksums.has_key(checksum):
+# self.checksums[checksum] = None
# Copies the channels from one package to the other
def __copyChannels(self, sourcePackage, destPackage):
13 years, 7 months
Branch 'sha256-support2' - 12 commits - backend/satellite_tools backend/server
by Michael Mraka
backend/satellite_tools/reposync.py | 11 +++----
backend/satellite_tools/satsync.py | 46 +++++++++++++++---------------
backend/server/basePackageUpload.py | 2 -
backend/server/importlib/backend.py | 9 +++++
backend/server/importlib/errataImport.py | 1
backend/server/importlib/headerSource.py | 3 +
backend/server/importlib/importLib.py | 5 +++
backend/server/importlib/packageImport.py | 4 +-
backend/server/rhnLib.py | 12 +++----
backend/server/rhnPackage.py | 10 +++---
10 files changed, 61 insertions(+), 42 deletions(-)
New commits:
commit b67449784acfe44a4915102ae80de4a617f662cd
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Oct 19 16:23:06 2009 +0200
fixed ORA-06553: PLS-306: wrong number or types of arguments in call to LOOKUP_CHECKSUM
SQLError: (6553, "ORA-06553: PLS-306: wrong number or types of arguments in call to
'LOOKUP_CHECKSUM'\n", 'select lookup_checksum(:checksum) id from dual')
diff --git a/backend/server/importlib/backend.py b/backend/server/importlib/backend.py
index aa84f02..d362750 100644
--- a/backend/server/importlib/backend.py
+++ b/backend/server/importlib/backend.py
@@ -374,10 +374,10 @@ class Backend:
def lookupChecksums(self, checksumHash):
if not checksumHash:
return
- sql = "select lookup_checksum(:checksum) id from dual"
+ sql = "select lookup_checksum(:checksumtype, :checksum) id from dual"
h = self.dbmodule.prepare(sql)
for k in checksumHash.keys():
- h.execute(checksum=k)
+ h.execute(checksumtype=k[0], checksum=k[1])
checksumHash[k] = h.fetchone_dict()['id']
def ovalFileMD5sumCheck(self, erratum):
diff --git a/backend/server/importlib/packageImport.py b/backend/server/importlib/packageImport.py
index c5e8488..0dffc11 100644
--- a/backend/server/importlib/packageImport.py
+++ b/backend/server/importlib/packageImport.py
@@ -153,6 +153,7 @@ class ChannelPackageSubscription(GenericPackageImport):
'release' : package.evr[2],
'arch' : package.arch,
'org_id' : package.org_id,
+ 'checksum' : package.checksum,
}
channels = package.channels or []
l = []
commit a1a862a136d504532fd0f3e144652cd9c6d2e3e8
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Oct 19 14:55:56 2009 +0200
fixed SQLError: (1008, 'Not all variables bound', 'CHECKSUM')
File "/usr/share/rhn/server/rhnSQL/driver_cx_Oracle.py", line 144, in _execute_
raise sql_base.SQLError(1008, 'Not all variables bound', k)
diff --git a/backend/server/importlib/backend.py b/backend/server/importlib/backend.py
index c0fb874..aa84f02 100644
--- a/backend/server/importlib/backend.py
+++ b/backend/server/importlib/backend.py
@@ -377,7 +377,7 @@ class Backend:
sql = "select lookup_checksum(:checksum) id from dual"
h = self.dbmodule.prepare(sql)
for k in checksumHash.keys():
- h.execute(name=k)
+ h.execute(checksum=k)
checksumHash[k] = h.fetchone_dict()['id']
def ovalFileMD5sumCheck(self, erratum):
commit 01ea2d835a0f1cdb797a6b76078973dc4147b44d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Oct 19 14:26:31 2009 +0200
fixed AttributeError: rpmBinaryPackage instance has no attribute 'checksum'
Traceback (most recent call last):
File "/usr/share/rhn/server/apacheUploadServer.py", line 107, in _wrapper
ret = function(req)
File "/usr/share/rhn/upload_server/handlers/package_push/package_push.py", line 145,
in handler
relative_path=self.rel_package_path, org_id=self.org_id)
File "/usr/share/rhn/server/rhnPackageUpload.py", line 168, in push_package
importer.run()
File "/usr/share/rhn/server/importlib/importLib.py", line 626, in run
self.preprocess()
File "/usr/share/rhn/server/importlib/packageImport.py", line 50, in preprocess
self._processPackage(package)
File "/usr/share/rhn/server/importlib/packageImport.py", line 224, in _processPackage
ChannelPackageSubscription._processPackage(self, package)
File "/usr/share/rhn/server/importlib/packageImport.py", line 167, in _processPackage
GenericPackageImport._processPackage(self, package)
File "/usr/share/rhn/server/importlib/importLib.py", line 679, in _processPackage
if not self.checksums.has_key(package.checksum):
AttributeError: rpmBinaryPackage instance has no attribute 'checksum'
diff --git a/backend/server/importlib/importLib.py b/backend/server/importlib/importLib.py
index 503ad73..452d4c2 100644
--- a/backend/server/importlib/importLib.py
+++ b/backend/server/importlib/importLib.py
@@ -282,6 +282,7 @@ class IncompletePackage(BaseInformation):
self.evr = None
self.arch = None
self.org_id = None
+ self.checksum = None
def toDict(self):
dict = BaseInformation.toDict(self)
commit 710724ca8bbf134259de371113bdd739800d5def
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Oct 16 15:10:23 2009 +0200
fixed TypeError: Unknown field checksum
Traceback (most recent call last):
File "/usr/share/rhn/server/apacheUploadServer.py", line 107, in _wrapper
ret = function(req)
File "/usr/share/rhn/upload_server/handlers/package_push/package_push.py", line 145, in handler
relative_path=self.rel_package_path, org_id=self.org_id)
File "/usr/share/rhn/server/rhnPackageUpload.py", line 168, in push_package
importer.run()
File "/usr/share/rhn/server/importlib/importLib.py", line 628, in run
self.submit()
File "/usr/share/rhn/server/importlib/packageImport.py", line 308, in submit
transactional=self.transactional)
File "/usr/share/rhn/server/importlib/backend.py", line 744, in processPackages
transactional=transactional)
File "/usr/share/rhn/server/importlib/backend.py", line 1473, in __processObjectCollection__
lookup = TableLookup(self.tables[parentTable], self.dbmodule)
File "/usr/share/rhn/server/importlib/backendLib.py", line 229, in __init__
BaseTableLookup.__init__(self, table, dbmodule)
File "/usr/share/rhn/server/importlib/backendLib.py", line 166, in __init__
self._buildWhereClauses()
File "/usr/share/rhn/server/importlib/backendLib.py", line 181, in _buildWhereClauses
if self.table.isNullable(col):
File "/usr/share/rhn/server/importlib/backendLib.py", line 118, in isNullable
raise TypeError("Unknown field %s" % field)
TypeError: Unknown field checksum
diff --git a/backend/server/importlib/backend.py b/backend/server/importlib/backend.py
index 7153216..c0fb874 100644
--- a/backend/server/importlib/backend.py
+++ b/backend/server/importlib/backend.py
@@ -371,6 +371,15 @@ class Backend:
return row['id']
+ def lookupChecksums(self, checksumHash):
+ if not checksumHash:
+ return
+ sql = "select lookup_checksum(:checksum) id from dual"
+ h = self.dbmodule.prepare(sql)
+ for k in checksumHash.keys():
+ h.execute(name=k)
+ checksumHash[k] = h.fetchone_dict()['id']
+
def ovalFileMD5sumCheck(self, erratum):
"""
When oval file is dumped on to RHN filesystem
diff --git a/backend/server/importlib/errataImport.py b/backend/server/importlib/errataImport.py
index b7b9c0d..c79251f 100644
--- a/backend/server/importlib/errataImport.py
+++ b/backend/server/importlib/errataImport.py
@@ -109,6 +109,7 @@ class ErrataImport(GenericPackageImport):
self.backend.lookupPackageNames(self.names)
self.backend.lookupEVRs(self.evrs)
self.backend.lookupPackageArches(self.package_arches)
+ self.backend.lookupChecksums(self.checksums)
for erratum in self.batch:
if erratum.ignored:
diff --git a/backend/server/importlib/importLib.py b/backend/server/importlib/importLib.py
index 225b5d2..503ad73 100644
--- a/backend/server/importlib/importLib.py
+++ b/backend/server/importlib/importLib.py
@@ -661,6 +661,7 @@ class GenericPackageImport(Import):
self.package_arches = {}
self.channels = {}
self.channel_package_arch_compat = {}
+ self.checksums = {}
def _processPackage(self, package):
Import._processPackage(self, package)
@@ -675,6 +676,9 @@ class GenericPackageImport(Import):
if not self.package_arches.has_key(package.arch):
self.package_arches[package.arch] = None
+ if not self.checksums.has_key(package.checksum):
+ self.checksums[package.checksum] = None
+
def _postprocessPackageNEVRA(self, package):
arch = self.package_arches[package.arch]
diff --git a/backend/server/importlib/packageImport.py b/backend/server/importlib/packageImport.py
index fe5d89c..c5e8488 100644
--- a/backend/server/importlib/packageImport.py
+++ b/backend/server/importlib/packageImport.py
@@ -63,6 +63,7 @@ class ChannelPackageSubscription(GenericPackageImport):
self.backend.lookupChannelPackageArchCompat(self.channel_package_arch_compat)
self.backend.lookupPackageNames(self.names)
self.backend.lookupEVRs(self.evrs)
+ self.backend.lookupChecksums(self.checksums)
# Fix the package information up, and uniquify the packages too
uniqdict = {}
@@ -84,7 +85,7 @@ class ChannelPackageSubscription(GenericPackageImport):
package['evr_id'],
package['package_arch_id'],
package['org_id'],
- package['checksum'])
+ package['checksum_id'])
if not uniqdict.has_key(nevrao):
# Uniquify the channel names
commit 66a81cc9fc89e016b5b4de0c8a8e00f9cbb1f593
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Oct 16 14:10:21 2009 +0200
fixed KeyError: 'unknown header tag'
Traceback (most recent call last):
File "/usr/share/rhn/server/apacheUploadServer.py", line 107, in _wrapper
ret = function(req)
File "/usr/share/rhn/upload_server/handlers/package_push/package_push.py", lin
e 145, in handler
relative_path=self.rel_package_path, org_id=self.org_id)
File "/usr/share/rhn/server/rhnPackageUpload.py", line 152, in push_package
header_end=header_end, channels=channels)
File "/usr/share/rhn/server/importlib/mpmSource.py", line 210, in create_packa
ge
header_end=header_end, channels=channels)
File "/usr/share/rhn/server/importlib/headerSource.py", line 377, in createPac
kage
# to expand correctly
File "/usr/share/rhn/server/importlib/headerSource.py", line 139, in populate
header_start=None, header_end=None, channels=[]):
File "/usr/share/rhn/server/importlib/headerSource.py", line 51, in populate
File "/usr/share/rhn/common/rhn_rpm.py", line 154, in __getitem__
return self.hdr[name]
KeyError: 'unknown header tag'
diff --git a/backend/server/importlib/headerSource.py b/backend/server/importlib/headerSource.py
index 8c14edb..9bda12a 100644
--- a/backend/server/importlib/headerSource.py
+++ b/backend/server/importlib/headerSource.py
@@ -31,6 +31,7 @@ class rpmPackage(IncompletePackage):
tagMap = {
# Ignoring these tags
'last_modified' : None,
+ 'sigchecksum' : 'sigmd5', # FIXME: this has to be fixed for sha256
}
def populate(self, header, size, checksum, path=None, org_id=None,
@@ -280,7 +281,7 @@ class rpmFile(File, ChangeLog):
'rdev' : 'filerdevs',
'file_size' : 'filesizes',
'mtime' : 'filemtimes',
- 'checksum' : 'filechecksum',
+ 'checksum' : 'filemd5s', # FIXME: this has to fixed for sha256
'linkto' : 'filelinktos',
'flags' : 'fileflags',
'verifyflags' : 'fileverifyflags',
commit a9ab41f8338bbab8c4d91b824ca3093ee614f37d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Oct 16 00:09:37 2009 +0200
fixed AttributeError: PackagePush instance has no attribute 'file_checksum'
Traceback (most recent call last):
File "/usr/share/rhn/server/apacheUploadServer.py", line 107, in _wrapper
ret = function(req)
e 137, in handler
if checksum != self.file_checksum:
AttributeError: PackagePush instance has no attribute 'file_checksum'
diff --git a/backend/server/basePackageUpload.py b/backend/server/basePackageUpload.py
index ad05f93..64db608 100644
--- a/backend/server/basePackageUpload.py
+++ b/backend/server/basePackageUpload.py
@@ -85,7 +85,7 @@ class BasePackageUpload:
self.package_version = self.field_data["Package-Version"]
self.package_release = self.field_data["Package-Release"]
self.package_arch = self.field_data["Package-Arch"]
- self.file_md5sum = self.field_data["File-MD5sum"]
+ self.file_checksum = self.field_data["File-MD5sum"]
#4/18/05 wregglej. if 1051 is in the header's keys, then it's a nosrc package.
self.is_source = (self.package_arch == 'src' or self.package_arch == 'nosrc')
return apache.OK
commit 9f0c0f1571fd50c4d001d1f6e40653aba2401366
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Oct 15 23:48:33 2009 +0200
replaced one more forgotten md5sum with checksum
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index 74555fd..b6159f0 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -165,7 +165,7 @@ class RepoSync:
package_path = os.path.join(CFG.MOUNT_POINT,
rel_package_path)
package_dict, diff_level = rhnPackageUpload.push_package(header,
- payload_stream, md5sum, force=False,
+ payload_stream, checksum, force=False,
header_start=header_start, header_end=header_end,
relative_path=rel_package_path,
org_id=self.channel['org_id'])
commit 299ff17ddae46c889cfadef0bfc9d241b20eae19
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Oct 15 23:38:52 2009 +0200
fixed TypeError: get_package_path() got an unexpected keyword argument 'checksum'
Traceback (most recent call last):
File "/usr/share/rhn/server/apacheUploadServer.py", line 107, in _wrapper
ret = function(req)
File "/usr/share/rhn/upload_server/handlers/package_push/package_push.py", line 122, in handler
self.rel_package_path = rhnPackageUpload.relative_path_from_header(
File "/usr/share/rhn/server/rhnPackageUpload.py", line 111, in relative_path_from_header
org_id=org_id, package_type=header.packaging, checksum=checksum)
File "/usr/share/rhn/server/rhnPackageUpload.py", line 122, in relative_path_from_nevra
checksum=checksum)
TypeError: get_package_path() got an unexpected keyword argument 'checksum'
diff --git a/backend/server/rhnLib.py b/backend/server/rhnLib.py
index 3695630..d8cadaf 100644
--- a/backend/server/rhnLib.py
+++ b/backend/server/rhnLib.py
@@ -165,11 +165,11 @@ def transpose_to_hash(arr, column_names):
return rh
def get_package_path(nevra, org_id, source=0, prepend="", omit_epoch=None,
- package_type='rpm', md5sum=None):
+ package_type='rpm', checksum=None):
""" Computes a package path, optionally prepending a prefix
The path will look like
- <prefix>/<org_id>/md5sum[:3]/n/e:v-r/a/md5sum/n-v-r.a.rpm if not omit_epoch
- <prefix>/<org_id>/md5sum[:3]/n/v-r/a/md5sum/n-v-r.a.rpm if omit_epoch
+ <prefix>/<org_id>/checksum[:3]/n/e:v-r/a/checksum/n-v-r.a.rpm if not omit_epoch
+ <prefix>/<org_id>/checksum[:3]/n/v-r/a/checksum/n-v-r.a.rpm if omit_epoch
"""
name = nevra[0]
release = nevra[3]
@@ -194,7 +194,7 @@ def get_package_path(nevra, org_id, source=0, prepend="", omit_epoch=None,
# normpath sanitizes the path (removing duplicated / and such)
template = os.path.normpath(prepend +
"/%s/%s/%s/%s-%s/%s/%s/%s-%s-%s.%s.%s")
- return template % (org, md5sum[:3], name, version, release, dirarch, md5sum,
+ return template % (org, checksum[:3], name, version, release, dirarch, checksum,
name, nevra[2], release, pkgarch, package_type)
@@ -205,10 +205,10 @@ def get_package_path(nevra, org_id, source=0, prepend="", omit_epoch=None,
# This enables us to append an arbitrary file name that is not restricted to the
# form: name-version-release.arch.type
def get_package_path_without_package_name(nevra, org_id, prepend="",
- md5sum=None):
+ checksum=None):
"""return a package path without the package name appended"""
return os.path.dirname(get_package_path(nevra, org_id, prepend=prepend,
- md5sum=md5sum))
+ checksum=checksum))
class CallableObj:
commit f706ac1f0379f1b4518544e03dd3f9c559312db8
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Oct 15 17:11:19 2009 +0200
replaced md5sum with checksum
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 5598665..39e0ace 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -908,22 +908,22 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
if ul:
raise RhnSyncException, 'ERROR: incremental dump skipped'
- def _get_rel_package_path(self, nevra, org_id, source=0, md5sum=None):
+ def _get_rel_package_path(self, nevra, org_id, source=0, checksum=None):
return get_package_path(nevra, org_id, prepend=CFG.PREPENDED_DIR,
- source=source, md5sum=md5sum)
+ source=source, checksum=checksum)
- def _verify_file(self, path, mtime, size, md5sum):
+ def _verify_file(self, path, mtime, size, checksum):
"""Verifies if the file is on the filesystem and matches the mtime and
- md5sum
- Computing the md5sum is costly, that's why we rely on mtime
+ checksum
+ Computing the checksum is costly, that's why we rely on mtime
comparisons.
Returns a tuple (error_code, ret_path) where:
- if the file has the specified mtime and md5sum, error_code is 0
+ if the file has the specified mtime and checksum, error_code is 0
and ret_path is None
- if the file has the md5sum, the function sets mtime, error_code is
+ if the file has the checksum, the function sets mtime, error_code is
0 and ret_path is path
- if the file exists but has a different md5sum, error_code is the
- file's current md5sum and ret_path is path
+ if the file exists but has a different checksum, error_code is the
+ file's current checksum and ret_path is path
if the file does not exist at all, error_code is 1 and ret_path is
null
The idea is that error_code is 0 if the file exists or something else
@@ -942,11 +942,11 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
# Same mtime, and size, assume identity
return (0, None)
- # Have to check md5sum
- l_md5sum = rhnLib.getFileMD5(filename=abs_path)
- if l_md5sum != md5sum:
- # Different md5sums
- return (l_md5sum, path)
+ # Have to check checksum
+ l_checksum = rhnLib.getFileMD5(filename=abs_path)
+ if l_checksum != checksum:
+ # Different checksums
+ return (l_checksum, path)
# Set the mtime
os.utime(abs_path, (mtime, mtime))
@@ -957,7 +957,7 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
nevra = []
for t in ['name', 'epoch', 'version', 'release', 'arch']:
nevra.append(package[t])
- md5sum = package['checksum']
+ checksum = package['checksum']
package_size = package['package_size']
if package['org_id'] is not None:
@@ -965,12 +965,12 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
else:
orgid = package['org_id']
- path = self._get_rel_package_path(nevra, orgid, source=source, md5sum=md5sum)
+ path = self._get_rel_package_path(nevra, orgid, source=source, checksum=checksum)
if not row:
# Package is missing completely from the DB
m_channel_packages.append((package_id, path))
(errcode, ret_path) = self._verify_file(path,
- l_timestamp, package_size, md5sum)
+ l_timestamp, package_size, checksum)
if errcode == 0:
# Package on the filesystem, and matches
return
@@ -980,7 +980,7 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
# Package found in the DB
db_timestamp = int(rhnLib.timestamp(row['last_modified']))
- db_md5sum = row['checksum']
+ db_checksum = row['checksum']
db_package_size = row['package_size']
db_path = row['path']
final_path = db_path
@@ -988,7 +988,7 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
# Check the filesystem
# This is one ugly piece of code
(errcode, ret_path) = self._verify_file(db_path, l_timestamp,
- package_size, md5sum)
+ package_size, checksum)
if errcode != 0:
if errcode != 1 or path == db_path:
# Package is modified; fix it
@@ -997,7 +997,7 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
# Package is missing, and the DB path is, for some
# reason, not the same as the computed path.
(errcode, ret_path) = self._verify_file(path,
- l_timestamp, package_size, md5sum)
+ l_timestamp, package_size, checksum)
if errcode != 1:
# Use the computed path
final_path = path
@@ -1005,7 +1005,7 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
# file is modified too; re-download
m_fs_packages.append((package_id, final_path))
- if (l_timestamp <= db_timestamp and md5sum == db_md5sum and
+ if (l_timestamp <= db_timestamp and checksum == db_checksum and
package_size == db_package_size and final_path == db_path):
# Same package
return
@@ -1416,10 +1416,10 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
relative_path = f['relative_path']
dest_path = os.path.join(base_path, relative_path)
timestamp = rhnLib.timestamp(f['last_modified'])
- md5sum = f['checksum']
+ checksum = f['checksum']
file_size = f['file_size']
(errcode, ret_path) = self._verify_file(dest_path,
- timestamp, file_size, md5sum)
+ timestamp, file_size, checksum)
if errcode != 0:
# Have to download it
val = (kt_label, base_path, relative_path,
commit 7f5e17201d62118df4216ae4da3ebbb45dec022b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Oct 15 16:08:44 2009 +0200
removed redundant else; we call associate_package anyway
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index 5db42d0..74555fd 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -144,9 +144,7 @@ class RepoSync:
self.channel['org_id'], checksum_type, checksum)
if pid is None:
self.upload_package(pack, path)
- self.associate_package(pack, checksum_type, checksum)
- else:
- self.associate_package(pack, checksum_type, checksum) #package is already on the satellite, lets just associate
+ self.associate_package(pack, checksum_type, checksum)
if self.url.find("file://") < 0:
os.remove(path)
commit d3977896a4ccc48447fc7fdc212dc38b5be0e599
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Oct 15 16:07:03 2009 +0200
replaced get_package_for_md5sum with get_package_for_checksum
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index a62d85a..5db42d0 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -139,13 +139,14 @@ class RepoSync:
pack.getNVREA())
path = self.plugin.get_package(pack)
checksum = rhnLib.getFileMD5(filename=path)
- pid = rhnPackage.get_package_for_md5sum(
- self.channel['org_id'], checksum)
+ checksum_type = 'md5'
+ pid = rhnPackage.get_package_for_checksum(
+ self.channel['org_id'], checksum_type, checksum)
if pid is None:
self.upload_package(pack, path)
- self.associate_package(pack, 'md5', checksum)
+ self.associate_package(pack, checksum_type, checksum)
else:
- self.associate_package(pack, 'md5', checksum) #package is already on the satellite, lets just associate
+ self.associate_package(pack, checksum_type, checksum) #package is already on the satellite, lets just associate
if self.url.find("file://") < 0:
os.remove(path)
diff --git a/backend/server/rhnPackage.py b/backend/server/rhnPackage.py
index 0b77e02..e40eaf8 100644
--- a/backend/server/rhnPackage.py
+++ b/backend/server/rhnPackage.py
@@ -432,18 +432,20 @@ def get_channels_for_package(pkg):
return []
return map(lambda c: c['label'], ret)
-def get_package_for_md5sum(org_id, checksum):
+def get_package_for_checksum(org_id, checksum_type, checksum):
statement = """
select
p.id
from
- rhnPackage p, rhnChecksum c
+ rhnPackage p, rhnChecksum c, rhnChecksumType t
where p.org_id = :org_id
and p.checksum_id = c.id
and c.checksum = :checksum
+ and c.checksum_type_id = t.id
+ and t.label = :checksum_type
"""
h = rhnSQL.prepare(statement)
- h.execute(org_id=org_id, checksum=checksum)
+ h.execute(org_id=org_id, checksum=checksum, checksum_type=checksum_type)
ret = h.fetchone_dict()
if not ret:
return None
commit b55538227c2e90af0980ac07b1a882776b8a3540
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Oct 15 16:00:06 2009 +0200
fixed ORA-00904: "P"."CHECKSUM": invalid identifier
Traceback (most recent call last):
File "/usr/share/rhn/satellite_tools/reposync.py", line 142, in import_packages
pid = rhnPackage.get_package_for_md5sum(
File "/usr/share/rhn/server/rhnPackage.py", line 446, in get_package_for_md5sum
h.execute(org_id=org_id, checksum=checksum)
File "/usr/share/rhn/server/rhnSQL/sql_base.py", line 168, in execute
return apply(self._execute_wrapper, (self._execute, ) + p, kw)
File "/usr/share/rhn/server/rhnSQL/driver_cx_Oracle.py", line 108, in _execute_wrapper
raise apply(sql_base.SQLStatementPrepareError, args)
SQLStatementPrepareError: ('ORA-00904: "P"."CHECKSUM": invalid identifier\n', 904, 'select p.id from rhnPackage p, rhnChecksum c where p.org_id = :org_id and p.checksum_id = c.id and p.checksum = :checksum')
diff --git a/backend/server/rhnPackage.py b/backend/server/rhnPackage.py
index e57ec50..0b77e02 100644
--- a/backend/server/rhnPackage.py
+++ b/backend/server/rhnPackage.py
@@ -440,7 +440,7 @@ def get_package_for_md5sum(org_id, checksum):
rhnPackage p, rhnChecksum c
where p.org_id = :org_id
and p.checksum_id = c.id
- and p.checksum = :checksum
+ and c.checksum = :checksum
"""
h = rhnSQL.prepare(statement)
h.execute(org_id=org_id, checksum=checksum)
13 years, 7 months
2 commits - monitoring/NPalert rel-eng/packages
by Michael Mraka
monitoring/NPalert/ContactGroup.pm | 2 +-
monitoring/NPalert/FileQueue.pm | 4 ++--
monitoring/NPalert/NPalert.spec | 6 +++++-
rel-eng/packages/NPalert | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-)
New commits:
commit 7e914b7e31c4c8466e7fcabd768d7fba6cae4905
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Oct 30 14:04:15 2009 +0100
Automatic commit of package [NPalert] release [1.126.11-1].
diff --git a/monitoring/NPalert/NPalert.spec b/monitoring/NPalert/NPalert.spec
index 87c53d9..60ccbd3 100644
--- a/monitoring/NPalert/NPalert.spec
+++ b/monitoring/NPalert/NPalert.spec
@@ -9,7 +9,7 @@ Name: NPalert
Summary: NOCpulse notification system
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 1.126.10
+Version: 1.126.11
Release: 1%{?dist}
BuildArch: noarch
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
@@ -129,6 +129,10 @@ fi
rm -rf $RPM_BUILD_ROOT
%changelog
+* Fri Oct 30 2009 Michael Mraka <michael.mraka(a)redhat.com> 1.126.11-1
+- Fix to use MethodMaker-provided accessor methods for list types.
+- bailout is defined in NOCpulse::NOCpulseini
+
* Thu Aug 20 2009 Miroslav Suchý <msuchy(a)redhat.com> 1.126.10-1
- avoid deadlock when we have problem after acquiring lock
diff --git a/rel-eng/packages/NPalert b/rel-eng/packages/NPalert
index 0e0d527..d512968 100644
--- a/rel-eng/packages/NPalert
+++ b/rel-eng/packages/NPalert
@@ -1 +1 @@
-1.126.10-1 monitoring/NPalert/
+1.126.11-1 monitoring/NPalert/
commit 37a0b62c8124dbb7a57a9e2e0762cd23f1b66d6c
Author: David Nutter <davidn(a)elrond.bioss.sari.ac.uk>
Date: Tue Oct 27 11:59:28 2009 +0000
Fix to use MethodMaker-provided accessor methods for list types.
diff --git a/monitoring/NPalert/ContactGroup.pm b/monitoring/NPalert/ContactGroup.pm
index 73e0213..fe25f26 100644
--- a/monitoring/NPalert/ContactGroup.pm
+++ b/monitoring/NPalert/ContactGroup.pm
@@ -27,7 +27,7 @@ sub new_strategy_for_alert {
sub add_destination {
#####################
my ($self,$destination)=@_;
- push(@{$self->destinations},$destination);
+ $self->push_destinations($destination);
}
##############################
diff --git a/monitoring/NPalert/FileQueue.pm b/monitoring/NPalert/FileQueue.pm
index 4a1f89b..cfd400d 100644
--- a/monitoring/NPalert/FileQueue.pm
+++ b/monitoring/NPalert/FileQueue.pm
@@ -33,10 +33,10 @@ sub _filelist {
$Log->log(9,`ls -alt`,"\n");
my @files=glob("*");
- $Log->dump(9,"\@files are ",@files,"\n(@files)\n");
+ $Log->dump(9,"\@files are ",\@files,"\n(@files)\n");
# Prepend the directory name to the file names found
- @{$self->_files}=map { $self->directory . "/$_" } @files;
+ $self->_files( (map { $self->directory . "/$_" } @files) );
$Log->dump(9,"_files are ",$self->_files,"\n(_files)\n");
chdir $dir;
return $self->_files;
13 years, 7 months
java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerCommand.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
New commits:
commit de23b16f7ca113515c691ab285053c3a86aebdd0
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Oct 27 12:19:31 2009 -0400
531059 - fixing issue where certain characters in the org name would cause errors when trying to create things in cobbler
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerCommand.java
index bcd243e..44818b5 100755
--- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerCommand.java
@@ -123,12 +123,16 @@ public abstract class CobblerCommand {
* @return the cobbler name.
*/
public static String makeCobblerName(String label, Org org) {
+ label = label.replaceAll("[^a-zA-Z0-9]", "").replace(' ', '_');
+
if (org == null) {
- return label.replace(' ', '-');
+ return label;
}
+
+ String orgName = org.getName().replaceAll("[^a-zA-Z0-9]", "").replace(' ', '_');
String format = "%s:%s:%s";
- return String.format(format, label.replace(' ', '-'), org.getId(),
- org.getName().replace(' ', '-'));
+ return String.format(format, label, org.getId(), orgName);
+
}
/**
13 years, 7 months