X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FNATUtil.py;h=e08a6daf820392c536f649d021f85c4fffd991bd;hp=ab97e05dcc0dddafac9c58b8991d357f3cd88fef;hb=b4e5c717f5e2c39ded81f0c6f7b0f9f61945befd;hpb=0ad00a491e7c39f126abcd087bc2743dbdc3a1af diff --git a/resources/libraries/python/NATUtil.py b/resources/libraries/python/NATUtil.py index ab97e05dcc..e08a6daf82 100644 --- a/resources/libraries/python/NATUtil.py +++ b/resources/libraries/python/NATUtil.py @@ -197,9 +197,9 @@ class NATUtil(object): items = line.split(" ") while "" in items: items.remove("") - if len(items) == 0: + if not items: continue - elif len(items) == 4: + if len(items) == 4: # no ports were returned data.append({ "local_address": items[0], @@ -246,9 +246,9 @@ class NATUtil(object): for trash in ("", "vat#"): while trash in items: items.remove(trash) - if len(items) == 0: + if not items: continue - elif len(items) == 3: + if len(items) == 3: data.append({ # items[0] is the table header - "sw_if_index" "sw_if_index": items[1],