X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfatables%2Fcommands%2FList.py;h=e3c124e6c985a2bfb85bb9614471e5b735f73c9b;hb=cd69c1122bea567d05ffd952eeaab7239823f45f;hp=16d100844f2907b7a8a73ae3a7a6b74b90614d64;hpb=fb8bd835b4f25a8cdfb23e088849fbe0db77b779;p=sfa.git diff --git a/sfatables/commands/List.py b/sfatables/commands/List.py index 16d10084..e3c124e6 100644 --- a/sfatables/commands/List.py +++ b/sfatables/commands/List.py @@ -17,11 +17,11 @@ class List(Command): return - def get_info(self, xmlextension_path): + def get_info(self, type, xmlextension_path): xmldoc = libxml2.parseFile(xmlextension_path) p = xmldoc.xpathNewContext() - ext_name_node = p.xpathEval("/match/@name") + ext_name_node = p.xpathEval("/%s/@name"%type) ext_name = ext_name_node[0].content name_nodes = p.xpathEval("//rule/argument[value!='']/name") @@ -69,8 +69,8 @@ class List(Command): match_path = sfatables_config + '/' + chain + '/' + match_file target_path = sfatables_config + '/' + chain + '/' + target_file - match_info = self.get_info (match_path) - target_info = self.get_info (target_path) + match_info = self.get_info ('match',match_path) + target_info = self.get_info ('target',target_path) pretty.push_row(["%d"%number, match_info['name'], match_info['arguments'], target_info['name'], target_info['arguments']])