Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openshift/dynamic/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ def update(self, resources):
@property
def api_groups(self):
""" list available api groups """
return self.__resources['apis'].keys()
return [group['name'] for group in load_json(self.__client.request("GET", '/apis'))['groups']]

def get(self, **kwargs):
""" Same as search, but will throw an error if there are multiple or no
Expand Down
13 changes: 6 additions & 7 deletions openshift/helper/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,28 +609,27 @@ def _read_stream(self, watcher, stream, name):
# Object is either added or modified. Check the status and determine if we
# should continue waiting
if hasattr(obj, 'status'):
status = getattr(obj, 'status')
if hasattr(status, 'phase'):
if status.phase == 'Active':
if hasattr(obj.status, 'phase'):
if obj.status.phase == 'Active':
# TODO other phase values ??
# TODO test namespaces for OpenShift annotations if needed
return_obj = obj
watcher.stop()
break
elif hasattr(status, 'conditions'):
conditions = getattr(status, 'conditions')
elif hasattr(obj.status, 'conditions'):
conditions = obj.status.conditions
if conditions and len(conditions) > 0:
# We know there is a status, but it's up to the user to determine meaning.
return_obj = obj
watcher.stop()
break
elif obj.kind == 'Service' and status is not None:
elif obj.kind == 'Service' and obj.status is not None:
return_obj = obj
watcher.stop()
break
elif obj.kind == 'Route':
route_statuses = set()
for route_ingress in status.ingress:
for route_ingress in obj.status.ingress:
for condition in route_ingress.conditions:
route_statuses.add(condition.type)
if route_statuses <= {'Ready', 'Admitted'}:
Expand Down