[Kimchi-devel] [PATCH 4/4 - v3] Fix pep8 problems

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Wed Nov 25 06:45:45 UTC 2015


Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
---
 src/wok/plugins/kimchi/model/vms.py           |  6 +++---
 src/wok/plugins/kimchi/tests/test_rest.py     |  3 ++-
 src/wok/plugins/kimchi/tests/test_template.py | 14 ++++++++------
 src/wok/plugins/kimchi/vmtemplate.py          |  4 ++--
 4 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/wok/plugins/kimchi/model/vms.py b/src/wok/plugins/kimchi/model/vms.py
index 7e12b91..366f1b4 100644
--- a/src/wok/plugins/kimchi/model/vms.py
+++ b/src/wok/plugins/kimchi/model/vms.py
@@ -1520,9 +1520,9 @@ class VMModel(object):
     def migration_pre_check(self, remote_host, user, password):
         self._check_if_host_not_localhost(remote_host)
         self._check_if_password_less_login_enabled(
-           remote_host,
-           user,
-           password
+            remote_host,
+            user,
+            password
         )
         self._check_if_migrating_same_arch_hypervisor(remote_host, user)
 
diff --git a/src/wok/plugins/kimchi/tests/test_rest.py b/src/wok/plugins/kimchi/tests/test_rest.py
index 2aabbc0..592162e 100644
--- a/src/wok/plugins/kimchi/tests/test_rest.py
+++ b/src/wok/plugins/kimchi/tests/test_rest.py
@@ -49,7 +49,8 @@ fake_iso = '/tmp/fake.iso'
 
 # Set default test pool, as it is used and checked in every template creation
 osinfo.defaults['disks'][0]['storagepool'] = \
-        '/plugins/kimchi/storagepools/default-pool'
+    '/plugins/kimchi/storagepools/default-pool'
+
 
 def setUpModule():
     global test_server, model, host, port, ssl_port, cherrypy_port
diff --git a/src/wok/plugins/kimchi/tests/test_template.py b/src/wok/plugins/kimchi/tests/test_template.py
index af6352d..e128267 100644
--- a/src/wok/plugins/kimchi/tests/test_template.py
+++ b/src/wok/plugins/kimchi/tests/test_template.py
@@ -222,9 +222,11 @@ class TemplateTests(unittest.TestCase):
 
         # Update disks
         disk_data = {'disks': [{'index': 0, 'size': 10, 'format': 'raw',
-                     'storagepool': DEFAULT_POOL, 'storagepooltype': 'dir'},
+                                'storagepool': DEFAULT_POOL,
+                                'storagepooltype': 'dir'},
                                {'index': 1, 'size': 20, 'format': 'raw',
-                     'storagepool': DEFAULT_POOL, 'storagepooltype': 'dir'}]}
+                                'storagepool': DEFAULT_POOL,
+                                'storagepooltype': 'dir'}]}
         resp = self.request(new_tmpl_uri, json.dumps(disk_data), 'PUT')
         self.assertEquals(200, resp.status)
         resp = self.request(new_tmpl_uri)
@@ -238,8 +240,8 @@ class TemplateTests(unittest.TestCase):
                       'qed', 'raw', 'vmdk', 'vpc']
         for disk_type in disk_types:
             disk_data = {'disks': [{'index': 0, 'format': disk_type,
-                         'size': 10, 'storagepool': DEFAULT_POOL,
-                         'storagepooltype': 'dir'}]}
+                                    'size': 10, 'storagepool': DEFAULT_POOL,
+                                    'storagepooltype': 'dir'}]}
             resp = self.request(new_tmpl_uri, json.dumps(disk_data), 'PUT')
             self.assertEquals(200, resp.status)
 
@@ -359,9 +361,9 @@ class TemplateTests(unittest.TestCase):
                 self.assertEquals(200, resp.status)
 
         # Test disl template update with different pool
+        pool_uri = u'/plugins/kimchi/storagepools/kīмсhīUnitTestDirPool'
         disk_data = {'disks': [{'size': 5, 'format': 'qcow2',
-          'storagepool': u'/plugins/kimchi/storagepools/kīмсhīUnitTestDirPool',
-                     }]}
+                                'storagepool': pool_uri}]}
         req = json.dumps(disk_data)
         resp = self.request('/plugins/kimchi/templates/test', req, 'PUT')
         self.assertEquals(200, resp.status)
diff --git a/src/wok/plugins/kimchi/vmtemplate.py b/src/wok/plugins/kimchi/vmtemplate.py
index 35210a3..746ed2f 100644
--- a/src/wok/plugins/kimchi/vmtemplate.py
+++ b/src/wok/plugins/kimchi/vmtemplate.py
@@ -79,7 +79,7 @@ class VMTemplate(object):
         # Support to create Template with multiple disks
         for i, disk in enumerate(self.info['disks']):
             self.info['disks'][i]['storagepooltype'] = \
-                    self._get_storage_type(disk['storagepool'])
+                self._get_storage_type(disk['storagepool'])
 
         # Merge disks dict
         default_disk = self.info['disks'][0]
@@ -88,7 +88,7 @@ class VMTemplate(object):
             disk['index'] = i
             disk.update(d)
             disk['storagepooltype'] = self._get_storage_type(
-                                      disk['storagepool'])
+                disk['storagepool'])
             # Assign right disk format to logical and [i]scsi storagepools
             if disk['storagepooltype'] in ['logical', 'iscsi', 'scsi']:
                 disk['format'] = 'raw'
-- 
2.1.0




More information about the Kimchi-devel mailing list