From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Fix vmstorages.py and mockmodel.py to comply with pep8.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
src/kimchi/mockmodel.py | 14 ++++++++------
src/kimchi/model/vmstorages.py | 8 +++++---
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index fb067a8..77f6494 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -669,8 +669,8 @@ class MockModel(object):
dom = self._get_vm(vm_name)
dev = params.get('dev', None)
if dev and dev in self.vmstorages_get_list(vm_name):
- return OperationFailed("KCHVMSTOR0004E", {'dev_name': dev,
- 'vm_name': vm_name})
+ return OperationFailed(
+ "KCHVMSTOR0004E", {'dev_name': dev, 'vm_name':
vm_name})
if not dev:
index = len(dom.storagedevices.keys()) + 1
params['dev'] = "hd" + string.ascii_lowercase[index]
@@ -686,15 +686,17 @@ class MockModel(object):
def vmstorage_lookup(self, vm_name, dev_name):
dom = self._get_vm(vm_name)
if dev_name not in self.vmstorages_get_list(vm_name):
- raise NotFoundError("KCHVMSTOR0007E", {'dev_name':
dev_name,
- 'vm_name': vm_name})
+ raise NotFoundError(
+ "KCHVMSTOR0007E",
+ {'dev_name': dev_name, 'vm_name': vm_name})
return dom.storagedevices.get(dev_name).info
def vmstorage_delete(self, vm_name, dev_name):
dom = self._get_vm(vm_name)
if dev_name not in self.vmstorages_get_list(vm_name):
- raise NotFoundError("KCHVMSTOR0007E", {'dev_name':
dev_name,
- 'vm_name': vm_name})
+ raise NotFoundError(
+ "KCHVMSTOR0007E",
+ {'dev_name': dev_name, 'vm_name': vm_name})
dom.storagedevices.pop(dev_name)
def vmstorage_update(self, vm_name, dev_name, params):
diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py
index 9e2248b..ed8843b 100644
--- a/src/kimchi/model/vmstorages.py
+++ b/src/kimchi/model/vmstorages.py
@@ -126,7 +126,8 @@ class VMStoragesModel(object):
valid_id.remove((bus_id, unit_id))
continue
if not valid_id:
- raise OperationFailed('KCHVMSTOR0014E', {'type':
'ide', 'limit': 4})
+ raise OperationFailed('KCHVMSTOR0014E',
+ {'type': 'ide', 'limit': 4})
else:
address = {'controller': controller_id,
'bus': valid_id[0][0], 'unit': valid_id[0][1]}
@@ -141,8 +142,9 @@ class VMStoragesModel(object):
else:
devices = self.get_list(vm_name)
if dev_name in devices:
- raise OperationFailed('KCHVMSTOR0004E', {'dev_name':
dev_name,
- 'vm_name': vm_name})
+ raise OperationFailed(
+ 'KCHVMSTOR0004E',
+ {'dev_name': dev_name, 'vm_name': vm_name})
# Path will never be blank due to API.json verification.
# There is no need to cover this case here.
--
1.8.3.2