diff --git a/src/memory/memory.py b/src/memory/memory.py index 461a964a..9bbc8f1d 100644 --- a/src/memory/memory.py +++ b/src/memory/memory.py @@ -533,6 +533,10 @@ class Params(object): @return: a deferred that fire a minidom.Document of the profile xml (cf warning above) """ + def checkNode(node): + """Check the node against security_limit and app""" + return self.checkSecurityLimit(node, security_limit) and self.checkApp(node, app) + def constructProfile(ignore, profile_cache): # init the result document prof_xml = minidom.parseString('') @@ -553,10 +557,7 @@ class Params(object): for node in dest_cat.childNodes: if node.nodeName != "param": continue - if not self.checkSecurityLimit(node, security_limit): - dest_cat.removeChild(node) - continue - if not self.checkApp(node, app): + if not checkNode(node): dest_cat.removeChild(node) continue dest_params[node.getAttribute('name')] = node @@ -571,9 +572,7 @@ class Params(object): # we have to merge new params (we are parsing individual parameters, we have to add them # to the previously parsed general ones) name = param_node.getAttribute('name') - if not self.checkSecurityLimit(param_node, security_limit): - continue - if not self.checkApp(param_node, app): + if not checkNode(param_node): continue if name not in dest_params: # this is reached when a previous category exists