Browse Source

Fix typo: extention -> extension

Change-Id: I507a7dbcdd3d543bddc65bc96e401b8b6a34a056
changes/05/560805/1
Hunt Xu 4 years ago
parent
commit
7c092063e7
  1. 16
      qinling/orchestrator/kubernetes/manager.py
  2. 4
      qinling/orchestrator/kubernetes/utils.py
  3. 2
      qinling/tests/unit/orchestrator/kubernetes/test_manager.py
  4. 4
      qinling_tempest_plugin/tests/base.py

16
qinling/orchestrator/kubernetes/manager.py

@ -41,7 +41,7 @@ class KubernetesManager(base.OrchestratorBase):
clients = k8s_util.get_k8s_clients(self.conf)
self.v1 = clients['v1']
self.v1extention = clients['v1extention']
self.v1extension = clients['v1extension']
# self.apps_v1 = clients['apps_v1']
# Create namespace if not exists
@ -91,7 +91,7 @@ class KubernetesManager(base.OrchestratorBase):
retry=tenacity.retry_if_result(lambda result: not result)
)
def _wait_deployment_available(self, name):
ret = self.v1extention.read_namespaced_deployment(
ret = self.v1extension.read_namespaced_deployment(
name,
self.conf.kubernetes.namespace
)
@ -116,7 +116,7 @@ class KubernetesManager(base.OrchestratorBase):
"Creating deployment for runtime %s: \n%s", name, deployment_body
)
self.v1extention.create_namespaced_deployment(
self.v1extension.create_namespaced_deployment(
body=yaml.safe_load(deployment_body),
namespace=self.conf.kubernetes.namespace
)
@ -132,7 +132,7 @@ class KubernetesManager(base.OrchestratorBase):
labels = {'runtime_id': name}
selector = common.convert_dict_to_string(labels)
self.v1extention.delete_collection_namespaced_replica_set(
self.v1extension.delete_collection_namespaced_replica_set(
self.conf.kubernetes.namespace,
label_selector=selector
)
@ -149,7 +149,7 @@ class KubernetesManager(base.OrchestratorBase):
)
LOG.info("Services in deployment %s deleted.", name)
self.v1extention.delete_collection_namespaced_deployment(
self.v1extension.delete_collection_namespaced_deployment(
self.conf.kubernetes.namespace,
label_selector=selector,
field_selector='metadata.name=%s' % name
@ -185,7 +185,7 @@ class KubernetesManager(base.OrchestratorBase):
}
}
}
self.v1extention.patch_namespaced_deployment(
self.v1extension.patch_namespaced_deployment(
name, self.conf.kubernetes.namespace, body
)
@ -196,7 +196,7 @@ class KubernetesManager(base.OrchestratorBase):
time.sleep(5)
retry = retry - 1
deploy = self.v1extention.read_namespaced_deployment_status(
deploy = self.v1extension.read_namespaced_deployment_status(
name,
self.conf.kubernetes.namespace
)
@ -210,7 +210,7 @@ class KubernetesManager(base.OrchestratorBase):
"revision": 0
}
}
self.v1extention.create_namespaced_deployment_rollback(
self.v1extension.create_namespaced_deployment_rollback(
name, self.conf.kubernetes.namespace, body
)

4
qinling/orchestrator/kubernetes/utils.py

@ -30,13 +30,13 @@ def get_k8s_clients(conf):
config.verify_ssl = False
client = api_client.ApiClient(configuration=config)
v1 = core_v1_api.CoreV1Api(client)
v1extention = extensions_v1beta1_api.ExtensionsV1beta1Api(client)
v1extension = extensions_v1beta1_api.ExtensionsV1beta1Api(client)
# apps_v1 = apps_v1_api.AppsV1Api(client)
clients = {
'v1': v1,
# 'apps_v1': apps_v1
'v1extention': v1extention
'v1extension': v1extension
}
return clients

2
qinling/tests/unit/orchestrator/kubernetes/test_manager.py

@ -39,7 +39,7 @@ class TestKubernetesManager(base.BaseTest):
self.k8s_v1_api = mock.Mock()
self.k8s_v1_ext = mock.Mock()
clients = {'v1': self.k8s_v1_api,
'v1extention': self.k8s_v1_ext}
'v1extension': self.k8s_v1_ext}
mock.patch(
'qinling.orchestrator.kubernetes.utils.get_k8s_clients',
return_value=clients

4
qinling_tempest_plugin/tests/base.py

@ -91,7 +91,7 @@ class BaseQinlingTest(test.BaseTestCase):
'qinling_tempest_plugin',
"functions/%s" % name
)
base_name, extention = os.path.splitext(file_path)
base_name, extension = os.path.splitext(file_path)
module_name = os.path.basename(base_name)
temp_dir = tempfile.mkdtemp()
zip_file = os.path.join(temp_dir, '%s.zip' % module_name)
@ -99,7 +99,7 @@ class BaseQinlingTest(test.BaseTestCase):
if not os.path.isfile(zip_file):
zf = zipfile.ZipFile(zip_file, mode='w')
try:
zf.write(file_path, '%s%s' % (module_name, extention))
zf.write(file_path, '%s%s' % (module_name, extension))
finally:
zf.close()

Loading…
Cancel
Save