backend/satellite_tools/updatePackages.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 5f51c5f9cac3c2402c01366f1803a494bea2db38
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Sep 30 13:14:00 2009 +0200
Do the rhn_rpm.get_package_header before we do the actual move.
As this call can fail and abort the whole script, we move this
up, before we start to do the actual rename.
Note that we have to call it with old_abs_path.
diff --git a/backend/satellite_tools/updatePackages.py
b/backend/satellite_tools/updatePackages.py
index 0a6cdf2..d7553fa 100644
--- a/backend/satellite_tools/updatePackages.py
+++ b/backend/satellite_tools/updatePackages.py
@@ -188,6 +188,11 @@ def process_package_data():
if debug: Log.writeMessage("Missing path %s for package %d" % (
old_abs_path, path['id']))
continue
+ try:
+ hdr = rhn_rpm.get_package_header(filename=old_abs_path)
+ except IOError:
+ raise
+
if old_abs_path != new_abs_path:
new_abs_dir = os.path.dirname(new_abs_path)
# relocate the package on the filer
@@ -207,11 +212,6 @@ def process_package_data():
if debug: Log.writeMessage("query Executed: update rhnPackage %d to %s"
\
% ( path['id'], new_path ))
# Process gpg key ids
- try:
- #hdr = get_package_info(old_abs_path)
- hdr = rhn_rpm.get_package_header(filename=new_abs_path)
- except IOError:
- raise
server_packages.processPackageKeyAssociations(hdr, md5sum)
if debug: Log.writeMessage("gpg key info updated from %s" %
new_abs_path )
i = i + 1
Show replies by date