X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfatables%2Fcommands%2FAdd.py;h=987cff50e719b45b3d6ac51fdd8cd97cdd3595bd;hb=36c72ed190b237fdb774941a579442b027e0fab8;hp=c6f89a880ff0a09b7094540d36e10dfc2092cf73;hpb=a26c2035f895f329fd7d2a8892b7606be0d46116;p=sfa.git diff --git a/sfatables/commands/Add.py b/sfatables/commands/Add.py index c6f89a88..987cff50 100644 --- a/sfatables/commands/Add.py +++ b/sfatables/commands/Add.py @@ -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))