Change in vdsm[master]: network: Reset a bond's options to defaults before using it
osvoboda at redhat.com
osvoboda at redhat.com
Tue May 20 18:43:12 UTC 2014
Ondřej Svoboda has posted comments on this change.
Change subject: network: Reset a bond's options to defaults before using it
......................................................................
Patch Set 20:
(4 comments)
Renames and comments.
http://gerrit.ovirt.org/#/c/26374/20/vdsm/network/models.py
File vdsm/network/models.py:
Line 190:
Line 191: def __repr__(self):
Line 192: return 'Bond(%s: %r)' % (self.name, self.slaves)
Line 193:
Line 194: def splitOptions(self):
Rename to _getParsedOptions?
Line 195: return [option.split('=', 1) for option in self.options.split()]
Line 196:
Line 197: def revertPreexistingOptsToDefaults(self):
Line 198: """
Line 193:
Line 194: def splitOptions(self):
Line 195: return [option.split('=', 1) for option in self.options.split()]
Line 196:
Line 197: def revertPreexistingOptsToDefaults(self):
Rename to _prepareToResetOptions?
Line 198: """
Line 199: Add default values for those options that were not specified but have
Line 200: non-default values so they are reset first.
Line 201:
Line 214: options.insert(0, ('mode', defaults['mode'][-1]))
Line 215: del currentOpts['mode']
Line 216:
Line 217: for current, value in currentOpts.iteritems():
Line 218: if current not in optionsDict and current in defaults:
'current in defaults' should be true.
Line 219: options.insert(0, (current, defaults[current][-1]))
Line 220: logging.debug('Clearing pre-existing %s option %s=%s',
Line 221: self.name, current, value)
Line 222:
Line 217: for current, value in currentOpts.iteritems():
Line 218: if current not in optionsDict and current in defaults:
Line 219: options.insert(0, (current, defaults[current][-1]))
Line 220: logging.debug('Clearing pre-existing %s option %s=%s',
Line 221: self.name, current, value)
"Pre-existing option %s=%s will be cleared/reset."
Line 222:
Line 223: return ' '.join(('='.join(option) for option in options))
Line 224:
Line 225: def configure(self, **opts):
--
To view, visit http://gerrit.ovirt.org/26374
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I884b7436e12df9dc8572694f886a3c7eb32de200
Gerrit-PatchSet: 20
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: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list