--- scripts/anaconda-yum | 50 +++++++++++++++++++++++++------------------------- scripts/makeupdates | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/scripts/anaconda-yum b/scripts/anaconda-yum index 98ebcd1..2bd2a76 100755 --- a/scripts/anaconda-yum +++ b/scripts/anaconda-yum @@ -75,31 +75,31 @@ def run_yum_transaction(release, arch, yum_conf, install_root, ts_file, script_l env_remove = ('DISPLAY', 'DBUS_SESSION_BUS_ADDRESS') [os.environ.pop(k) for k in env_remove if k in os.environ]
- try: - # Setup the basics, point to the config file and install_root - yb = yum.YumBase() - yb.use_txmbr_in_callback = True - - # Set some configuration parameters that don't get set through a config - # file. yum will know what to do with these. - # Enable all types of yum plugins. We're somewhat careful about what - # plugins we put in the environment. - yb.preconf.plugin_types = yum.plugins.ALL_TYPES - yb.preconf.enabled_plugins = YUM_PLUGINS - yb.preconf.fn = yum_conf - yb.preconf.root = install_root - yb.preconf.releasever = release - - if debug: - yb.preconf.debuglevel = 10 - yb.preconf.errorlevel = 10 - yb.preconf.rpmverbosity = "debug" - - # Setup yum cache dir outside the installroot - if yb.conf.cachedir.startswith(yb.conf.installroot): - root = yb.conf.installroot - yb.conf.cachedir = yb.conf.cachedir[len(root):] + # Setup the basics, point to the config file and install_root + yb = yum.YumBase() + yb.use_txmbr_in_callback = True + + # Set some configuration parameters that don't get set through a config + # file. yum will know what to do with these. + # Enable all types of yum plugins. We're somewhat careful about what + # plugins we put in the environment. + yb.preconf.plugin_types = yum.plugins.ALL_TYPES + yb.preconf.enabled_plugins = YUM_PLUGINS + yb.preconf.fn = yum_conf + yb.preconf.root = install_root + yb.preconf.releasever = release + + if debug: + yb.preconf.debuglevel = 10 + yb.preconf.errorlevel = 10 + yb.preconf.rpmverbosity = "debug" + + # Setup yum cache dir outside the installroot + if yb.conf.cachedir.startswith(yb.conf.installroot): + root = yb.conf.installroot + yb.conf.cachedir = yb.conf.cachedir[len(root):]
+ try: # Load the transaction file and execute it yb.load_ts(ts_file) yb.initActionTs() @@ -151,7 +151,7 @@ def run_yum_transaction(release, arch, yum_conf, install_root, ts_file, script_l finally: yb.ts.close() logfile.close() - except Exception as e: + except YumBaseError as e: print("ERROR: transaction error: %s" % e) finally: print("QUIT:") diff --git a/scripts/makeupdates b/scripts/makeupdates index ef935ca..2ee3ee5 100755 --- a/scripts/makeupdates +++ b/scripts/makeupdates @@ -181,7 +181,7 @@ def download_to_file(url, path): result = urllib.urlretrieve(url, path) # return the storage path return result[0] - except Exception, e: + except IOError, e: print("download of %s to %s failed with exception: %s" % (url, path, e)) return None