a little nicer wrt pep8
[sfa.git] / sfatables / commands / Add.py
index c6f89a8..987cff5 100644 (file)
@@ -1,7 +1,7 @@
-import os, time
+import os
 import libxml2
 from sfatables.command import Command
-from sfatables.globals import *
+from sfatables.globals import sfatables_config, target_dir, match_dir
 
 class Add(Command):
     def __init__(self):
@@ -41,7 +41,7 @@ class Add(Command):
             option_name = option['name']
             option_value = getattr(options,option_name)
 
-            if (hasattr(options,option_name)):
+            if (hasattr(options,option_name) and getattr(options,option_name)):
                 context = p.xpathEval("//rule[@element='%s' or @element='*']/argument[name='%s']"%(element, option_name))
                 if (not context):
                     raise Exception('Unknown option %s for match %s and element %s'%(option,option['name'], element))