mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-04-14 12:51:16 +00:00
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:
@@ -143,7 +143,7 @@ class Discoverer(kubernetes.dynamic.discovery.Discoverer):
|
||||
result for result in results if result.group_version == kwargs['api_version']
|
||||
]
|
||||
# If there are multiple matches, prefer non-List kinds
|
||||
if len(results) > 1 and not all([isinstance(x, ResourceList) for x in results]):
|
||||
if len(results) > 1 and not all(isinstance(x, ResourceList) for x in results):
|
||||
results = [result for result in results if not isinstance(result, ResourceList)]
|
||||
# if multiple resources are found that share a GVK, prefer the one with the most supported verbs
|
||||
if len(results) > 1 and len(set((x.group_version, x.kind) for x in results)) == 1:
|
||||
@@ -162,6 +162,10 @@ class LazyDiscoverer(Discoverer, kubernetes.dynamic.LazyDiscoverer):
|
||||
Discoverer.__init__(self, client, cache_file)
|
||||
self.__update_cache = False
|
||||
|
||||
@property
|
||||
def update_cache(self):
|
||||
self.__update_cache
|
||||
|
||||
|
||||
class CacheDecoder(json.JSONDecoder):
|
||||
def __init__(self, client, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user