summaryrefslogtreecommitdiffstats
path: root/yum-presto/presto.py
diff options
context:
space:
mode:
Diffstat (limited to 'yum-presto/presto.py')
-rw-r--r--yum-presto/presto.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/yum-presto/presto.py b/yum-presto/presto.py
index 255372c..641e775 100644
--- a/yum-presto/presto.py
+++ b/yum-presto/presto.py
@@ -356,14 +356,15 @@ class PrestoParser(object):
def config_hook(conduit):
# Add --disable-presto option
parser = conduit.getOptParser()
- parser.add_option('', '--disablepresto', dest='disablepresto',
- action='store_true', default=False,
- help="disable Presto plugin and don't download any deltarpms")
-
+ if parser:
+ parser.add_option('', '--disablepresto', dest='disablepresto',
+ action='store_true', default=False,
+ help="disable Presto plugin and don't download any deltarpms")
+
# Set up Presto repositories
def postreposetup_hook(conduit):
opts, commands = conduit.getCmdLine()
- if not opts.disablepresto:
+ if not opts or not opts.disablepresto:
conduit.info(2, 'Setting up and reading Presto delta metadata')
for active_repo in conduit.getRepos().listEnabled():
try:
@@ -378,7 +379,7 @@ def postreposetup_hook(conduit):
def predownload_hook(conduit):
opts, commands = conduit.getCmdLine()
- if opts.disablepresto or len(conduit.getDownloadPackages()) == 0:
+ if (opts and opts.disablepresto) or len(conduit.getDownloadPackages()) == 0:
return
conduit.info(2, "Downloading DeltaRPMs:")