Change in vdsm[master]: [WIP] Move vm logic to it's own module

2012-08-23 Thread Gerrit Code Review
oVirt Jenkins CI Server has posted comments on this change.

Change subject: [WIP] Move vm logic to it's own module
..


Patch Set 2:

Build Successful 

http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/643/ : SUCCESS

--
To view, visit http://gerrit.ovirt.org/7423
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Icc54c1d0ab7ad535d825dcd72fd2f4583b690f44
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi smizr...@redhat.com
Gerrit-Reviewer: Saggi Mizrahi smizr...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: [WIP] Move vm logic to it's own module

2012-08-22 Thread smizrahi
Saggi Mizrahi has uploaded a new change for review.

Change subject: [WIP] Move vm logic to it's own module
..

[WIP] Move vm logic to it's own module

Change-Id: Icc54c1d0ab7ad535d825dcd72fd2f4583b690f44
Signed-off-by: Saggi Mizrahi smizr...@redhat.com
---
M vdsm/API.py
M vdsm/Makefile.am
M vdsm/clientIF.py
A vdsm/vmContainer.py
4 files changed, 134 insertions(+), 79 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/7423/1

diff --git a/vdsm/API.py b/vdsm/API.py
index e132fb9..818e00c 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -167,34 +167,36 @@
 self.log.error(Error restoring VM parameters,
 exc_info=True)
 
-requiredParams = ['vmId', 'memSize', 'display']
-for param in requiredParams:
+for param in ['vmId', 'memSize', 'display']:
 if param not in vmParams:
-self.log.error('Missing required parameter %s' % (param))
-return {'status': {'code': errCode['MissParam']
-  ['status']['code'],
-   'message': 'Missing required' + \
-   'parameter %s' % (param)}}
+return {'status': {
+'code': errCode['MissParam']['status']['code'],
+'message': 'Missing required parameter %s' % (param,)}
+}
 try:
 storage.misc.validateUUID(vmParams['vmId'])
 except:
-return {'status': {'code': errCode['MissParam']
-  ['status']['code'],
-   'message': 'vmId must be a valid UUID'}}
+return {'status': {
+'code': errCode['MissParam']['status']['code'],
+'message': 'vmId must be a valid UUID'}
+}
 if vmParams['memSize'] == 0:
-return {'status': {'code': errCode['MissParam']
-  ['status']['code'],
-   'message': 'Must specify nonzero memSize'}}
+return {'status': {
+'code': errCode['MissParam']['status']['code'],
+'message': 'Must specify nonzero memSize'}
+}
 
 if vmParams.get('boot') == 'c' and not 'hda' in vmParams \
and not vmParams.get('drives'):
-return {'status': {'code': errCode['MissParam']
-  ['status']['code'],
-   'message': 'missing boot disk'}}
+return {'status': {
+'code': errCode['MissParam']['status']['code'],
+'message': 'missing boot disk'}
+}
 
 if 'vmType' not in vmParams:
 vmParams['vmType'] = 'kvm'
-elif vmParams['vmType'] == 'kvm':
+
+if vmParams['vmType'] == 'kvm':
 if 'kvmEnable' not in vmParams:
 vmParams['kvmEnable'] = 'true'
 
@@ -205,25 +207,27 @@
 vmParams['volatileFloppy'] = True
 
 if caps.osversion()['name'] == caps.OSName.UNKNOWN:
-return {'status': {'code': errCode['createErr']
-  ['status']['code'],
-   'message': 'Unknown host operating system'}}
+return {'status': {
+'code': errCode['createErr']['status']['code'],
+'message': 'Unknown host operating system'}
+}
 
 if 'sysprepInf' in vmParams:
 if not self._createSysprepFloppyFromInf(vmParams['sysprepInf'],
  vmParams['floppy']):
-return {'status': {'code': errCode['createErr']
-  ['status']['code'],
-   'message': 'Failed to create '
-  'sysprep floppy image. '
-  'No space on /tmp?'}}
-return errCode['createErr']
+return {'status': {
+'code': errCode['createErr']['status']['code'],
+'message': 'Failed to create sysprep floppy image. '
+   'No space on /tmp?'}
+}
 
 if vmParams.get('display') not in ('vnc', 'qxl', 'qxlnc', 'local'):
-return {'status': {'code': errCode['createErr']
-  ['status']['code'],
-   

Change in vdsm[master]: [WIP] Move vm logic to it's own module

2012-08-22 Thread Gerrit Code Review
oVirt Jenkins CI Server has posted comments on this change.

Change subject: [WIP] Move vm logic to it's own module
..


Patch Set 1:

Build Successful 

http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/602/ : SUCCESS

--
To view, visit http://gerrit.ovirt.org/7423
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Icc54c1d0ab7ad535d825dcd72fd2f4583b690f44
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi smizr...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches