replace iterator by generator (#205)

Fix network_sanity_ee_tests

SUMMARY

Network sanity ee tests are broken

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
This commit is contained in:
abikouo
2021-08-17 15:33:27 +02:00
committed by GitHub
parent b875531c8a
commit a4701a6806
5 changed files with 11 additions and 7 deletions

View File

@@ -40,7 +40,7 @@ class Selector(object):
self._operator = m.group(4)
self._data = [x.replace(' ', '') for x in m.group(6).split(',') if x != '']
return True
elif all([x not in data for x in self.equality_based_operators]):
elif all(x not in data for x in self.equality_based_operators):
self._key = data.rstrip(" ").lstrip(" ")
if self._key.startswith("!"):
self._key = self._key[1:].lstrip(" ")
@@ -68,4 +68,4 @@ class LabelSelectorFilter(object):
labels = definition['metadata']['labels']
if not isinstance(labels, dict):
return None
return all([sel.isMatch(labels) for sel in self.selectors])
return all(sel.isMatch(labels) for sel in self.selectors)