Change in vdsm[master]: vdsm: hook for booting from an ISO image gathered via http

stirabos at redhat.com stirabos at redhat.com
Mon May 18 22:32:06 UTC 2015


Simone Tiraboschi has posted comments on this change.

Change subject: vdsm: hook for booting from an ISO image gathered via http
......................................................................


Patch Set 2:

(5 comments)

https://gerrit.ovirt.org/#/c/41076/2/vdsm_hooks/httpisoboot/before_vm_start.py
File vdsm_hooks/httpisoboot/before_vm_start.py:

Line 17: 
Line 18: def indexToDiskName(i):
Line 19:     if i < 0 or i >= 4:
Line 20:         return None
Line 21:     return 'hd' + chr(ord('a') + i % 4)
> minor: why not just a map lookup?:
Done
Line 22: 
Line 23: 
Line 24: def increaseDevicesBootOrder(domxml):
Line 25:     xmldisks = domxml.getElementsByTagName('disk')


Line 39:                 except ValueError:
Line 40:                     sys.stderr.write(
Line 41:                         'httpisoboot: unable to manipulate the boot order\n'
Line 42:                     )
Line 43:                     sys.exit(2)
> please replace both statements above with hooking.exit_hook.
Done
Line 44: 
Line 45: 
Line 46: def createHttpIsoElement(domxml, protocol, hostname, port, url_path):
Line 47:     '''


Line 97:             found = True
Line 98:             break
Line 99:     if not found:
Line 100:         sys.stderr.write('httpisoboot: unable to attach another ide cdrom\n')
Line 101:         sys.exit(2)
> same, please exit_hook at the highest possible level
Done
Line 102:     disk.appendChild(target)
Line 103: 
Line 104:     boot = domxml.createElement('boot')
Line 105:     boot.setAttribute('order', '1')


Line 164:             url_path
Line 165:         )
Line 166:         devices.appendChild(diskdev)
Line 167: 
Line 168:         hooking.write_domxml(domxml)
> I'd like to see minimal testing for XML production and boot ordering. Again
Done
Line 169:     except:
Line 170:         sys.stderr.write('httpisoboot: [unexpected error]: %s\n' %
Line 171:                          traceback.format_exc())


Line 168:         hooking.write_domxml(domxml)
Line 169:     except:
Line 170:         sys.stderr.write('httpisoboot: [unexpected error]: %s\n' %
Line 171:                          traceback.format_exc())
Line 172:         sys.exit(2)
> same here, please use exit_hook
Done


-- 
To view, visit https://gerrit.ovirt.org/41076
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I22b190b5d3d43cab7bdbfa81bdf0904b2988b2bc
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Simone Tiraboschi <stirabos at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <mskrivan at redhat.com>
Gerrit-Reviewer: Simone Tiraboschi <stirabos at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list