From d936ace684a9410f7f15e86c1a856232973d7bd4 Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Sat, 3 Jun 2017 18:58:16 -0400 Subject: [PATCH] fixes(#46) ConfigMaps and Secrets do not have status --- openshift/helper/base.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openshift/helper/base.py b/openshift/helper/base.py index cf52e864..67a1c80c 100644 --- a/openshift/helper/base.py +++ b/openshift/helper/base.py @@ -185,7 +185,12 @@ def get_object(self, name, namespace=None): def patch_object(self, name, namespace, k8s_obj): self.logger.debug('Starting patch object') - empty_status = self.properties['status']['class']() + + if 'status' in self.properties['status']: + empty_status = self.properties['status']['class']() + else: + empty_status = {} + k8s_obj.status = empty_status k8s_obj.metadata.resource_version = None self.__remove_creation_timestamps(k8s_obj) @@ -499,6 +504,8 @@ def _wait_for_response(self, name, namespace, action): if action == 'delete': if not obj: break + elif obj and not hasattr(obj, 'status'): + break elif obj and obj.status and hasattr(obj.status, 'phase'): if obj.status.phase == 'Active': break