Change in vdsm[master]: Change file() to open() continued
danken at redhat.com
danken at redhat.com
Wed Oct 15 11:38:40 UTC 2014
Dan Kenigsberg has posted comments on this change.
Change subject: Change file() to open() continued
......................................................................
Patch Set 1: Code-Review+2
(2 comments)
http://gerrit.ovirt.org/#/c/33859/1/vdsm/caps.py
File vdsm/caps.py:
Line 489:
Line 490:
Line 491: def _getIscsiIniName():
Line 492: try:
Line 493: with open('/etc/iscsi/initiatorname.iscsi') as f:
> consider avoiding func call inside context:
Why? I don't see the benefit of having the temporary variable.
Line 494: return _parseKeyVal(f)['InitiatorName']
Line 495: except:
Line 496: logging.error('reporting empty InitiatorName', exc_info=True)
Line 497: return ''
http://gerrit.ovirt.org/#/c/33859/1/vdsm/substitute_constants.py
File vdsm/substitute_constants.py:
Line 50: else:
Line 51: f = open(fname, 'w')
Line 52:
Line 53: f.write(r)
Line 54
> Not related to this patch, but close() is missing
right! could you (or Yeela) send a followup patch for this?
--
To view, visit http://gerrit.ovirt.org/33859
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iab7c37fdc18cafa9dfcbd2e9a8fe4f82022dcca0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer at redhat.com>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list