Skip to content

Commit 82396dd

Browse files
FIX for #297 (#307)
There was a problem when `load_json(self.client.request('GET', path))['resources']` is null, as is later expected to be iterated. Therefore, I added a default empty list as output value for that property call.
1 parent 35ceba8 commit 82396dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openshift/dynamic/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ def get_resources_for_api_version(self, prefix, group, version, preferred):
715715
subresources = {}
716716

717717
path = '/'.join(filter(None, [prefix, group, version]))
718-
resources_response = load_json(self.client.request('GET', path))['resources']
718+
resources_response = load_json(self.client.request('GET', path))['resources'] or []
719719

720720
resources_raw = list(filter(lambda resource: '/' not in resource['name'], resources_response))
721721
subresources_raw = list(filter(lambda resource: '/' in resource['name'], resources_response))

0 commit comments

Comments
 (0)