Change in vdsm[master]: netinfo, tool: Add a vdsm-tool to determine bonding defaults...

osvoboda at redhat.com osvoboda at redhat.com
Mon Sep 29 10:11:29 UTC 2014


Ondřej Svoboda has posted comments on this change.

Change subject: netinfo, tool: Add a vdsm-tool to determine bonding defaults offline
......................................................................


Patch Set 12:

(3 comments)

Changes on the way.

http://gerrit.ovirt.org/#/c/33403/12/lib/vdsm/netinfo.py
File lib/vdsm/netinfo.py:

Line 408:     Return default options per mode, in a dictionary of dictionaries. All keys
Line 409:     are numeric modes stored as strings for coherence with 'mode' option value.
Line 410:     """
Line 411:     with open(BONDING_DEFAULTS) as defaults:
Line 412:         return json.loads(defaults.read())
> I wonder if we should catch for ENOENT and then run vdsm-tool to create the
The file is preinstalled on purpose. If it is missing for any reason we must crash.
Line 413: 
Line 414: 
Line 415: @memoized
Line 416: def _getDefaultBondingOptions(mode=None):


http://gerrit.ovirt.org/#/c/33403/12/lib/vdsm/tool/dump_bonding_defaults.py
File lib/vdsm/tool/dump_bonding_defaults.py:

Line 1: #! /usr/bin/python
> /usr/bin/env python
Done
Line 2: # Copyright 2014 Red Hat, Inc.
Line 3: #
Line 4: # This program is free software; you can redistribute it and/or modify
Line 5: # it under the terms of the GNU General Public License as published by


Line 81: 
Line 82:     with open(BONDING_DEFAULTS, 'w') as defaults:
Line 83:         defaults.write(json.dumps(_get_default_bonding_options(),
Line 84:                                   sort_keys=True, indent=4,
Line 85:                                   separators=(',', ': ')) + '\n')
> doing write of dumps is an extra step from doing:
If the extra options are supported I'll switch to json.dump
Line 86: 
Line 87: if __name__ == '__main__':


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I89b907ba80f23f417d5e481db9350247445ab772
Gerrit-PatchSet: 12
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list