pep8
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user