Antoni Segura Puimedon has posted comments on this change.

Change subject: vdsm: [WIP] Reboot capability for VM
......................................................................


Patch Set 5: (3 inline comments)

....................................................
File vdsm/vm.py
Line 2354:             message = 'Failed to {0} VM.'
Line 2355:             if not force:
Line 2356:                 message += 'Try forced {0}'
Line 2357:             return {'status': {'code': 
errCode['exist']['status']['code'],
Line 2358:                     'message': message.format(actionName)}}
Is there some reason not to use the % operator instead of format (which is used 
in the rest of the code)?
Line 2359:         message = 'Machine rebooting' if reboot else 'Machine shut 
down'
Line 2360:         return {'status': {'code': doneCode['code'], 'message': 
message}}
Line 2361: 
Line 2362:     def _timedAcpiShutdown(self, reboot, force):


Line 2356:                 message += 'Try forced {0}'
Line 2357:             return {'status': {'code': 
errCode['exist']['status']['code'],
Line 2358:                     'message': message.format(actionName)}}
Line 2359:         message = 'Machine rebooting' if reboot else 'Machine shut 
down'
Line 2360:         return {'status': {'code': doneCode['code'], 'message': 
message}}
I'd rather not have the message variable here, and keep it like 'message': 
'machine rebooting' if reboot else 'Machine shut down'}}
Line 2361: 
Line 2362:     def _timedAcpiShutdown(self, reboot, force):
Line 2363:         self.log.debug('_timedAcpiShutdown Called')
Line 2364:         try:


Line 2375:                 timer.start()
Line 2376:         except:
Line 2377:             self.log.error("_timedAcpiShutdown failed", 
exc_info=True)
Line 2378: 
Line 2379:     def _timedForcedShutdown(self, reboot):
Isn't this the same logic as lines 2341-2345? Couldn't that call this?
Line 2380:         self.log.debug('_timedForcedShutdown Called')
Line 2381:         try:
Line 2382:             if self.lastStatus == 'Down':
Line 2383:                 return


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I12737e363a80679ffb1db55f14eaee158312d7da
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Peter V. Saveliev <[email protected]>
Gerrit-Reviewer: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to