Fix T401 and T402 errors
Fix all the one line docstring errors in T401 and T402, now
we no longer ignore any of our own rules in hacking.py
Fix run_tests.sh to pick up the 'stress' directory, which tox
does for pep8. Additional fixes to the stress tests for T4* tests
Change-Id: Ie569a924e8eb355afbbd9b244f77dec34061b5cb
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
index 1c8d4f3..56546de 100644
--- a/tempest/services/compute/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -53,7 +53,7 @@
def create_flavor(self, name, ram, vcpus, disk, ephemeral, flavor_id,
swap, rxtx):
- """Creates a new flavor or instance type"""
+ """Creates a new flavor or instance type."""
post_body = {
'name': name,
'ram': ram,
@@ -72,5 +72,5 @@
return resp, body['flavor']
def delete_flavor(self, flavor_id):
- """Deletes the given flavor"""
+ """Deletes the given flavor."""
return self.delete("flavors/%s" % str(flavor_id))
diff --git a/tempest/services/compute/json/floating_ips_client.py b/tempest/services/compute/json/floating_ips_client.py
index 15882c7..d73b8a9 100644
--- a/tempest/services/compute/json/floating_ips_client.py
+++ b/tempest/services/compute/json/floating_ips_client.py
@@ -29,7 +29,7 @@
self.service = self.config.compute.catalog_type
def list_floating_ips(self, params=None):
- """Returns a list of all floating IPs filtered by any parameters"""
+ """Returns a list of all floating IPs filtered by any parameters."""
url = 'os-floating-ips'
if params:
url += '?%s' % urllib.urlencode(params)
@@ -39,7 +39,7 @@
return resp, body['floating_ips']
def get_floating_ip_details(self, floating_ip_id):
- """Get the details of a floating IP"""
+ """Get the details of a floating IP."""
url = "os-floating-ips/%s" % str(floating_ip_id)
resp, body = self.get(url)
body = json.loads(body)
@@ -48,20 +48,20 @@
return resp, body['floating_ip']
def create_floating_ip(self):
- """Allocate a floating IP to the project"""
+ """Allocate a floating IP to the project."""
url = 'os-floating-ips'
resp, body = self.post(url, None, None)
body = json.loads(body)
return resp, body['floating_ip']
def delete_floating_ip(self, floating_ip_id):
- """Deletes the provided floating IP from the project"""
+ """Deletes the provided floating IP from the project."""
url = "os-floating-ips/%s" % str(floating_ip_id)
resp, body = self.delete(url)
return resp, body
def associate_floating_ip_to_server(self, floating_ip, server_id):
- """Associate the provided floating IP to a specific server"""
+ """Associate the provided floating IP to a specific server."""
url = "servers/%s/action" % str(server_id)
post_body = {
'addFloatingIp': {
@@ -74,7 +74,7 @@
return resp, body
def disassociate_floating_ip_from_server(self, floating_ip, server_id):
- """Disassociate the provided floating IP from a specific server"""
+ """Disassociate the provided floating IP from a specific server."""
url = "servers/%s/action" % str(server_id)
post_body = {
'removeFloatingIp': {
diff --git a/tempest/services/compute/json/hosts_client.py b/tempest/services/compute/json/hosts_client.py
index 517e230..dc3c524 100644
--- a/tempest/services/compute/json/hosts_client.py
+++ b/tempest/services/compute/json/hosts_client.py
@@ -11,7 +11,7 @@
self.service = self.config.compute.catalog_type
def list_hosts(self):
- """Lists all hosts"""
+ """Lists all hosts."""
url = 'os-hosts'
resp, body = self.get(url)
diff --git a/tempest/services/compute/json/images_client.py b/tempest/services/compute/json/images_client.py
index 452400a..376dafc 100644
--- a/tempest/services/compute/json/images_client.py
+++ b/tempest/services/compute/json/images_client.py
@@ -33,7 +33,7 @@
self.build_timeout = self.config.compute.build_timeout
def create_image(self, server_id, name, meta=None):
- """Creates an image of the original server"""
+ """Creates an image of the original server."""
post_body = {
'createImage': {
@@ -50,7 +50,7 @@
return resp, body
def list_images(self, params=None):
- """Returns a list of all images filtered by any parameters"""
+ """Returns a list of all images filtered by any parameters."""
url = 'images'
if params:
url += '?%s' % urllib.urlencode(params)
@@ -60,7 +60,7 @@
return resp, body['images']
def list_images_with_detail(self, params=None):
- """Returns a detailed list of images filtered by any parameters"""
+ """Returns a detailed list of images filtered by any parameters."""
url = 'images/detail'
if params:
url += '?%s' % urllib.urlencode(params)
@@ -70,13 +70,13 @@
return resp, body['images']
def get_image(self, image_id):
- """Returns the details of a single image"""
+ """Returns the details of a single image."""
resp, body = self.get("images/%s" % str(image_id))
body = json.loads(body)
return resp, body['image']
def delete_image(self, image_id):
- """Deletes the provided image"""
+ """Deletes the provided image."""
return self.delete("images/%s" % str(image_id))
def wait_for_image_resp_code(self, image_id, code):
@@ -110,13 +110,13 @@
raise exceptions.TimeoutException
def list_image_metadata(self, image_id):
- """Lists all metadata items for an image"""
+ """Lists all metadata items for an image."""
resp, body = self.get("images/%s/metadata" % str(image_id))
body = json.loads(body)
return resp, body['metadata']
def set_image_metadata(self, image_id, meta):
- """Sets the metadata for an image"""
+ """Sets the metadata for an image."""
post_body = json.dumps({'metadata': meta})
resp, body = self.put('images/%s/metadata' % str(image_id),
post_body, self.headers)
@@ -124,7 +124,7 @@
return resp, body['metadata']
def update_image_metadata(self, image_id, meta):
- """Updates the metadata for an image"""
+ """Updates the metadata for an image."""
post_body = json.dumps({'metadata': meta})
resp, body = self.post('images/%s/metadata' % str(image_id),
post_body, self.headers)
@@ -132,13 +132,13 @@
return resp, body['metadata']
def get_image_metadata_item(self, image_id, key):
- """Returns the value for a specific image metadata key"""
+ """Returns the value for a specific image metadata key."""
resp, body = self.get("images/%s/metadata/%s" % (str(image_id), key))
body = json.loads(body)
return resp, body['meta']
def set_image_metadata_item(self, image_id, key, meta):
- """Sets the value for a specific image metadata key"""
+ """Sets the value for a specific image metadata key."""
post_body = json.dumps({'meta': meta})
resp, body = self.put('images/%s/metadata/%s' % (str(image_id), key),
post_body, self.headers)
@@ -146,7 +146,7 @@
return resp, body['meta']
def delete_image_metadata_item(self, image_id, key):
- """Deletes a single image metadata key/value pair"""
+ """Deletes a single image metadata key/value pair."""
resp, body = self.delete("images/%s/metadata/%s" %
(str(image_id), key))
return resp, body
diff --git a/tempest/services/compute/json/quotas_client.py b/tempest/services/compute/json/quotas_client.py
index 2cc417f..543b015 100644
--- a/tempest/services/compute/json/quotas_client.py
+++ b/tempest/services/compute/json/quotas_client.py
@@ -28,7 +28,7 @@
self.service = self.config.compute.catalog_type
def get_quota_set(self, tenant_id):
- """List the quota set for a tenant"""
+ """List the quota set for a tenant."""
url = 'os-quota-sets/%s' % str(tenant_id)
resp, body = self.get(url)
diff --git a/tempest/services/compute/json/security_groups_client.py b/tempest/services/compute/json/security_groups_client.py
index f2586e5..95f2831 100644
--- a/tempest/services/compute/json/security_groups_client.py
+++ b/tempest/services/compute/json/security_groups_client.py
@@ -30,7 +30,7 @@
self.service = self.config.compute.catalog_type
def list_security_groups(self, params=None):
- """List all security groups for a user"""
+ """List all security groups for a user."""
url = 'os-security-groups'
if params:
@@ -41,7 +41,7 @@
return resp, body['security_groups']
def get_security_group(self, security_group_id):
- """Get the details of a Security Group"""
+ """Get the details of a Security Group."""
url = "os-security-groups/%s" % str(security_group_id)
resp, body = self.get(url)
body = json.loads(body)
@@ -63,7 +63,7 @@
return resp, body['security_group']
def delete_security_group(self, security_group_id):
- """Deletes the provided Security Group"""
+ """Deletes the provided Security Group."""
return self.delete('os-security-groups/%s' % str(security_group_id))
def create_security_group_rule(self, parent_group_id, ip_proto, from_port,
@@ -93,5 +93,5 @@
return resp, body['security_group_rule']
def delete_security_group_rule(self, group_rule_id):
- """Deletes the provided Security Group rule"""
+ """Deletes the provided Security Group rule."""
return self.delete('os-security-group-rules/%s' % str(group_rule_id))
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index 2e34ef8..b832af0 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -110,17 +110,17 @@
return resp, body['server']
def get_server(self, server_id):
- """Returns the details of an existing server"""
+ """Returns the details of an existing server."""
resp, body = self.get("servers/%s" % str(server_id))
body = json.loads(body)
return resp, body['server']
def delete_server(self, server_id):
- """Deletes the given server"""
+ """Deletes the given server."""
return self.delete("servers/%s" % str(server_id))
def list_servers(self, params=None):
- """Lists all servers for a user"""
+ """Lists all servers for a user."""
url = 'servers'
if params:
@@ -131,7 +131,7 @@
return resp, body
def list_servers_with_detail(self, params=None):
- """Lists all servers in detail for a user"""
+ """Lists all servers in detail for a user."""
url = 'servers/detail'
if params:
@@ -142,7 +142,7 @@
return resp, body
def wait_for_server_status(self, server_id, status):
- """Waits for a server to reach a given status"""
+ """Waits for a server to reach a given status."""
resp, body = self.get_server(server_id)
server_status = body['status']
start = int(time.time())
@@ -165,7 +165,7 @@
raise exceptions.TimeoutException(message)
def wait_for_server_termination(self, server_id, ignore_error=False):
- """Waits for server to reach termination"""
+ """Waits for server to reach termination."""
start_time = int(time.time())
while True:
try:
@@ -183,20 +183,20 @@
time.sleep(self.build_interval)
def list_addresses(self, server_id):
- """Lists all addresses for a server"""
+ """Lists all addresses for a server."""
resp, body = self.get("servers/%s/ips" % str(server_id))
body = json.loads(body)
return resp, body['addresses']
def list_addresses_by_network(self, server_id, network_id):
- """Lists all addresses of a specific network type for a server"""
+ """Lists all addresses of a specific network type for a server."""
resp, body = self.get("servers/%s/ips/%s" %
(str(server_id), network_id))
body = json.loads(body)
return resp, body
def change_password(self, server_id, password):
- """Changes the root password for the server"""
+ """Changes the root password for the server."""
post_body = {
'changePassword': {
'adminPass': password,
@@ -208,7 +208,7 @@
post_body, self.headers)
def reboot(self, server_id, reboot_type):
- """Reboots a server"""
+ """Reboots a server."""
post_body = {
'reboot': {
'type': reboot_type,
@@ -221,7 +221,7 @@
def rebuild(self, server_id, image_ref, name=None, meta=None,
personality=None, adminPass=None, disk_config=None):
- """Rebuilds a server with a new image"""
+ """Rebuilds a server with a new image."""
post_body = {
'imageRef': image_ref,
}
@@ -264,7 +264,7 @@
return resp, body
def confirm_resize(self, server_id):
- """Confirms the flavor change for a server"""
+ """Confirms the flavor change for a server."""
post_body = {
'confirmResize': None,
}
@@ -275,7 +275,7 @@
return resp, body
def revert_resize(self, server_id):
- """Reverts a server back to its original flavor"""
+ """Reverts a server back to its original flavor."""
post_body = {
'revertResize': None,
}
@@ -286,7 +286,7 @@
return resp, body
def create_image(self, server_id, image_name):
- """Creates an image of the given server"""
+ """Creates an image of the given server."""
post_body = {
'createImage': {
'name': image_name,
@@ -345,7 +345,7 @@
post_body, self.headers)
def attach_volume(self, server_id, volume_id, device='/dev/vdz'):
- """Attaches a volume to a server instance"""
+ """Attaches a volume to a server instance."""
post_body = json.dumps({
'volumeAttachment': {
'volumeId': volume_id,
@@ -357,13 +357,13 @@
return resp, body
def detach_volume(self, server_id, volume_id):
- """Detaches a volume from a server instance"""
+ """Detaches a volume from a server instance."""
resp, body = self.delete('servers/%s/os-volume_attachments/%s' %
(server_id, volume_id))
return resp, body
def add_security_group(self, server_id, security_group_name):
- """Adds a security group to the server"""
+ """Adds a security group to the server."""
post_body = {
'addSecurityGroup': {
'name': security_group_name
@@ -374,7 +374,7 @@
post_body, self.headers)
def remove_security_group(self, server_id, security_group_name):
- """Removes a security group from the server"""
+ """Removes a security group from the server."""
post_body = {
'removeSecurityGroup': {
'name': security_group_name
@@ -385,7 +385,7 @@
post_body, self.headers)
def live_migrate_server(self, server_id, dest_host, use_block_migration):
- """ This should be called with administrator privileges """
+ """This should be called with administrator privileges ."""
migrate_params = {
"disk_over_commit": False,
@@ -409,7 +409,7 @@
return resp, body['servers']
def migrate_server(self, server_id):
- """Migrates a server to a new host"""
+ """Migrates a server to a new host."""
post_body = {'migrate': 'null'}
post_body = json.dumps(post_body)
resp, body = self.post('servers/%s/action' % server_id,
@@ -417,7 +417,7 @@
return resp, body
def confirm_migration(self, server_id):
- """Confirms the migration of a server"""
+ """Confirms the migration of a server."""
post_body = {'confirmResize': 'null'}
post_body = json.dumps(post_body)
resp, body = self.post('servers/%s/action' % server_id,
@@ -425,63 +425,63 @@
return resp, body
def lock_server(self, server_id):
- """Locks the given server"""
+ """Locks the given server."""
post_body = {'lock': 'null'}
post_body = json.dumps(post_body)
resp, body = self.post('servers/%s/action' % server_id,
post_body, self.headers)
def unlock_server(self, server_id):
- """UNlocks the given server"""
+ """UNlocks the given server."""
post_body = {'unlock': 'null'}
post_body = json.dumps(post_body)
resp, body = self.post('servers/%s/action' % server_id,
post_body, self.headers)
def start_server(self, server_id):
- """Starts the given server"""
+ """Starts the given server."""
post_body = {'os-start': 'null'}
post_body = json.dumps(post_body)
resp, body = self.post('servers/%s/action' % server_id,
post_body, self.headers)
def stop_server(self, server_id):
- """Stops the given server"""
+ """Stops the given server."""
post_body = {'os-stop': 'null'}
post_body = json.dumps(post_body)
resp, body = self.post('servers/%s/action' % server_id,
post_body, self.headers)
def suspend_server(self, server_id):
- """Suspends the provded server"""
+ """Suspends the provded server."""
post_body = {'suspend': 'null'}
post_body = json.dumps(post_body)
resp, body = self.post('servers/%s/action' % server_id,
post_body, self.headers)
def resume_server(self, server_id):
- """Un-suspends the provded server"""
+ """Un-suspends the provded server."""
post_body = {'resume': 'null'}
post_body = json.dumps(post_body)
resp, body = self.post('servers/%s/action' % server_id,
post_body, self.headers)
def pause_server(self, server_id):
- """Pauses the provded server"""
+ """Pauses the provded server."""
post_body = {'pause': 'null'}
post_body = json.dumps(post_body)
resp, body = self.post('servers/%s/action' % server_id,
post_body, self.headers)
def unpause_server(self, server_id):
- """Un-pauses the provded server"""
+ """Un-pauses the provded server."""
post_body = {'unpause': 'null'}
post_body = json.dumps(post_body)
resp, body = self.post('servers/%s/action' % server_id,
post_body, self.headers)
def reset_state(self, server_id, new_state='error'):
- """Resets the state of a server to active/error"""
+ """Resets the state of a server to active/error."""
post_body = {
'os-resetState': {
'state': new_state
diff --git a/tempest/services/compute/json/volumes_extensions_client.py b/tempest/services/compute/json/volumes_extensions_client.py
index 6cf6c23..a5f6ec3 100644
--- a/tempest/services/compute/json/volumes_extensions_client.py
+++ b/tempest/services/compute/json/volumes_extensions_client.py
@@ -34,7 +34,7 @@
self.build_timeout = self.config.volume.build_timeout
def list_volumes(self, params=None):
- """List all the volumes created"""
+ """List all the volumes created."""
url = 'os-volumes'
if params:
url += '?%s' % urllib.urlencode(params)
@@ -44,7 +44,7 @@
return resp, body['volumes']
def list_volumes_with_detail(self, params=None):
- """List all the details of volumes"""
+ """List all the details of volumes."""
url = 'os-volumes/detail'
if params:
url += '?%s' % urllib.urlencode(params)
@@ -54,7 +54,7 @@
return resp, body['volumes']
def get_volume(self, volume_id, wait=None):
- """Returns the details of a single volume"""
+ """Returns the details of a single volume."""
url = "os-volumes/%s" % str(volume_id)
resp, body = self.get(url, wait=wait)
body = json.loads(body)
@@ -80,11 +80,11 @@
return resp, body['volume']
def delete_volume(self, volume_id):
- """Deletes the Specified Volume"""
+ """Deletes the Specified Volume."""
return self.delete("os-volumes/%s" % str(volume_id))
def wait_for_volume_status(self, volume_id, status):
- """Waits for a Volume to reach a given status"""
+ """Waits for a Volume to reach a given status."""
resp, body = self.get_volume(volume_id)
volume_name = body['displayName']
volume_status = body['status']