Igor Lvovsky has uploaded a new change for review.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
BZ#846004 - IP on nic/bond should be preserved when VLAN added
Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Signed-off-by: Igor Lvovsky ilvovsky@redhat.com --- M vdsm/configNetwork.py 1 file changed, 9 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/7259/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py index 6faeb9d..7e3379e 100755 --- a/vdsm/configNetwork.py +++ b/vdsm/configNetwork.py @@ -367,9 +367,16 @@ def _createConfFile(self, conf, name, ipaddr=None, netmask=None, gateway=None, bootproto=None, mtu=None, onboot='yes', **kwargs): """ Create ifcfg-* file with proper fields per device """ + cf = self.NET_CONF_PREF + name cfg = """DEVICE=%s\nONBOOT=%s\n""" % (pipes.quote(name), pipes.quote(onboot)) cfg += conf + # Check whether we need to preserve prev ip/mask/gateway + if not ipaddr and os.path.exists(cf): + ipaddr = self._getConfigValue(cf, 'IPADDR') + netmask = self._getConfigValue(cf, 'NETMASK') + gateway = self._getConfigValue(cf, 'GATEWAY') + if ipaddr: cfg = cfg + 'IPADDR=%s\nNETMASK=%s\n' % (pipes.quote(ipaddr), pipes.quote(netmask)) @@ -381,6 +388,7 @@ else: if bootproto: cfg = cfg + 'BOOTPROTO=%s\n' % pipes.quote(bootproto) + if mtu: cfg = cfg + 'MTU=%d\n' % mtu cfg += 'NM_CONTROLLED=no\n' @@ -394,7 +402,7 @@ else: logging.debug('ignoring variable %s', k)
- self.writeConfFile(self.NET_CONF_PREF + name, cfg) + self.writeConfFile(cf, cfg)
def addBridge(self, name, ipaddr=None, netmask=None, mtu=None, gateway=None, bootproto=None, delay='0', onboot='yes', **kwargs):
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/474/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/517/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/520/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
Patch Set 3: I would prefer that you didn't submit this
(2 inline comments)
.................................................... File vdsm/configNetwork.py Line 371: cfg = """DEVICE=%s\nONBOOT=%s\n""" % (pipes.quote(name), Line 372: pipes.quote(onboot)) Line 373: cfg += conf Line 374: # Check whether we need to preserve prev ip/mask/gateway Line 375: if not ipaddr and os.path.exists(cf): it sound like a too-low level to preserve these values... Assume we have an ifcfg-eth0 with IPADDR defined. It would stay there, even if the nic is to be connected to a bridge, and no one wants it to have an IP address of its own. Line 376: ipaddr = self._getConfigValue(cf, 'IPADDR') Line 377: netmask = self._getConfigValue(cf, 'NETMASK') Line 378: gateway = self._getConfigValue(cf, 'GATEWAY') Line 379:
Line 374: # Check whether we need to preserve prev ip/mask/gateway Line 375: if not ipaddr and os.path.exists(cf): Line 376: ipaddr = self._getConfigValue(cf, 'IPADDR') Line 377: netmask = self._getConfigValue(cf, 'NETMASK') Line 378: gateway = self._getConfigValue(cf, 'GATEWAY') btw, why only these params? shouldn't we maintain MTU, too? Line 379: Line 380: if ipaddr: Line 381: cfg = cfg + 'IPADDR=%s\nNETMASK=%s\n' % (pipes.quote(ipaddr), Line 382: pipes.quote(netmask))
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
Patch Set 4:
Build Successful
http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/525/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
Patch Set 4: I would prefer that you didn't submit this
(1 inline comment)
.................................................... File vdsm/configNetwork.py Line 370: cf = self.NET_CONF_PREF + name Line 371: cfg = """DEVICE=%s\nONBOOT=%s\n""" % (pipes.quote(name), Line 372: pipes.quote(onboot)) Line 373: cfg += conf Line 374: # Check whether we need to preserve prev ip/mask/gateway I do not see my main issue related by this version... Line 375: if not ipaddr and os.path.exists(cf): Line 376: ipaddr = self._getConfigValue(cf, 'IPADDR') Line 377: netmask = self._getConfigValue(cf, 'NETMASK') Line 378: gateway = self._getConfigValue(cf, 'GATEWAY')
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
Patch Set 5:
Build Successful
http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/546/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Igor Lvovsky has posted comments on this change.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
Patch Set 6: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 435: if not mtu: Line 436: mtu = confParams.get('MTU', None) Line 437: if mtu: Line 438: mtu = int(mtu) Line 439: Yes, I know that probably we can refactor it to different function, but
1. I don't find proper name for this function ;) 2. anyway ifaceUsers question should stay here 3. return dict and parse it here looks ugly as well 4. It's too late and I am too tired Line 440: self._createConfFile(conf, bonding, ipaddr, netmask, gateway, Line 441: bootproto, mtu, onboot, **kwargs) Line 442: Line 443: # create the bonding device to avoid initscripts noise
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
Patch Set 6:
Build Successful
http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/549/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
Patch Set 6: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
Patch Set 7:
Build Successful
http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/579/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
Patch Set 7: Verified; Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has submitted this change and it was merged.
Change subject: BZ#846004 - IP on nic/bond should be preserved when VLAN added ......................................................................
BZ#846004 - IP on nic/bond should be preserved when VLAN added
Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Signed-off-by: Igor Lvovsky ilvovsky@redhat.com --- M vdsm/configNetwork.py 1 file changed, 24 insertions(+), 0 deletions(-)
Approvals: Dan Kenigsberg: Verified; Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/7259 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I5a6481c64c285b8a9bd6f6cc49c1c84507c91603 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org