- try:
- if cdtype is not None:
- out = remctl('control', machine.name, 'create',
- cdtype)
- else:
- out = remctl('control', machine.name, 'create')
- except CodeError, e:
- if 'already running' in e.message:
- raise InvalidInput('action', 'create',
- 'VM %s is already on' % machine.name)
- else:
+ if cdtype is not None:
+ out, err = remctl('control', machine.name, 'create',
+ cdtype, err=True)
+ else:
+ out, err = remctl('control', machine.name, 'create',
+ err=True)
+ if 'already running' in err:
+ raise InvalidInput('action', 'create',
+ 'VM %s is already on' % machine.name)
+ elif err: