Merge "Extend T110 check for lib's service clients"
diff --git a/tempest/hacking/checks.py b/tempest/hacking/checks.py
index f4b76e5..d1bc141 100644
--- a/tempest/hacking/checks.py
+++ b/tempest/hacking/checks.py
@@ -151,7 +151,7 @@
def _common_service_clients_check(logical_line, physical_line, filename,
ignored_list_file=None):
- if 'tempest/services/' not in filename:
+ if not re.match('tempest/(lib/)?services/.*', filename):
return False
if ignored_list_file is not None:
diff --git a/tempest/lib/services/compute/flavors_client.py b/tempest/lib/services/compute/flavors_client.py
index 6869f02..e377c84 100644
--- a/tempest/lib/services/compute/flavors_client.py
+++ b/tempest/lib/services/compute/flavors_client.py
@@ -133,7 +133,9 @@
resp, body)
return rest_client.ResponseBody(resp, body)
- def unset_flavor_extra_spec(self, flavor_id, key):
+ def unset_flavor_extra_spec(self, flavor_id, key): # noqa
+ # NOTE: This noqa is for passing T111 check and we cannot rename
+ # to keep backwards compatibility.
"""Unset extra Specs from the mentioned flavor."""
resp, body = self.delete('flavors/%s/os-extra_specs/%s' %
(flavor_id, key))
diff --git a/tempest/lib/services/compute/hosts_client.py b/tempest/lib/services/compute/hosts_client.py
index 0143765..16b5edd 100644
--- a/tempest/lib/services/compute/hosts_client.py
+++ b/tempest/lib/services/compute/hosts_client.py
@@ -61,7 +61,11 @@
self.validate_response(schema.update_host, resp, body)
return rest_client.ResponseBody(resp, body)
- def startup_host(self, hostname):
+ def startup_host(self, hostname): # noqa
+ # NOTE: This noqa is for passing T110 check and we cannot rename
+ # to keep backwards compatibility. Actually, the root problem
+ # of this is a wrong API design. GET operation should not change
+ # resource status, but current API does that.
"""Startup a host."""
resp, body = self.get("os-hosts/%s/startup" % hostname)
@@ -69,7 +73,11 @@
self.validate_response(schema.startup_host, resp, body)
return rest_client.ResponseBody(resp, body)
- def shutdown_host(self, hostname):
+ def shutdown_host(self, hostname): # noqa
+ # NOTE: This noqa is for passing T110 check and we cannot rename
+ # to keep backwards compatibility. Actually, the root problem
+ # of this is a wrong API design. GET operation should not change
+ # resource status, but current API does that.
"""Shutdown a host."""
resp, body = self.get("os-hosts/%s/shutdown" % hostname)
@@ -77,7 +85,11 @@
self.validate_response(schema.shutdown_host, resp, body)
return rest_client.ResponseBody(resp, body)
- def reboot_host(self, hostname):
+ def reboot_host(self, hostname): # noqa
+ # NOTE: This noqa is for passing T110 check and we cannot rename
+ # to keep backwards compatibility. Actually, the root problem
+ # of this is a wrong API design. GET operation should not change
+ # resource status, but current API does that.
"""Reboot a host."""
resp, body = self.get("os-hosts/%s/reboot" % hostname)
diff --git a/tempest/lib/services/compute/hypervisor_client.py b/tempest/lib/services/compute/hypervisor_client.py
index 5dcecc9..23c304e 100644
--- a/tempest/lib/services/compute/hypervisor_client.py
+++ b/tempest/lib/services/compute/hypervisor_client.py
@@ -63,7 +63,9 @@
self.validate_response(schema.get_hypervisor_uptime, resp, body)
return rest_client.ResponseBody(resp, body)
- def search_hypervisor(self, hypervisor_name):
+ def search_hypervisor(self, hypervisor_name): # noqa
+ # NOTE: This noqa is for passing T110 check and we cannot rename
+ # to keep backwards compatibility.
"""Search specified hypervisor."""
resp, body = self.get('os-hypervisors/%s/search' % hypervisor_name)
body = json.loads(body)
diff --git a/tempest/lib/services/network/quotas_client.py b/tempest/lib/services/network/quotas_client.py
index b5cf35b..752b253 100644
--- a/tempest/lib/services/network/quotas_client.py
+++ b/tempest/lib/services/network/quotas_client.py
@@ -22,7 +22,9 @@
uri = '/quotas/%s' % tenant_id
return self.update_resource(uri, put_body)
- def reset_quotas(self, tenant_id):
+ def reset_quotas(self, tenant_id): # noqa
+ # NOTE: This noqa is for passing T111 check and we cannot rename
+ # to keep backwards compatibility.
uri = '/quotas/%s' % tenant_id
return self.delete_resource(uri)