Change in vdsm[master]: netinfotests: Do not assume the existence of /var/lib/vdsm/b...

danken at redhat.com danken at redhat.com
Fri Oct 3 20:59:43 UTC 2014


Dan Kenigsberg has posted comments on this change.

Change subject: netinfotests: Do not assume the existence of /var/lib/vdsm/bonding-defaults.json
......................................................................


Patch Set 4: Code-Review-1

(1 comment)

http://gerrit.ovirt.org/#/c/33766/4/tests/netinfoTests.py
File tests/netinfoTests.py:

Line 309:         """
Line 310:         try:
Line 311:             with open(netinfo.BONDING_DEFAULTS) as defaults:
Line 312:                 return json.loads(defaults.read())
Line 313:         except:
Accepting a catching-all "except" is a bad practice.

How about

 @MonkeyPatch(netinfo, 'BONDING_DEFAULTS', netinfo.BONDING_DEFAULTS if os.path.exists(etinfo.BONDING_DEFAULTS)  else '../vdsm/bonding-defaults.json')

?
Line 314:             with open('../vdsm/bonding-defaults.json') as defaults:
Line 315:                 return json.loads(defaults.read())
Line 316: 
Line 317:     @MonkeyPatch(netinfo, '_getAllDefaultBondingOptions',


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8ec872739729e11ff9e4a9d30cdac36733d60bae
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda 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