Antoni Segura Puimedon has posted comments on this change.

Change subject: WIP watchdog hook
......................................................................


Patch Set 7: (2 inline comments)

....................................................
File vdsm_hooks/watchdog/before_vm_start.py
Line 18:   <watchdog model="i6300esb" action="dump"/>
Line 19: </devices>
Line 20: '''
Line 21: 
Line 22: if 'watchdog' in os.environ:
In Python the generally preferred style would be not to do this 'if'. We would 
just go straight to the try block and then put an Except KeyError. However, to 
avoid reading the domxml if watchdog is not very likely to be in os.environ, it 
would be good as it is.
Line 23:     try:
Line 24:         domxml = hooking.read_domxml()
Line 25: 
Line 26:         watchdog = os.environ['watchdog']


Line 35:         devices.appendChild(watchdog_device)
Line 36: 
Line 37:         hooking.write_domxml(domxml)
Line 38: 
Line 39:     except:
Do you happen to know which kind of exceptions can be expected here? Maybe we 
could add them to have it all as checked exceptions. Or is it just to make sure 
that vm_start doesn't crash on the hook?
Line 40:         sys.stderr.write(


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibc1d21ff8e14013869d78532632e8485f0414793
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Itamar Heim <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Peter V. Saveliev <[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