updated config services to use getattr instead of hasattr to simplify code

This commit is contained in:
Blake Harnden 2020-01-23 11:27:05 -08:00
parent 852eb60ab9
commit 0749dcacb2
4 changed files with 17 additions and 15 deletions

View file

@ -82,7 +82,7 @@ class Nat(ConfigService):
def data(self) -> Dict[str, Any]:
ifnames = []
for ifc in self.node.netifs():
if hasattr(ifc, "control") and ifc.control is True:
if getattr(ifc, "control", False):
continue
ifnames.append(ifc.name)
return dict(ifnames=ifnames)