Change in vdsm[ovirt-3.6]: network: add ifcfg write hook

ibarkan at redhat.com ibarkan at redhat.com
Mon Sep 21 08:51:48 UTC 2015


Ido Barkan has posted comments on this change.

Change subject: network: add ifcfg write hook
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.ovirt.org/#/c/46372/1/vdsm/network/configurators/ifcfg.py
File vdsm/network/configurators/ifcfg.py:

Line 546:                 logging.debug('ignoring variable %s', k)
Line 547: 
Line 548:         ifcfg_file = netinfo.NET_CONF_PREF + name
Line 549:         hook_dict = _build_ifcfg_write_hook_dict(name,
Line 550:                                                  netinfo.NET_CONF_PREF + name,
> This is before we write the file, so there is no file yet. Instead we pass 
it is still safe because currently you still rebind ifcfg_file 2 statements later so DRY.
Line 551:                                                  cfg)
Line 552:         hook_return = hooks.before_ifcfg_write(hook_dict)
Line 553:         ifcfg_file = hook_return['ifcfg_file']
Line 554:         cfg = hook_return['config']


Line 549:         hook_dict = _build_ifcfg_write_hook_dict(name,
Line 550:                                                  netinfo.NET_CONF_PREF + name,
Line 551:                                                  cfg)
Line 552:         hook_return = hooks.before_ifcfg_write(hook_dict)
Line 553:         ifcfg_file = hook_return['ifcfg_file']
> The asumption is that if the user uses this at his own risk. If one uses th
we cannot support this hook if someone changes the file path. The consequences are undefined
Line 554:         cfg = hook_return['config']
Line 555:         self.writeConfFile(ifcfg_file, cfg)
Line 556: 
Line 557:     def addBridge(self, bridge, **opts):


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2206ccf97b210bd58f03777d4ccd016785b02939
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Marcin Mirecki <mmirecki at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Marcin Mirecki <mmirecki at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list