Skip to content

Commit

Permalink
Handle empty response in 'check_ready'
Browse files Browse the repository at this point in the history
  • Loading branch information
bsquizz committed Jun 15, 2021
1 parent a4c77f2 commit 1240d37
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bonfire/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,11 @@ def _observe(self, item):

def check_ready(self):
response = get_json(self.restype, name=self.name, namespace=self.namespace)
self._uid = response["metadata"]["uid"]
self._observe(response)
return all([r["ready"] is True for _, r in self.observed_resources.items()])
if response:
self._uid = response["metadata"]["uid"]
self._observe(response)
return all([r["ready"] is True for _, r in self.observed_resources.items()])
return False

def _check_with_periodic_log(self):
if self.check_ready():
Expand Down

0 comments on commit 1240d37

Please sign in to comment.