Clean up pep8 E123 and E124 violations

Fixed E123 and E124 errors.
All ignores are to be removed in the next sequence of patches.

Change-Id: Ie5dc0cd6b0cbdf00f403cb1a039c499a2fca869e
This commit is contained in:
Zhongyue Luo 2012-09-30 23:43:50 +09:00
parent e0884a3021
commit 30a563fc87
12 changed files with 41 additions and 41 deletions

View File

@ -36,7 +36,7 @@ logging.basicConfig(
filename="stress.debug.log",
filemode="w",
level=logging.DEBUG,
)
)
# define a Handler which writes INFO messages or higher to the sys.stdout
_console = logging.StreamHandler()

View File

@ -117,8 +117,7 @@ class VerifyRebootVM(pending_action.PendingServerAction):
self._logger.info('machine %s ACTIVE -> %s' %
(self._target['id'], reboot_state))
self._state.set_instance_state(self._target['id'],
(self._target, reboot_state)
)
(self._target, reboot_state))
self._retry_state = self.States.ACTIVE_CHECK
elif server_state == 'ACTIVE':
# machine must have gone ACTIVE -> REBOOT ->ACTIVE

View File

@ -67,20 +67,19 @@ class TestCreateVM(test_case.StressTestCase):
'metadata': {
'key1': 'value1',
'key2': 'value2',
},
},
'imageRef': _image_ref,
'flavorRef': _flavor_ref,
'adminPass': 'testpwd',
'key_name': _key_name
}
'key_name': _key_name,
}
TestCreateVM._vm_id = TestCreateVM._vm_id + 1
response, body = manager.servers_client.create_server(
expected_server['name'],
_image_ref,
_flavor_ref,
meta=expected_server['metadata'],
adminPass=expected_server['adminPass']
)
create_server = manager.servers_client.create_server
response, body = create_server(expected_server['name'],
_image_ref,
_flavor_ref,
meta=expected_server['metadata'],
adminPass=expected_server['adminPass'])
if (response.status != 202):
self._logger.error("response: %s" % response)

View File

@ -107,12 +107,13 @@ class RestClient(object):
Provides authentication via Keystone
"""
creds = {'auth': {
creds = {
'auth': {
'passwordCredentials': {
'username': user,
'password': password,
},
'tenantName': tenant_name
'tenantName': tenant_name,
}
}

View File

@ -101,7 +101,7 @@ class DefaultClientManager(Manager):
'image_client',
'identity_client',
'network_client',
]
]
def _get_compute_client(self, username=None, password=None,
tenant_name=None):

View File

@ -207,12 +207,13 @@ class TokenClientJSON(RestClient):
self.auth_url = config.identity.auth_url
def auth(self, user, password, tenant):
creds = {'auth': {
creds = {
'auth': {
'passwordCredentials': {
'username': user,
'password': password,
},
'tenantName': tenant
'tenantName': tenant,
}
}
headers = {'Content-Type': 'application/json'}

View File

@ -17,8 +17,8 @@ class NetworkClient(RestClient):
def create_network(self, name, key="network"):
post_body = {
key: {
'name': name
}
'name': name,
}
}
headers = {'Content-Type': 'application/json'}
body = json.dumps(post_body)

View File

@ -44,15 +44,15 @@ class FlavorsClientJSON(RestClient):
swap, rxtx):
"""Creates a new flavor or instance type"""
post_body = {
'name': name,
'ram': ram,
'vcpus': vcpus,
'disk': disk,
'OS-FLV-EXT-DATA:ephemeral': ephemeral,
'id': flavor_id,
'swap': swap,
'rxtx_factor': rxtx
}
'name': name,
'ram': ram,
'vcpus': vcpus,
'disk': disk,
'OS-FLV-EXT-DATA:ephemeral': ephemeral,
'id': flavor_id,
'swap': swap,
'rxtx_factor': rxtx,
}
post_body = json.dumps({'flavor': post_body})
resp, body = self.post('flavors', post_body, self.headers)

View File

@ -335,12 +335,12 @@ class ServersClientJSON(RestClient):
def attach_volume(self, server_id, volume_id, device='/dev/vdz'):
"""Attaches a volume to a server instance"""
post_body = json.dumps(
{'volumeAttachment': {
'volumeId': volume_id,
'device': device,
}
})
post_body = json.dumps({
'volumeAttachment': {
'volumeId': volume_id,
'device': device,
}
})
resp, body = self.post('servers/%s/os-volume_attachments' % server_id,
post_body, self.headers)
return resp, body

View File

@ -61,7 +61,7 @@ class VolumesExtensionsClientJSON(RestClient):
'size': size,
'display_name': kwargs.get('display_name'),
'metadata': kwargs.get('metadata'),
}
}
post_body = json.dumps({'volume': post_body})
resp, body = self.post('os-volumes', post_body, self.headers)

View File

@ -81,7 +81,7 @@ class VolumesClientJSON(RestClient):
'size': size,
'display_name': kwargs.get('display_name'),
'metadata': kwargs.get('metadata'),
}
}
post_body = json.dumps({'volume': post_body})
resp, body = self.post('volumes', post_body, self.headers)
@ -95,9 +95,9 @@ class VolumesClientJSON(RestClient):
def attach_volume(self, volume_id, instance_uuid, mountpoint):
"""Attaches a volume to a given instance on a given mountpoint"""
post_body = {
'instance_uuid': instance_uuid,
'mountpoint': mountpoint
}
'instance_uuid': instance_uuid,
'mountpoint': mountpoint,
}
post_body = json.dumps({'os-attach': post_body})
url = 'volumes/%s/action' % (volume_id)
resp, body = self.post(url, post_body, self.headers)

View File

@ -15,4 +15,4 @@ commands = nosetests {posargs}
[testenv:pep8]
deps = pep8==1.3.3
commands = pep8 --ignore=E121,E122,E123,E124,E125,E126 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack,kong .
commands = pep8 --ignore=E121,E122,E125,E126 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack,kong .