diff --git a/plugins/fastestmirror/fastestmirror.py b/plugins/fastestmirror/fastestmirror.py
index dc4df92..add870a 100644
--- a/plugins/fastestmirror/fastestmirror.py
+++ b/plugins/fastestmirror/fastestmirror.py
@@ -130,7 +130,7 @@ def postreposetup_hook(conduit):
"""
global loadcache, exclude
opts, commands = conduit.getCmdLine()
- if opts.cacheonly:
+ if hasattr(opts, 'cacheonly') and opts.cacheonly:
return
if loadcache:
conduit.info(2, "Loading mirror speeds from cached hostfile")