Skip to content

Commit

Permalink
FIX for #297 (#307)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
openshift-cherrypick-robot authored and fabianvf committed Jun 7, 2019
1 parent 35ceba8 commit 82396dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openshift/dynamic/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ def get_resources_for_api_version(self, prefix, group, version, preferred):
subresources = {}

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

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

0 comments on commit 82396dd

Please sign in to comment.