summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Washenberger <mark.washenberger@rackspace.com>2011-03-03 16:31:01 -0500
committerMark Washenberger <mark.washenberger@rackspace.com>2011-03-03 16:31:01 -0500
commit9cfe8ff2e8e66952c3202b852a88ee6fca6fb736 (patch)
treef7a397ad9bd9ee67511cbf301c55c7ac2bab258b
parent668cdc96b3f6fb412b9d1d4a3780744d6b2340b1 (diff)
downloadnova-9cfe8ff2e8e66952c3202b852a88ee6fca6fb736.tar.gz
nova-9cfe8ff2e8e66952c3202b852a88ee6fca6fb736.tar.xz
nova-9cfe8ff2e8e66952c3202b852a88ee6fca6fb736.zip
pep8
-rw-r--r--nova/api/openstack/servers.py9
-rw-r--r--nova/tests/api/openstack/test_servers.py6
2 files changed, 8 insertions, 7 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 73c787828..ea13116fa 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -85,6 +85,7 @@ def _translate_detail_keys(inst):
return dict(server=inst_dict)
+
def _translate_keys(inst):
""" Coerces into dictionary format, excluding all model attributes
save for id and name """
@@ -143,8 +144,8 @@ class Controller(wsgi.Controller):
"""
Create a list of onset files from the personality request attribute
- At this time, onset_files must be formatted as a list of
- (file_path, file_content) pairs for compatibility with the
+ At this time, onset_files must be formatted as a list of
+ (file_path, file_content) pairs for compatibility with the
underlying compute service.
"""
onset_files = []
@@ -157,8 +158,8 @@ class Controller(wsgi.Controller):
try:
contents = base64.b64decode(contents)
except TypeError:
- raise exc.HTTPBadRequest(explanation=
- 'Personality content for %s cannot be decoded' % path)
+ msg = 'Personality content for %s cannot be decoded' % path
+ raise exc.HTTPBadRequest(explanation=msg)
onset_files.append((path, contents))
return onset_files
diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py
index 272d34e3a..53cfa3a6e 100644
--- a/nova/tests/api/openstack/test_servers.py
+++ b/nova/tests/api/openstack/test_servers.py
@@ -287,8 +287,8 @@ class ServersTest(test.TestCase):
request, response, onset_files = \
self._create_instance_with_personality(personality)
self.assertEquals(response.status_int, 200)
- self.assertEquals(onset_files, [(path, contents)])
-
+ self.assertEquals(onset_files, [(path, contents)])
+
def test_create_instance_with_personality_with_non_b64_content(self):
path = '/my/file/path'
contents = '#!/bin/bash\necho "Oh no!"\n'
@@ -320,7 +320,7 @@ class ServersTest(test.TestCase):
request, response, onset_files = \
self._create_instance_with_personality(personality)
self.assertEquals(response.status_int, 200)
- self.assertEquals(onset_files, [(path, contents)])
+ self.assertEquals(onset_files, [(path, contents)])
def test_create_instance_personality_not_a_list(self):
path = '/my/file/path'