Change in vdsm[master]: hooks: Add convenience functions for JSON hooks

danken at redhat.com danken at redhat.com
Tue Apr 8 21:46:09 UTC 2014


Dan Kenigsberg has posted comments on this change.

Change subject: hooks: Add convenience functions for JSON hooks
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

http://gerrit.ovirt.org/#/c/26521/1/vdsm/hooking.py
File vdsm/hooking.py:

Line 49: tobool
Line 50: 
Line 51: 
Line 52: def read_domxml():
Line 53:     return minidom.parseString(file(os.environ['_hook_domxml']).read())
yes, it has existed here before your patch, but file(path) is on the death row, and should be avoided from new code. Please replace with open() (in a preceding separate patch).

https://docs.python.org/release/3.0/whatsnew/3.0.html#builtins
Line 54: 
Line 55: 
Line 56: def write_domxml(domxml):
Line 57:     file(os.environ['_hook_domxml'], 'w').write(domxml.toxml(encoding='utf-8'))


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I163c09329cd341197251642f9850e131d9e724a2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list