modify some shell scripts to make variable references safer; modify some python scripts to reduce the code complexity and cyclomatic complexity of functions.

This commit is contained in:
herengui
2022-08-22 09:57:07 +08:00
parent aaea1d9451
commit 4d78917c35
12 changed files with 164 additions and 262 deletions

View File

@@ -47,11 +47,8 @@ class wvmNWFilter(wvmConnect):
return ElementTree.tostring(tree).decode()
def get_filter_refs(self):
refs = []
tree = ElementTree.fromstring(self._XMLDesc(0))
for ref in tree.findall("./filterref"):
refs.append(ref.get("filter"))
return refs
return [ref.get("filter") for ref in tree.findall("./filterref")]
def get_rules(self):
rules = []