diff options
Diffstat (limited to 'roles/lib_openshift/library')
-rw-r--r-- | roles/lib_openshift/library/oc_adm_router.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/roles/lib_openshift/library/oc_adm_router.py b/roles/lib_openshift/library/oc_adm_router.py index 324b87f84..ef4483c3c 100644 --- a/roles/lib_openshift/library/oc_adm_router.py +++ b/roles/lib_openshift/library/oc_adm_router.py @@ -2501,8 +2501,11 @@ class Router(OpenShiftCLI): ''' property for the prepared router''' if self.__prepared_router is None: results = self._prepare_router() - if not results: - raise RouterException('Could not perform router preparation') + if not results or 'returncode' in results and results['returncode'] != 0: + if 'stderr' in results: + raise RouterException('Could not perform router preparation: %s' % results['stderr']) + + raise RouterException('Could not perform router preparation.') self.__prepared_router = results return self.__prepared_router @@ -2665,7 +2668,7 @@ class Router(OpenShiftCLI): results = self.openshift_cmd(cmd, oadm=True, output=True, output_type='json') # pylint: disable=no-member - if results['returncode'] != 0 and 'items' in results['results']: + if results['returncode'] != 0 or 'items' not in results['results']: return results oc_objects = {'DeploymentConfig': {'obj': None, 'path': None, 'update': False}, @@ -2705,9 +2708,11 @@ class Router(OpenShiftCLI): '''Create a deploymentconfig ''' results = [] + import time # pylint: disable=no-member for _, oc_data in self.prepared_router.items(): if oc_data['obj'] is not None: + time.sleep(1) results.append(self._create(oc_data['path'])) rval = 0 |