Antoni Segura Puimedon has posted comments on this change.
Change subject: hooks: macbind - Attach vm nics to specified bridge
......................................................................
Patch Set 8: Code-Review-1
(3 comments)
http://gerrit.ovirt.org/#/c/17895/8/vdsm_hooks/macbind/before_vm_start.py
File vdsm_hooks/macbind/before_vm_start.py:
Line 35: return os.path.exists('/sys/class/net/%s' % dev)
Line 36:
Line 37:
Line 38: def replaceSourceBridge(domxml, macbindopts, devType=None):
Line 39: for vnicmac in macbindopts:
To make it cleaner please replace this line and the following with:
for vnicmac, vnicdev in macbindopts.iteritems()
Line 40: vnicdev = macbindopts[vnicmac]
Line 41: if devType is None:
Line 42: if isDevice(vnicdev):
Line 43: deviceType = Link._detectType(vnicdev)
Line 42: if isDevice(vnicdev):
Line 43: deviceType = Link._detectType(vnicdev)
Line 44: else:
Line 45: sys.stderr.write(" Invalid device [%s]" % vnicdev)
Line 46: sys.exit(2)
Instead of exiting you should raise an exception that will be caught by main() and be
handled there by lines 106-108
Line 47: else:
Line 48: deviceType = devType
Line 49: if deviceType in _DEV_TYPE:
Line 50: for iface in domxml.getElementsByTagName('interface'):
Line 63: 'type',
Line 64:
'openvswitch'))
Line 65: else:
Line 66: sys.stderr.write(" Invalid device type [%s]" %
deviceType)
Line 67: sys.exit(2)
Instead of exiting you should raise an exception that will be caught by main() and be
handled there by lines 106-108
Line 68:
Line 69:
Line 70: def main():
Line 71: if 'macbind' in os.environ:
--
To view, visit
http://gerrit.ovirt.org/17895
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I0356dfab224a9082b44aae1c66df050f7456301c
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Humble Devassy Chirammal <hchiramm(a)redhat.com>
Gerrit-Reviewer: Amador Pahim <apahim(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Aravinda VK <avishwan(a)redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare(a)redhat.com>
Gerrit-Reviewer: Humble Devassy Chirammal <hchiramm(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes