From b21a62a937eb2abb7d32d64c826ba5a357a35a05 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Tue, 21 Feb 2017 09:16:30 -0500 Subject: Removed unused code. Made tests executable. --- roles/lib_openshift/src/class/oc_adm_registry.py | 31 +++++----------------- .../src/test/unit/test_oadm_manage_node.py | 0 roles/lib_openshift/src/test/unit/test_oc_env.py | 0 roles/lib_openshift/src/test/unit/test_oc_label.py | 0 .../lib_openshift/src/test/unit/test_oc_process.py | 0 roles/lib_openshift/src/test/unit/test_oc_route.py | 0 roles/lib_openshift/src/test/unit/test_oc_scale.py | 0 .../lib_openshift/src/test/unit/test_oc_secret.py | 0 .../lib_openshift/src/test/unit/test_oc_service.py | 0 .../src/test/unit/test_oc_serviceaccount.py | 0 .../src/test/unit/test_oc_serviceaccount_secret.py | 0 .../lib_openshift/src/test/unit/test_oc_version.py | 0 12 files changed, 6 insertions(+), 25 deletions(-) mode change 100644 => 100755 roles/lib_openshift/src/test/unit/test_oadm_manage_node.py mode change 100644 => 100755 roles/lib_openshift/src/test/unit/test_oc_env.py mode change 100644 => 100755 roles/lib_openshift/src/test/unit/test_oc_label.py mode change 100644 => 100755 roles/lib_openshift/src/test/unit/test_oc_process.py mode change 100644 => 100755 roles/lib_openshift/src/test/unit/test_oc_route.py mode change 100644 => 100755 roles/lib_openshift/src/test/unit/test_oc_scale.py mode change 100644 => 100755 roles/lib_openshift/src/test/unit/test_oc_secret.py mode change 100644 => 100755 roles/lib_openshift/src/test/unit/test_oc_service.py mode change 100644 => 100755 roles/lib_openshift/src/test/unit/test_oc_serviceaccount.py mode change 100644 => 100755 roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py mode change 100644 => 100755 roles/lib_openshift/src/test/unit/test_oc_version.py (limited to 'roles/lib_openshift/src') diff --git a/roles/lib_openshift/src/class/oc_adm_registry.py b/roles/lib_openshift/src/class/oc_adm_registry.py index 505c4db81..8cb7aea31 100644 --- a/roles/lib_openshift/src/class/oc_adm_registry.py +++ b/roles/lib_openshift/src/class/oc_adm_registry.py @@ -98,10 +98,6 @@ class Registry(OpenShiftCLI): ''' setter method for prepared_registry attribute ''' self.__prepared_registry = data - def force_prepare_registry(self): - '''force a registry prep''' - self.__prepared_registry = None - def get(self): ''' return the self.registry_parts ''' self.deploymentconfig = None @@ -212,9 +208,6 @@ class Registry(OpenShiftCLI): def update(self): '''run update for the registry. This performs a delete and then create ''' # Store the current service IP - self.force_prepare_registry() - - self.get() if self.service: svcip = self.service.get('spec.clusterIP') if svcip: @@ -223,18 +216,6 @@ class Registry(OpenShiftCLI): if portip: self.portal_ip = portip - #parts = self.delete(complete=False) - #for part in parts: - # if part['returncode'] != 0: - # if part.has_key('stderr') and 'not found' in part['stderr']: - # # the object is not there, continue - # continue - # # something went wrong - # return parts - - # Ugly built in sleep here. - #time.sleep(10) - results = [] if self.prepared_registry['deployment_update']: results.append(self._replace(self.prepared_registry['deployment_file'])) @@ -289,7 +270,7 @@ class Registry(OpenShiftCLI): return deploymentconfig.yaml_dict - def needs_update(self, verbose=False): + def needs_update(self): ''' check to see if we need to update ''' if not self.service or not self.deploymentconfig: return True @@ -298,7 +279,7 @@ class Registry(OpenShiftCLI): if not Utils.check_def_equal(self.prepared_registry['service'].yaml_dict, self.service.yaml_dict, exclude_list, - verbose): + debug=self.verbose): self.prepared_registry['service_update'] = True exclude_list = ['dnsPolicy', @@ -306,7 +287,6 @@ class Registry(OpenShiftCLI): 'restartPolicy', 'timeoutSeconds', 'livenessProbe', 'readinessProbe', 'terminationMessagePath', - 'rollingParams', 'securityContext', 'imagePullPolicy', 'protocol', # ports.portocol: TCP @@ -318,7 +298,7 @@ class Registry(OpenShiftCLI): if not Utils.check_def_equal(self.prepared_registry['deployment'].yaml_dict, self.deploymentconfig.yaml_dict, exclude_list, - verbose): + debug=self.verbose): self.prepared_registry['deployment_update'] = True return self.prepared_registry['deployment_update'] or self.prepared_registry['service_update'] or False @@ -350,14 +330,15 @@ class Registry(OpenShiftCLI): }) - ocregistry = Registry(rconfig) + ocregistry = Registry(rconfig, params['debug']) + + api_rval = ocregistry.get() state = params['state'] ######## # get ######## if state == 'list': - api_rval = ocregistry.get() if api_rval['returncode'] != 0: return {'failed': True, 'msg': api_rval} diff --git a/roles/lib_openshift/src/test/unit/test_oadm_manage_node.py b/roles/lib_openshift/src/test/unit/test_oadm_manage_node.py old mode 100644 new mode 100755 diff --git a/roles/lib_openshift/src/test/unit/test_oc_env.py b/roles/lib_openshift/src/test/unit/test_oc_env.py old mode 100644 new mode 100755 diff --git a/roles/lib_openshift/src/test/unit/test_oc_label.py b/roles/lib_openshift/src/test/unit/test_oc_label.py old mode 100644 new mode 100755 diff --git a/roles/lib_openshift/src/test/unit/test_oc_process.py b/roles/lib_openshift/src/test/unit/test_oc_process.py old mode 100644 new mode 100755 diff --git a/roles/lib_openshift/src/test/unit/test_oc_route.py b/roles/lib_openshift/src/test/unit/test_oc_route.py old mode 100644 new mode 100755 diff --git a/roles/lib_openshift/src/test/unit/test_oc_scale.py b/roles/lib_openshift/src/test/unit/test_oc_scale.py old mode 100644 new mode 100755 diff --git a/roles/lib_openshift/src/test/unit/test_oc_secret.py b/roles/lib_openshift/src/test/unit/test_oc_secret.py old mode 100644 new mode 100755 diff --git a/roles/lib_openshift/src/test/unit/test_oc_service.py b/roles/lib_openshift/src/test/unit/test_oc_service.py old mode 100644 new mode 100755 diff --git a/roles/lib_openshift/src/test/unit/test_oc_serviceaccount.py b/roles/lib_openshift/src/test/unit/test_oc_serviceaccount.py old mode 100644 new mode 100755 diff --git a/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py b/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py old mode 100644 new mode 100755 diff --git a/roles/lib_openshift/src/test/unit/test_oc_version.py b/roles/lib_openshift/src/test/unit/test_oc_version.py old mode 100644 new mode 100755 -- cgit v1.2.3