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/run_tests.sh b/run_tests.sh
index f50b695..e350c13 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -75,9 +75,10 @@
echo "Running pep8 ..."
srcfiles="`find tempest -type f -name "*.py"`"
srcfiles+=" `find tools -type f -name "*.py"`"
+ srcfiles+=" `find stress -type f -name "*.py"`"
srcfiles+=" setup.py"
- ignore='--ignore=T401,T402,E121,E122,E125,E126'
+ ignore='--ignore=E121,E122,E125,E126'
${wrapper} python tools/hacking.py ${ignore} ${srcfiles}
}
diff --git a/stress/config.py b/stress/config.py
index 64091cd..ca86ce5 100755
--- a/stress/config.py
+++ b/stress/config.py
@@ -39,15 +39,15 @@
@property
def nova_logdir(self):
- """Directory containing log files on the compute nodes"""
+ """Directory containing log files on the compute nodes."""
return self.get("nova_logdir", None)
@property
def controller(self):
- """Controller host"""
+ """Controller host."""
return self.get("controller", None)
@property
def max_instances(self):
- """Maximum number of instances to create during test"""
+ """Maximum number of instances to create during test."""
return self.get("max_instances", 16)
diff --git a/stress/pending_action.py b/stress/pending_action.py
index 635d2cc..abfa74d 100644
--- a/stress/pending_action.py
+++ b/stress/pending_action.py
@@ -46,7 +46,7 @@
return False
def check_timeout(self):
- """Check for timeouts of TestCase actions"""
+ """Check for timeouts of TestCase actions."""
time_diff = time.time() - self._start_time
if time_diff > self._timeout:
self._logger.error('%s exceeded timeout of %d' %
@@ -76,7 +76,7 @@
self._target = target_server
def _check_for_status(self, state_string):
- """Check to see if the machine has transitioned states"""
+ """Check to see if the machine has transitioned states."""
t = time.time() # for debugging
target = self._target
_resp, body = self._manager.servers_client.get_server(target['id'])
diff --git a/stress/test_case.py b/stress/test_case.py
index fe510d5..d04ace0 100644
--- a/stress/test_case.py
+++ b/stress/test_case.py
@@ -25,5 +25,5 @@
self._logger = logging.getLogger(self.__class__.__name__)
def run(self, nova_manager, state_obj, *pargs, **kargs):
- """Nova API methods to call that would modify state of the cluster"""
+ """Nova API methods to call that would modify state of the cluster."""
return
diff --git a/stress/test_floating_ips.py b/stress/test_floating_ips.py
index 9d89510..97e4382 100755
--- a/stress/test_floating_ips.py
+++ b/stress/test_floating_ips.py
@@ -61,7 +61,7 @@
class VerifyChangeFloatingIp(pending_action.PendingAction):
- """Verify that floating ip was changed"""
+ """Verify that floating ip was changed."""
def __init__(self, manager, floating_ip, timeout, add=None):
super(VerifyChangeFloatingIp, self).__init__(manager, timeout=timeout)
self.floating_ip = floating_ip
diff --git a/stress/test_server_actions.py b/stress/test_server_actions.py
index 3b4e71c..a2032f0 100644
--- a/stress/test_server_actions.py
+++ b/stress/test_server_actions.py
@@ -27,7 +27,7 @@
class TestRebootVM(test_case.StressTestCase):
- """Reboot a server"""
+ """Reboot a server."""
def run(self, manager, state, *pargs, **kwargs):
"""
@@ -132,7 +132,7 @@
# This code needs to be tested against a cluster that supports resize.
#class TestResizeVM(test_case.StressTestCase):
-# """Resize a server (change flavors)"""
+# """Resize a server (change flavors)."""
#
# def run(self, manager, state, *pargs, **kwargs):
# """
@@ -193,7 +193,7 @@
# timeout=_timeout)
#
#class VerifyResizeVM(pending_action.PendingServerAction):
-# """Verify that resizing of a VM was successful"""
+# """Verify that resizing of a VM was successful."""
# States = enum('VERIFY_RESIZE_CHECK', 'ACTIVE_CHECK')
#
# def __init__(self, manager, state, created_server,
diff --git a/stress/test_servers.py b/stress/test_servers.py
index 9957cdb..e1cb4d1 100644
--- a/stress/test_servers.py
+++ b/stress/test_servers.py
@@ -96,7 +96,7 @@
class VerifyCreateVM(pending_action.PendingServerAction):
- """Verify that VM was built and is running"""
+ """Verify that VM was built and is running."""
def __init__(self, manager,
state,
created_server,
@@ -175,7 +175,7 @@
class VerifyKillActiveVM(pending_action.PendingServerAction):
- """Verify that server was destroyed"""
+ """Verify that server was destroyed."""
def retry(self):
"""
@@ -238,7 +238,7 @@
class TestUpdateVMName(test_case.StressTestCase):
- """Class to change the name of the active server"""
+ """Class to change the name of the active server."""
def run(self, manager, state, *pargs, **kwargs):
"""
Issue HTTP POST request to change the name of active server.
@@ -288,7 +288,7 @@
class VerifyUpdateVMName(pending_action.PendingServerAction):
- """Check that VM has new name"""
+ """Check that VM has new name."""
def retry(self):
"""
Check that VM has new name. Update local view of `state` to RUNNING.
diff --git a/stress/tests/floating_ips.py b/stress/tests/floating_ips.py
index d62e892..6a4452c 100755
--- a/stress/tests/floating_ips.py
+++ b/stress/tests/floating_ips.py
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-"""Stress test that associates/disasssociates floating ips"""
+"""Stress test that associates/disasssociates floating ips."""
from stress.basher import BasherAction
from stress.driver import *
diff --git a/stress/tests/hard_reboots.py b/stress/tests/hard_reboots.py
index f35c6de..fe57be1 100644
--- a/stress/tests/hard_reboots.py
+++ b/stress/tests/hard_reboots.py
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-"""Test that reboots random instances in a Nova cluster"""
+"""Test that reboots random instances in a Nova cluster."""
from stress.test_servers import *
diff --git a/stress/utils/util.py b/stress/utils/util.py
index f90796d..ec63b99 100644
--- a/stress/utils/util.py
+++ b/stress/utils/util.py
@@ -50,6 +50,6 @@
def enum(*sequential, **named):
- """Create auto-incremented enumerated types"""
+ """Create auto-incremented enumerated types."""
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index c96fc4f..287ef56 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -303,7 +303,7 @@
return resp, resp_body
def wait_for_resource_deletion(self, id):
- """Waits for a resource to be deleted"""
+ """Waits for a resource to be deleted."""
start_time = int(time.time())
while True:
if self.is_resource_deleted(id):
diff --git a/tempest/common/ssh.py b/tempest/common/ssh.py
index 1b40ddc..151060f 100644
--- a/tempest/common/ssh.py
+++ b/tempest/common/ssh.py
@@ -48,7 +48,7 @@
self.buf_size = 1024
def _get_ssh_connection(self):
- """Returns an ssh connection to the specified host"""
+ """Returns an ssh connection to the specified host."""
_timeout = True
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(
@@ -79,7 +79,7 @@
return (time.time() - timeout) > start_time
def connect_until_closed(self):
- """Connect to the server and wait until connection is lost"""
+ """Connect to the server and wait until connection is lost."""
try:
ssh = self._get_ssh_connection()
_transport = ssh.get_transport()
@@ -137,7 +137,7 @@
return ''.join(out_data)
def test_connection_auth(self):
- """ Returns true if ssh can connect to server"""
+ """Returns true if ssh can connect to server."""
try:
connection = self._get_ssh_connection()
connection.close()
diff --git a/tempest/common/utils/data_utils.py b/tempest/common/utils/data_utils.py
index 951fb61..3a7661c 100644
--- a/tempest/common/utils/data_utils.py
+++ b/tempest/common/utils/data_utils.py
@@ -29,7 +29,7 @@
def build_url(host, port, api_version=None, path=None,
params=None, use_ssl=False):
- """Build the request URL from given host, port, path and parameters"""
+ """Build the request URL from given host, port, path and parameters."""
pattern = 'v\d\.\d'
if re.match(pattern, path):
@@ -59,7 +59,7 @@
def parse_image_id(image_ref):
- """Return the image id from a given image ref"""
+ """Return the image id from a given image ref."""
return image_ref.rsplit('/')[-1]
diff --git a/tempest/config.py b/tempest/config.py
index 2b0eb70..8233dd5 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -458,7 +458,7 @@
# TODO(jaypipes): Move this to a common utils (not data_utils...)
def singleton(cls):
- """Simple wrapper for classes that should only have a single instance"""
+ """Simple wrapper for classes that should only have a single instance."""
instances = {}
def getinstance():
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index c9e2f95..178c2f2 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -118,7 +118,7 @@
class SSHExecCommandFailed(TempestException):
- ''' Raised when remotely executed command returns nonzero status. '''
+ """Raised when remotely executed command returns nonzero status."""
message = ("Command '%(command)s', exit status: %(exit_status)d, "
"Error:\n%(strerror)s")
diff --git a/tempest/openstack/common/cfg.py b/tempest/openstack/common/cfg.py
index 25667a4..1bbfe6a 100644
--- a/tempest/openstack/common/cfg.py
+++ b/tempest/openstack/common/cfg.py
@@ -1417,7 +1417,7 @@
logger.log(lvl, "=" * 80)
def _sanitize(opt, value):
- """Obfuscate values of options declared secret"""
+ """Obfuscate values of options declared secret."""
return value if not opt.secret else '*' * len(str(value))
for opt_name in sorted(self._opts):
diff --git a/tempest/openstack/common/iniparser.py b/tempest/openstack/common/iniparser.py
index 2412844..b5cb604 100644
--- a/tempest/openstack/common/iniparser.py
+++ b/tempest/openstack/common/iniparser.py
@@ -100,15 +100,15 @@
self._assignment(key, value)
def assignment(self, key, value):
- """Called when a full assignment is parsed"""
+ """Called when a full assignment is parsed."""
raise NotImplementedError()
def new_section(self, section):
- """Called when a new section is started"""
+ """Called when a new section is started."""
raise NotImplementedError()
def comment(self, comment):
- """Called when a comment is parsed"""
+ """Called when a comment is parsed."""
pass
def error_invalid_assignment(self, line):
diff --git a/tempest/services/boto/__init__.py b/tempest/services/boto/__init__.py
index 58a2b37..511d8b3 100644
--- a/tempest/services/boto/__init__.py
+++ b/tempest/services/boto/__init__.py
@@ -73,7 +73,7 @@
boto.config.set("Boto", "num_retries", retries)
def __getattr__(self, name):
- """Automatically creates methods for the allowed methods set"""
+ """Automatically creates methods for the allowed methods set."""
if name in self.ALLOWED_METHODS:
def func(self, *args, **kwargs):
with closing(self.get_connection()) as conn:
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']
diff --git a/tempest/services/compute/xml/flavors_client.py b/tempest/services/compute/xml/flavors_client.py
index 1dc34a5..2a8ad0d 100644
--- a/tempest/services/compute/xml/flavors_client.py
+++ b/tempest/services/compute/xml/flavors_client.py
@@ -86,7 +86,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."""
flavor = Element("flavor",
xmlns=XMLNS_11,
ram=ram,
@@ -105,5 +105,5 @@
return resp, flavor
def delete_flavor(self, flavor_id):
- """Deletes the given flavor"""
+ """Deletes the given flavor."""
return self.delete("flavors/%s" % str(flavor_id), self.headers)
diff --git a/tempest/services/compute/xml/floating_ips_client.py b/tempest/services/compute/xml/floating_ips_client.py
index a0059a8..74b4be2 100644
--- a/tempest/services/compute/xml/floating_ips_client.py
+++ b/tempest/services/compute/xml/floating_ips_client.py
@@ -42,7 +42,7 @@
return json
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)
@@ -52,7 +52,7 @@
return resp, body
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, self.headers)
body = self._parse_floating_ip(etree.fromstring(body))
@@ -61,20 +61,20 @@
return resp, body
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, self.headers)
body = self._parse_floating_ip(etree.fromstring(body))
return resp, body
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, self.headers)
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)
doc = Document()
server = Element("addFloatingIp")
@@ -84,7 +84,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)
doc = Document()
server = Element("removeFloatingIp")
diff --git a/tempest/services/compute/xml/images_client.py b/tempest/services/compute/xml/images_client.py
index efed3fb..1e8b250 100644
--- a/tempest/services/compute/xml/images_client.py
+++ b/tempest/services/compute/xml/images_client.py
@@ -43,7 +43,7 @@
return self._parse_links(node, json)
def _parse_image(self, node):
- """Parses detailed XML image information into dictionary"""
+ """Parses detailed XML image information into dictionary."""
json = xml_to_json(node)
self._parse_links(node, json)
@@ -61,7 +61,7 @@
return json
def _parse_links(self, node, json):
- """Append multiple links under a list"""
+ """Append multiple links under a list."""
# look for links
if 'link' in json:
# remove single link element
@@ -71,7 +71,7 @@
return json
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 = Element('createImage', name=name)
if meta:
@@ -86,7 +86,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)
@@ -96,7 +96,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:
param_list = urllib.urlencode(params)
@@ -108,13 +108,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), self.headers)
body = self._parse_image(etree.fromstring(body))
return resp, body
def delete_image(self, image_id):
- """Deletes the provided image"""
+ """Deletes the provided image."""
return self.delete("images/%s" % str(image_id), self.headers)
def wait_for_image_resp_code(self, image_id, code):
@@ -147,14 +147,14 @@
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),
self.headers)
body = xml_to_json(etree.fromstring(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)
@@ -162,7 +162,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 = Element('metadata', meta)
for k, v in meta:
metadata = Element('meta', key=k)
@@ -176,14 +176,14 @@
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.xml" %
(str(image_id), key), self.headers)
body = xml_to_json(etree.fromstring(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)
@@ -191,7 +191,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,
self.headers))
return resp, body
diff --git a/tempest/services/compute/xml/security_groups_client.py b/tempest/services/compute/xml/security_groups_client.py
index bfd6c7a..ac70f1b 100644
--- a/tempest/services/compute/xml/security_groups_client.py
+++ b/tempest/services/compute/xml/security_groups_client.py
@@ -44,7 +44,7 @@
return json
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:
@@ -55,7 +55,7 @@
return resp, body
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, self.headers)
body = self._parse_body(etree.fromstring(body))
@@ -78,7 +78,7 @@
return resp, body
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), self.headers)
@@ -125,6 +125,6 @@
return resp, body
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), self.headers)
diff --git a/tempest/services/compute/xml/servers_client.py b/tempest/services/compute/xml/servers_client.py
index b33335d..28c38ba 100644
--- a/tempest/services/compute/xml/servers_client.py
+++ b/tempest/services/compute/xml/servers_client.py
@@ -41,7 +41,7 @@
self.service = self.config.compute.catalog_type
def _parse_key_value(self, node):
- """Parse <foo key='key'>value</foo> data into {'key': 'value'}"""
+ """Parse <foo key='key'>value</foo> data into {'key': 'value'}."""
data = {}
for node in node.getchildren():
data[node.get('key')] = node.text
@@ -69,13 +69,13 @@
return json
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), self.headers)
server = self._parse_server(etree.fromstring(body))
return resp, server
def delete_server(self, server_id):
- """Deletes the given server"""
+ """Deletes the given server."""
return self.delete("servers/%s" % str(server_id))
def _parse_array(self, node):
@@ -179,7 +179,7 @@
return resp, server
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())
@@ -202,7 +202,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:
@@ -227,7 +227,7 @@
return {node.get('id'): addrs}
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), self.headers)
networks = {}
@@ -238,7 +238,7 @@
return resp, networks
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),
self.headers)
diff --git a/tempest/services/compute/xml/volumes_extensions_client.py b/tempest/services/compute/xml/volumes_extensions_client.py
index 1e8c738..60ef398 100644
--- a/tempest/services/compute/xml/volumes_extensions_client.py
+++ b/tempest/services/compute/xml/volumes_extensions_client.py
@@ -54,7 +54,7 @@
return vol
def list_volumes(self, params=None):
- """List all the volumes created"""
+ """List all the volumes created."""
url = 'os-volumes'
if params:
@@ -68,7 +68,7 @@
return resp, 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:
@@ -82,7 +82,7 @@
return resp, 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, self.headers, wait=wait)
body = etree.fromstring(body)
@@ -116,11 +116,11 @@
return resp, body
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']
diff --git a/tempest/services/identity/json/admin_client.py b/tempest/services/identity/json/admin_client.py
index 7ea33b5..c4e6c95 100644
--- a/tempest/services/identity/json/admin_client.py
+++ b/tempest/services/identity/json/admin_client.py
@@ -25,7 +25,7 @@
return self._has_admin_extensions
def create_role(self, name):
- """Create a role"""
+ """Create a role."""
post_body = {
'name': name,
}
@@ -52,19 +52,19 @@
return resp, body['tenant']
def delete_role(self, role_id):
- """Delete a role"""
+ """Delete a role."""
resp, body = self.delete('OS-KSADM/roles/%s' % str(role_id))
return resp, body
def list_user_roles(self, tenant_id, user_id):
- """Returns a list of roles assigned to a user for a tenant"""
+ """Returns a list of roles assigned to a user for a tenant."""
url = '/tenants/%s/users/%s/roles' % (tenant_id, user_id)
resp, body = self.get(url)
body = json.loads(body)
return resp, body['roles']
def assign_user_role(self, tenant_id, user_id, role_id):
- """Add roles to a user on a tenant"""
+ """Add roles to a user on a tenant."""
post_body = json.dumps({})
resp, body = self.put('/tenants/%s/users/%s/roles/OS-KSADM/%s' %
(tenant_id, user_id, role_id), post_body,
@@ -73,29 +73,29 @@
return resp, body['role']
def remove_user_role(self, tenant_id, user_id, role_id):
- """Removes a role assignment for a user on a tenant"""
+ """Removes a role assignment for a user on a tenant."""
return self.delete('/tenants/%s/users/%s/roles/OS-KSADM/%s' %
(tenant_id, user_id, role_id))
def delete_tenant(self, tenant_id):
- """Delete a tenant"""
+ """Delete a tenant."""
resp, body = self.delete('tenants/%s' % str(tenant_id))
return resp, body
def get_tenant(self, tenant_id):
- """Get tenant details"""
+ """Get tenant details."""
resp, body = self.get('tenants/%s' % str(tenant_id))
body = json.loads(body)
return resp, body['tenant']
def list_roles(self):
- """Returns roles"""
+ """Returns roles."""
resp, body = self.get('OS-KSADM/roles')
body = json.loads(body)
return resp, body['roles']
def list_tenants(self):
- """Returns tenants"""
+ """Returns tenants."""
resp, body = self.get('tenants')
body = json.loads(body)
return resp, body['tenants']
@@ -108,7 +108,7 @@
raise exceptions.NotFound('No such tenant')
def update_tenant(self, tenant_id, **kwargs):
- """Updates a tenant"""
+ """Updates a tenant."""
resp, body = self.get_tenant(tenant_id)
name = kwargs.get('name', body['name'])
desc = kwargs.get('description', body['description'])
@@ -126,7 +126,7 @@
return resp, body['tenant']
def create_user(self, name, password, tenant_id, email):
- """Create a user"""
+ """Create a user."""
post_body = {
'name': name,
'password': password,
@@ -139,18 +139,18 @@
return resp, body['user']
def delete_user(self, user_id):
- """Delete a user"""
+ """Delete a user."""
resp, body = self.delete("users/%s" % user_id)
return resp, body
def get_users(self):
- """Get the list of users"""
+ """Get the list of users."""
resp, body = self.get("users")
body = json.loads(body)
return resp, body['users']
def enable_disable_user(self, user_id, enabled):
- """Enables or disables a user"""
+ """Enables or disables a user."""
put_body = {
'enabled': enabled
}
@@ -161,12 +161,12 @@
return resp, body
def delete_token(self, token_id):
- """Delete a token"""
+ """Delete a token."""
resp, body = self.delete("tokens/%s" % token_id)
return resp, body
def list_users_for_tenant(self, tenant_id):
- """List users for a Tenant"""
+ """List users for a Tenant."""
resp, body = self.get('/tenants/%s/users' % tenant_id)
body = json.loads(body)
return resp, body['users']
@@ -179,7 +179,7 @@
raise exceptions.NotFound('No such user')
def create_service(self, name, type, **kwargs):
- """Create a service"""
+ """Create a service."""
post_body = {
'name': name,
'type': type,
@@ -191,14 +191,14 @@
return resp, body['OS-KSADM:service']
def get_service(self, service_id):
- """Get Service"""
+ """Get Service."""
url = '/OS-KSADM/services/%s' % service_id
resp, body = self.get(url)
body = json.loads(body)
return resp, body['OS-KSADM:service']
def delete_service(self, service_id):
- """Delete Service"""
+ """Delete Service."""
url = '/OS-KSADM/services/%s' % service_id
return self.delete(url)
diff --git a/tempest/services/identity/xml/admin_client.py b/tempest/services/identity/xml/admin_client.py
index 3a947b6..8448ae0 100644
--- a/tempest/services/identity/xml/admin_client.py
+++ b/tempest/services/identity/xml/admin_client.py
@@ -63,7 +63,7 @@
return self._has_admin_extensions
def create_role(self, name):
- """Create a role"""
+ """Create a role."""
create_role = Element("role", xmlns=XMLNS, name=name)
resp, body = self.post('OS-KSADM/roles', str(Document(create_role)),
self.headers)
@@ -89,55 +89,55 @@
return resp, body
def delete_role(self, role_id):
- """Delete a role"""
+ """Delete a role."""
resp, body = self.delete('OS-KSADM/roles/%s' % str(role_id),
self.headers)
return resp, body
def list_user_roles(self, tenant_id, user_id):
- """Returns a list of roles assigned to a user for a tenant"""
+ """Returns a list of roles assigned to a user for a tenant."""
url = '/tenants/%s/users/%s/roles' % (tenant_id, user_id)
resp, body = self.get(url, self.headers)
body = self._parse_array(etree.fromstring(body))
return resp, body
def assign_user_role(self, tenant_id, user_id, role_id):
- """Add roles to a user on a tenant"""
+ """Add roles to a user on a tenant."""
resp, body = self.put('/tenants/%s/users/%s/roles/OS-KSADM/%s' %
(tenant_id, user_id, role_id), '', self.headers)
body = self._parse_body(etree.fromstring(body))
return resp, body
def remove_user_role(self, tenant_id, user_id, role_id):
- """Removes a role assignment for a user on a tenant"""
+ """Removes a role assignment for a user on a tenant."""
return self.delete('/tenants/%s/users/%s/roles/OS-KSADM/%s' %
(tenant_id, user_id, role_id), self.headers)
def delete_tenant(self, tenant_id):
- """Delete a tenant"""
+ """Delete a tenant."""
resp, body = self.delete('tenants/%s' % str(tenant_id), self.headers)
return resp, body
def get_tenant(self, tenant_id):
- """Get tenant details"""
+ """Get tenant details."""
resp, body = self.get('tenants/%s' % str(tenant_id), self.headers)
body = self._parse_body(etree.fromstring(body))
return resp, body
def list_roles(self):
- """Returns roles"""
+ """Returns roles."""
resp, body = self.get('OS-KSADM/roles', self.headers)
body = self._parse_array(etree.fromstring(body))
return resp, body
def list_tenants(self):
- """Returns tenants"""
+ """Returns tenants."""
resp, body = self.get('tenants', self.headers)
body = self._parse_array(etree.fromstring(body))
return resp, body
def update_tenant(self, tenant_id, **kwargs):
- """Updates a tenant"""
+ """Updates a tenant."""
resp, body = self.get_tenant(tenant_id)
name = kwargs.get('name', body['name'])
desc = kwargs.get('description', body['description'])
@@ -156,7 +156,7 @@
return resp, body
def create_user(self, name, password, tenant_id, email):
- """Create a user"""
+ """Create a user."""
create_user = Element("user",
xmlns=XMLNS,
name=name,
@@ -169,18 +169,18 @@
return resp, body
def delete_user(self, user_id):
- """Delete a user"""
+ """Delete a user."""
resp, body = self.delete("users/%s" % user_id, self.headers)
return resp, body
def get_users(self):
- """Get the list of users"""
+ """Get the list of users."""
resp, body = self.get("users", self.headers)
body = self._parse_array(etree.fromstring(body))
return resp, body
def enable_disable_user(self, user_id, enabled):
- """Enables or disables a user"""
+ """Enables or disables a user."""
enable_user = Element("user", enabled=str(enabled).lower())
resp, body = self.put('users/%s/enabled' % user_id,
str(Document(enable_user)), self.headers)
@@ -188,18 +188,18 @@
return resp, body
def delete_token(self, token_id):
- """Delete a token"""
+ """Delete a token."""
resp, body = self.delete("tokens/%s" % token_id, self.headers)
return resp, body
def list_users_for_tenant(self, tenant_id):
- """List users for a Tenant"""
+ """List users for a Tenant."""
resp, body = self.get('/tenants/%s/users' % tenant_id, self.headers)
body = self._parse_array(etree.fromstring(body))
return resp, body
def create_service(self, name, type, **kwargs):
- """Create a service"""
+ """Create a service."""
OS_KSADM = "http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0"
create_service = Element("service",
xmlns=OS_KSADM,
@@ -213,14 +213,14 @@
return resp, body
def get_service(self, service_id):
- """Get Service"""
+ """Get Service."""
url = '/OS-KSADM/services/%s' % service_id
resp, body = self.get(url, self.headers)
body = self._parse_body(etree.fromstring(body))
return resp, body
def delete_service(self, service_id):
- """Delete Service"""
+ """Delete Service."""
url = '/OS-KSADM/services/%s' % service_id
return self.delete(url, self.headers)
diff --git a/tempest/services/object_storage/account_client.py b/tempest/services/object_storage/account_client.py
index 0ab5cd4..26f8329 100644
--- a/tempest/services/object_storage/account_client.py
+++ b/tempest/services/object_storage/account_client.py
@@ -40,7 +40,7 @@
def create_account_metadata(self, metadata,
metadata_prefix='X-Account-Meta-'):
- """Creates an account metadata entry"""
+ """Creates an account metadata entry."""
headers = {}
for key in metadata:
headers[metadata_prefix + key] = metadata[key]
diff --git a/tempest/services/object_storage/container_client.py b/tempest/services/object_storage/container_client.py
index 6b5342a..7b5efff 100644
--- a/tempest/services/object_storage/container_client.py
+++ b/tempest/services/object_storage/container_client.py
@@ -48,14 +48,14 @@
return resp, body
def delete_container(self, container_name):
- """Deletes the container (if it's empty)"""
+ """Deletes the container (if it's empty)."""
url = str(container_name)
resp, body = self.delete(url)
return resp, body
def update_container_metadata(self, container_name, metadata,
metadata_prefix='X-Container-Meta-'):
- """Updates arbitrary metadata on container"""
+ """Updates arbitrary metadata on container."""
url = str(container_name)
headers = {}
@@ -68,7 +68,7 @@
def delete_container_metadata(self, container_name, metadata,
metadata_prefix='X-Remove-Container-Meta-'):
- """Deletes arbitrary metadata on container"""
+ """Deletes arbitrary metadata on container."""
url = str(container_name)
headers = {}
diff --git a/tempest/services/object_storage/object_client.py b/tempest/services/object_storage/object_client.py
index 0047b50..c05c905 100644
--- a/tempest/services/object_storage/object_client.py
+++ b/tempest/services/object_storage/object_client.py
@@ -30,25 +30,25 @@
self.service = self.config.object_storage.catalog_type
def create_object(self, container, object_name, data):
- """Create storage object"""
+ """Create storage object."""
url = "%s/%s" % (str(container), str(object_name))
resp, body = self.put(url, data, self.headers)
return resp, body
def update_object(self, container, object_name, data):
- """Upload data to replace current storage object"""
+ """Upload data to replace current storage object."""
return create_object(container, object_name, data)
def delete_object(self, container, object_name):
- """Delete storage object"""
+ """Delete storage object."""
url = "%s/%s" % (str(container), str(object_name))
resp, body = self.delete(url)
return resp, body
def update_object_metadata(self, container, object_name, metadata,
metadata_prefix='X-Object-Meta-'):
- """Add, remove, or change X-Object-Meta metadata for storage object"""
+ """Add, remove, or change X-Object-Meta metadata for storage object."""
headers = {}
for key in metadata:
@@ -59,7 +59,7 @@
return resp, body
def list_object_metadata(self, container, object_name):
- """List all storage object X-Object-Meta- metadata"""
+ """List all storage object X-Object-Meta- metadata."""
url = "%s/%s" % (str(container), str(object_name))
resp, body = self.head(url)
@@ -74,7 +74,7 @@
def copy_object_in_same_container(self, container, src_object_name,
dest_object_name, metadata=None):
- """Copy storage object's data to the new object using PUT"""
+ """Copy storage object's data to the new object using PUT."""
url = "{0}/{1}".format(container, dest_object_name)
headers = {}
@@ -91,7 +91,7 @@
def copy_object_across_containers(self, src_container, src_object_name,
dst_container, dst_object_name,
metadata=None):
- """Copy storage object's data to the new object using PUT"""
+ """Copy storage object's data to the new object using PUT."""
url = "{0}/{1}".format(dst_container, dst_object_name)
headers = {}
@@ -107,7 +107,7 @@
def copy_object_2d_way(self, container, src_object_name, dest_object_name,
metadata=None):
- """Copy storage object's data to the new object using COPY"""
+ """Copy storage object's data to the new object using COPY."""
url = "{0}/{1}".format(container, src_object_name)
headers = {}
@@ -161,7 +161,7 @@
return resp, body
def create_object(self, container, object_name, data, metadata=None):
- """Create storage object"""
+ """Create storage object."""
headers = {}
if metadata:
@@ -173,7 +173,7 @@
return resp, body
def delete_object(self, container, object_name):
- """Delete storage object"""
+ """Delete storage object."""
url = "%s/%s" % (str(container), str(object_name))
resp, body = self.delete(url)
diff --git a/tempest/services/volume/json/admin/volume_types_client.py b/tempest/services/volume/json/admin/volume_types_client.py
index fc8897f..0cadcb5 100644
--- a/tempest/services/volume/json/admin/volume_types_client.py
+++ b/tempest/services/volume/json/admin/volume_types_client.py
@@ -35,7 +35,7 @@
self.build_timeout = self.config.volume.build_timeout
def list_volume_types(self, params=None):
- """List all the volume_types created"""
+ """List all the volume_types created."""
url = 'types'
if params is not None:
url += '?%s' % urllib.urlencode(params)
@@ -45,7 +45,7 @@
return resp, body['volume_types']
def get_volume_type(self, volume_id):
- """Returns the details of a single volume_type"""
+ """Returns the details of a single volume_type."""
url = "types/%s" % str(volume_id)
resp, body = self.get(url)
body = json.loads(body)
@@ -69,11 +69,11 @@
return resp, body['volume_type']
def delete_volume_type(self, volume_id):
- """Deletes the Specified Volume_type"""
+ """Deletes the Specified Volume_type."""
return self.delete("types/%s" % str(volume_id))
def list_volume_types_extra_specs(self, vol_type_id, params=None):
- """List all the volume_types extra specs created"""
+ """List all the volume_types extra specs created."""
url = 'types/%s/extra_specs' % str(vol_type_id)
if params is not None:
url += '?%s' % urllib.urlencode(params)
@@ -83,7 +83,7 @@
return resp, body['extra_specs']
def get_volume_type_extra_specs(self, vol_type_id, extra_spec_name):
- """Returns the details of a single volume_type extra spec"""
+ """Returns the details of a single volume_type extra spec."""
url = "types/%s/extra_specs/%s" % (str(vol_type_id),
str(extra_spec_name))
resp, body = self.get(url)
@@ -103,7 +103,7 @@
return resp, body['extra_specs']
def delete_volume_type_extra_specs(self, vol_id, extra_spec_name):
- """Deletes the Specified Volume_type extra spec"""
+ """Deletes the Specified Volume_type extra spec."""
return self.delete("types/%s/extra_specs/%s" % ((str(vol_id)),
str(extra_spec_name)))
diff --git a/tempest/services/volume/json/volumes_client.py b/tempest/services/volume/json/volumes_client.py
index 962fe72..cc5a115 100644
--- a/tempest/services/volume/json/volumes_client.py
+++ b/tempest/services/volume/json/volumes_client.py
@@ -37,7 +37,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 = 'volumes'
if params:
url += '?%s' % urllib.urlencode(params)
@@ -47,7 +47,7 @@
return resp, body['volumes']
def list_volumes_with_detail(self, params=None):
- """List the details of all volumes"""
+ """List the details of all volumes."""
url = 'volumes/detail'
if params:
url += '?%s' % urllib.urlencode(params)
@@ -57,7 +57,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 = "volumes/%s" % str(volume_id)
resp, body = self.get(url, wait=wait)
body = json.loads(body)
@@ -85,11 +85,11 @@
return resp, body['volume']
def delete_volume(self, volume_id):
- """Deletes the Specified Volume"""
+ """Deletes the Specified Volume."""
return self.delete("volumes/%s" % str(volume_id))
def attach_volume(self, volume_id, instance_uuid, mountpoint):
- """Attaches a volume to a given instance on a given mountpoint"""
+ """Attaches a volume to a given instance on a given mountpoint."""
post_body = {
'instance_uuid': instance_uuid,
'mountpoint': mountpoint,
@@ -100,7 +100,7 @@
return resp, body
def detach_volume(self, volume_id):
- """Detaches a volume from an instance"""
+ """Detaches a volume from an instance."""
post_body = {}
post_body = json.dumps({'os-detach': post_body})
url = 'volumes/%s/action' % (volume_id)
@@ -108,7 +108,7 @@
return resp, body
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['display_name']
volume_status = body['status']
diff --git a/tempest/services/volume/xml/admin/volume_types_client.py b/tempest/services/volume/xml/admin/volume_types_client.py
index 3da1af0..74d4631 100644
--- a/tempest/services/volume/xml/admin/volume_types_client.py
+++ b/tempest/services/volume/xml/admin/volume_types_client.py
@@ -67,7 +67,7 @@
return extra_spec
def list_volume_types(self, params=None):
- """List all the volume_types created"""
+ """List all the volume_types created."""
url = 'types'
if params:
url += '?%s' % urllib.urlencode(params)
@@ -81,7 +81,7 @@
return resp, volume_types
def get_volume_type(self, type_id):
- """Returns the details of a single volume_type"""
+ """Returns the details of a single volume_type."""
url = "types/%s" % str(type_id)
resp, body = self.get(url, self.headers)
body = etree.fromstring(body)
@@ -114,11 +114,11 @@
return resp, body
def delete_volume_type(self, type_id):
- """Deletes the Specified Volume_type"""
+ """Deletes the Specified Volume_type."""
return self.delete("types/%s" % str(type_id))
def list_volume_types_extra_specs(self, vol_type_id, params=None):
- """List all the volume_types extra specs created"""
+ """List all the volume_types extra specs created."""
url = 'types/%s/extra_specs' % str(vol_type_id)
if params:
@@ -133,7 +133,7 @@
return resp, extra_specs
def get_volume_type_extra_specs(self, vol_type_id, extra_spec_name):
- """Returns the details of a single volume_type extra spec"""
+ """Returns the details of a single volume_type extra spec."""
url = "types/%s/extra_specs/%s" % (str(vol_type_id),
str(extra_spec_name))
resp, body = self.get(url, self.headers)
@@ -161,7 +161,7 @@
return resp, body
def delete_volume_type_extra_specs(self, vol_id, extra_spec_name):
- """Deletes the Specified Volume_type extra spec"""
+ """Deletes the Specified Volume_type extra spec."""
return self.delete("types/%s/extra_specs/%s" % ((str(vol_id)),
str(extra_spec_name)))
diff --git a/tempest/services/volume/xml/volumes_client.py b/tempest/services/volume/xml/volumes_client.py
index 91d0fc7..b0104e0 100644
--- a/tempest/services/volume/xml/volumes_client.py
+++ b/tempest/services/volume/xml/volumes_client.py
@@ -56,7 +56,7 @@
return vol
def list_volumes(self, params=None):
- """List all the volumes created"""
+ """List all the volumes created."""
url = 'volumes'
if params:
@@ -70,7 +70,7 @@
return resp, volumes
def list_volumes_with_detail(self, params=None):
- """List all the details of volumes"""
+ """List all the details of volumes."""
url = 'volumes/detail'
if params:
@@ -84,7 +84,7 @@
return resp, volumes
def get_volume(self, volume_id, wait=None):
- """Returns the details of a single volume"""
+ """Returns the details of a single volume."""
url = "volumes/%s" % str(volume_id)
resp, body = self.get(url, self.headers, wait=wait)
body = etree.fromstring(body)
@@ -116,11 +116,11 @@
return resp, body
def delete_volume(self, volume_id):
- """Deletes the Specified Volume"""
+ """Deletes the Specified Volume."""
return self.delete("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']
diff --git a/tempest/testboto.py b/tempest/testboto.py
index 3a0eb25..c38bf99 100644
--- a/tempest/testboto.py
+++ b/tempest/testboto.py
@@ -122,7 +122,7 @@
class BotoTestCase(unittest.TestCase):
- """Recommended to use as base class for boto related test"""
+ """Recommended to use as base class for boto related test."""
@classmethod
def setUpClass(cls):
# The trash contains cleanup functions and paramaters in tuples
@@ -148,7 +148,7 @@
@classmethod
def cancelResourceCleanUp(cls, key):
- """Cancel Clean up request"""
+ """Cancel Clean up request."""
del cls._resource_trash_bin[key]
#TODO(afazekas): Add "with" context handling
@@ -293,7 +293,7 @@
@classmethod
def destroy_bucket(cls, connection_data, bucket):
- """Destroys the bucket and its content, just for teardown"""
+ """Destroys the bucket and its content, just for teardown."""
exc_num = 0
try:
with closing(boto.connect_s3(**connection_data)) as conn:
@@ -316,7 +316,7 @@
@classmethod
def destroy_reservation(cls, reservation):
- """Terminate instances in a reservation, just for teardown"""
+ """Terminate instances in a reservation, just for teardown."""
exc_num = 0
def _instance_state():
@@ -383,7 +383,7 @@
@classmethod
def destroy_snapshot_wait(cls, snapshot):
- """delete snaphot, wait until not exists"""
+ """delete snaphot, wait until not exists."""
snapshot.delete()
def _update():
diff --git a/tempest/tests/boto/utils/wait.py b/tempest/tests/boto/utils/wait.py
index 951b5bf..77fe037 100644
--- a/tempest/tests/boto/utils/wait.py
+++ b/tempest/tests/boto/utils/wait.py
@@ -62,7 +62,7 @@
def re_search_wait(lfunction, regexp):
- """Stops waiting on success"""
+ """Stops waiting on success."""
start_time = time.time()
while True:
text = lfunction()
@@ -84,7 +84,7 @@
def wait_no_exception(lfunction, exc_class=None, exc_matcher=None):
- """Stops waiting on success"""
+ """Stops waiting on success."""
start_time = time.time()
if exc_matcher is not None:
exc_class = BotoServerError
@@ -114,7 +114,7 @@
#NOTE(afazekas): EC2/boto normally raise exception instead of empty list
def wait_exception(lfunction):
- """Returns with the exception or raises one"""
+ """Returns with the exception or raises one."""
start_time = time.time()
while True:
try:
diff --git a/tempest/tests/compute/base.py b/tempest/tests/compute/base.py
index a79f7f5..e315d78 100644
--- a/tempest/tests/compute/base.py
+++ b/tempest/tests/compute/base.py
@@ -34,7 +34,7 @@
class BaseCompTest(unittest.TestCase):
- """Base test case class for all Compute API tests"""
+ """Base test case class for all Compute API tests."""
@classmethod
def setUpClass(cls):
@@ -179,7 +179,7 @@
@classmethod
def create_server(cls, image_id=None, flavor=None):
- """Wrapper utility that returns a test server"""
+ """Wrapper utility that returns a test server."""
server_name = rand_name(cls.__name__ + "-instance")
if not flavor:
@@ -212,7 +212,7 @@
return resp, server
def wait_for(self, condition):
- """Repeatedly calls condition() until a timeout"""
+ """Repeatedly calls condition() until a timeout."""
start_time = int(time.time())
while True:
try:
@@ -246,7 +246,7 @@
class BaseComputeAdminTest(unittest.TestCase):
- """Base test case class for all Compute Admin API tests"""
+ """Base test case class for all Compute Admin API tests."""
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/images/test_images.py b/tempest/tests/compute/images/test_images.py
index 46c8eee..6ebcbbc 100644
--- a/tempest/tests/compute/images/test_images.py
+++ b/tempest/tests/compute/images/test_images.py
@@ -31,7 +31,7 @@
class ImagesTestBase(object):
def tearDown(self):
- """Terminate test instances created after a test is executed"""
+ """Terminate test instances created after a test is executed."""
for server in self.servers:
resp, body = self.servers_client.delete_server(server['id'])
if resp['status'] == '204':
diff --git a/tempest/tests/compute/images/test_images_whitebox.py b/tempest/tests/compute/images/test_images_whitebox.py
index f409970..2987534 100644
--- a/tempest/tests/compute/images/test_images_whitebox.py
+++ b/tempest/tests/compute/images/test_images_whitebox.py
@@ -36,7 +36,7 @@
@classmethod
def tearDownClass(cls):
- """Terminate test instances created after a test is executed"""
+ """Terminate test instances created after a test is executed."""
for server in cls.servers:
cls.update_state(server['id'], "active", None)
@@ -51,7 +51,7 @@
@classmethod
def update_state(self, server_id, vm_state, task_state, deleted=False):
- """Update states of an instance in database for validation"""
+ """Update states of an instance in database for validation."""
if not task_state:
task_state = "NULL"
@@ -64,7 +64,7 @@
self.connection.execute(stmt, autocommit=True)
def _test_create_image_409_base(self, vm_state, task_state, deleted=False):
- """Base method for create image tests based on vm and task states"""
+ """Base method for create image tests based on vm and task states."""
try:
self.update_state(self.shared_server['id'], vm_state,
task_state, deleted)
diff --git a/tempest/tests/compute/servers/test_servers_whitebox.py b/tempest/tests/compute/servers/test_servers_whitebox.py
index 8aca745..3ff4df6 100644
--- a/tempest/tests/compute/servers/test_servers_whitebox.py
+++ b/tempest/tests/compute/servers/test_servers_whitebox.py
@@ -117,7 +117,7 @@
self.connection.execute(stmt, autocommit=True)
def update_state(self, server_id, vm_state, task_state, deleted=False):
- """Update states of an instance in database for validation"""
+ """Update states of an instance in database for validation."""
if not task_state:
task_state = 'NULL'
diff --git a/tempest/tests/identity/base.py b/tempest/tests/identity/base.py
index 3867f0a..ce160da 100644
--- a/tempest/tests/identity/base.py
+++ b/tempest/tests/identity/base.py
@@ -95,7 +95,7 @@
self.role_name = None
def setup_test_user(self):
- """Set up a test user"""
+ """Set up a test user."""
self.setup_test_tenant()
self.test_user = rand_name('test_user_')
self.test_password = rand_name('pass_')
@@ -107,7 +107,7 @@
self.users.append(self.user)
def setup_test_tenant(self):
- """Set up a test tenant"""
+ """Set up a test tenant."""
self.test_tenant = rand_name('test_tenant_')
self.test_description = rand_name('desc_')
resp, self.tenant = self.client.create_tenant(
@@ -116,7 +116,7 @@
self.tenants.append(self.tenant)
def setup_test_role(self):
- """Set up a test role"""
+ """Set up a test role."""
self.test_role = rand_name('role')
resp, self.role = self.client.create_role(self.test_role)
self.roles.append(self.role)
diff --git a/tempest/tests/network/base.py b/tempest/tests/network/base.py
index f993441..90b351d 100644
--- a/tempest/tests/network/base.py
+++ b/tempest/tests/network/base.py
@@ -48,7 +48,7 @@
cls.client.delete_network(network['id'])
def create_network(self, network_name=None):
- """Wrapper utility that returns a test network"""
+ """Wrapper utility that returns a test network."""
network_name = network_name or rand_name('test-network')
resp, body = self.client.create_network(network_name)
diff --git a/tempest/tests/utils.py b/tempest/tests/utils.py
index 8adaa51..571fc2a 100644
--- a/tempest/tests/utils.py
+++ b/tempest/tests/utils.py
@@ -15,7 +15,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""Common utilities used in testing"""
+"""Common utilities used in testing."""
import nose.plugins.skip
diff --git a/tempest/tests/volume/admin/base.py b/tempest/tests/volume/admin/base.py
index 420da42..81c7c78 100644
--- a/tempest/tests/volume/admin/base.py
+++ b/tempest/tests/volume/admin/base.py
@@ -27,7 +27,7 @@
class BaseVolumeAdminTest(BaseVolumeTest):
- """Base test case class for all Volume Admin API tests"""
+ """Base test case class for all Volume Admin API tests."""
@classmethod
def setUpClass(cls):
super(BaseVolumeAdminTest, cls).setUpClass()
diff --git a/tempest/tests/volume/base.py b/tempest/tests/volume/base.py
index 549f541..8657db8 100644
--- a/tempest/tests/volume/base.py
+++ b/tempest/tests/volume/base.py
@@ -31,7 +31,7 @@
class BaseVolumeTest(unittest.TestCase):
- """Base test case class for all Cinder API tests"""
+ """Base test case class for all Cinder API tests."""
@classmethod
def setUpClass(cls):
@@ -122,7 +122,7 @@
cls.clear_isolated_creds()
def create_volume(self, size=1, metadata={}):
- """Wrapper utility that returns a test volume"""
+ """Wrapper utility that returns a test volume."""
display_name = rand_name(self.__class__.__name__ + "-volume")
cli_resp = self.volumes_client.create_volume(size=size,
display_name=display_name,
@@ -133,7 +133,7 @@
return volume
def wait_for(self, condition):
- """Repeatedly calls condition() until a timeout"""
+ """Repeatedly calls condition() until a timeout."""
start_time = int(time.time())
while True:
try:
diff --git a/tempest/whitebox.py b/tempest/whitebox.py
index 39cd666..d78b9e0 100644
--- a/tempest/whitebox.py
+++ b/tempest/whitebox.py
@@ -106,7 +106,7 @@
@classmethod
def create_server(cls, image_id=None):
- """Wrapper utility that returns a test server"""
+ """Wrapper utility that returns a test server."""
server_name = rand_name(cls.__name__ + "-instance")
flavor = cls.flavor_ref
if not image_id:
@@ -120,7 +120,7 @@
@classmethod
def get_db_handle_and_meta(cls, database='nova'):
- """Return a connection handle and metadata of an OpenStack database"""
+ """Return a connection handle and metadata of an OpenStack database."""
engine_args = {"echo": False,
"convert_unicode": True,
"pool_recycle": 3600
@@ -138,7 +138,7 @@
return connection, meta
def nova_manage(self, category, action, params):
- """Executes nova-manage command for the given action"""
+ """Executes nova-manage command for the given action."""
nova_manage_path = os.path.join(self.compute_bin_dir, 'nova-manage')
cmd = ' '.join([nova_manage_path, category, action, params])
@@ -161,7 +161,7 @@
return result
def get_ssh_connection(self, host, username, password):
- """Create an SSH connection object to a host"""
+ """Create an SSH connection object to a host."""
ssh_timeout = self.config.compute.ssh_timeout
ssh_client = Client(host, username, password, ssh_timeout)
if not ssh_client.test_connection_auth():
diff --git a/tools/hacking.py b/tools/hacking.py
index ec64951..617682d 100755
--- a/tools/hacking.py
+++ b/tools/hacking.py
@@ -273,7 +273,8 @@
T401
"""
pos = max([physical_line.find(i) for i in DOCSTRING_TRIPLE]) # start
- if (pos != -1 and len(physical_line) > pos + 1):
+ end = max([physical_line[-4:-1] == i for i in DOCSTRING_TRIPLE]) # end
+ if (pos != -1 and end and len(physical_line) > pos + 4):
if (physical_line[pos + 3] == ' '):
return (pos, "T401: one line docstring should not start"
" with a space")
diff --git a/tox.ini b/tox.ini
index da3f5cf..da1672b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -15,4 +15,4 @@
[testenv:pep8]
deps = pep8==1.3.3
-commands = python tools/hacking.py --ignore=T401,T402,E122,E125,E126 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack,*egg .
+commands = python tools/hacking.py --ignore=E122,E125,E126 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack,*egg .