Change in vdsm[master]: network: add 'default_route' parameter to DhcpClient

2015-07-23 Thread automation
automat...@ovirt.org has posted comments on this change.

Change subject: network: add 'default_route' parameter to DhcpClient
..


Patch Set 4:

* Update tracker::IGNORE, no Bug-Url found
* Set MODIFIED::IGNORE, no Bug-Url found.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4c3a7c5598f2a7b10670415714d980113bc72ae
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: network: add 'default_route' parameter to DhcpClient

2015-07-23 Thread danken
Dan Kenigsberg has submitted this change and it was merged.

Change subject: network: add 'default_route' parameter to DhcpClient
..


network: add 'default_route' parameter to DhcpClient

Non-ifcfg configurators handle 'default_route' option only with
static IPs, but this should be allowed with dynamic as well (as it
is done in ifcfg). Ifcfg configurator uses default_route=False
by default and adds line 'DEFROUTE=no' to ifcfg script, to prevent
default gateway overwriting.

This patch enhances DhcpClient so it is able (and it does it by
default) to disable standard default gateway overwriting.

This new feature fixed AddDelDhcp test with Iproute2 configurator
which used to destroy internet connectivity. It will be also used
in following OVS hook and Iproute2 default_route option patches.

Change-Id: Ia4c3a7c5598f2a7b10670415714d980113bc72ae
Signed-off-by: Petr Horáček 
Reviewed-on: https://gerrit.ovirt.org/43900
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg 
---
M vdsm/network/configurators/__init__.py
M vdsm/network/configurators/dhclient.py
2 files changed, 8 insertions(+), 3 deletions(-)

Approvals:
  Jenkins CI: Passed CI tests
  Petr Horáček: Verified
  Dan Kenigsberg: Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia4c3a7c5598f2a7b10670415714d980113bc72ae
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: automat...@ovirt.org
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: network: add 'default_route' parameter to DhcpClient

2015-07-23 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: network: add 'default_route' parameter to DhcpClient
..


Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4c3a7c5598f2a7b10670415714d980113bc72ae
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: network: add 'default_route' parameter to DhcpClient

2015-07-23 Thread automation
automat...@ovirt.org has posted comments on this change.

Change subject: network: add 'default_route' parameter to DhcpClient
..


Patch Set 3:

* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 
'ovirt-3.4', 'ovirt-3.3'])

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4c3a7c5598f2a7b10670415714d980113bc72ae
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: network: add 'default_route' parameter to DhcpClient

2015-07-22 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: network: add 'default_route' parameter to DhcpClient
..


Patch Set 2: Code-Review-1

sounds great!

However, do initscripts use -e DEFROUTE=no ? could you mention how ifcfg works 
fine?

Also, I think that you should expose the new arg on runDhclient, and pass 
defaultRoute into it.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4c3a7c5598f2a7b10670415714d980113bc72ae
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: network: add 'default_route' parameter to DhcpClient

2015-07-22 Thread phoracek
Petr Horáček has posted comments on this change.

Change subject: network: add 'default_route' parameter to DhcpClient
..


Patch Set 2:

Proper formated output:
http://fpaste.org/246917/57379814/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4c3a7c5598f2a7b10670415714d980113bc72ae
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: network: add 'default_route' parameter to DhcpClient

2015-07-22 Thread phoracek
Petr Horáček has posted comments on this change.

Change subject: network: add 'default_route' parameter to DhcpClient
..


Patch Set 2: Verified+1

testSetupNetworksAddDelDhcp passed with Iproute2 configurator without loosing
internet connectivity. We don't have to verify this with ifcfg while it's
used only in Pyroute and Iproute.

Default gw is not overwritten with DhcpClient('iface', default_route=False):

> import sys
> import time
> 
> sys.path.append('/root/vdsm/lib')
> sys.path.append('/root/vdsm/vdsm')
> from network.configurators.dhclient import DhcpClient
> 
> # prepare veth pair and run dnsmasq
> !ip link add name veth_l type veth peer name veth_r
> !ip -4 addr add dev veth_l 240.0.0.1/24
> !ip link set dev veth_l up
> !dnsmasq --dhcp-authoritative -p 0 --dhcp-range=240.0.0.10,240.0.0.100,2m \
|   --dhcp-option=3,240.0.0.254 --dhcp-option=6 -i veth_l -I lo --bind-dynamic \
|   --dhcp-range=fdb3:84e5:4ff4:55e3::a,fdb3:84e5:4ff4:55e3::64,2m &
> 
> # setup bridge
> !brctl addbr br0
> !brctl addif br0 veth_r
> !ip link set veth_r up
> !ip link set br0 up
> 
> # start dhclient with DEFROUTE=no
> c = DhcpClient('br0', default_route=False)
> c.start(False)
> time.sleep(10)
> !route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric RefUse Iface
0.0.0.0 192.168.122.1   0.0.0.0 UG0  00 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002   00 eth0
192.168.122.0   0.0.0.0 255.255.255.0   U 0  00 eth0
240.0.0.0   0.0.0.0 255.255.255.0   U 0  00 veth_l
240.0.0.0   0.0.0.0 255.255.255.0   U 0  00 br0
> c.shutdown()
> 
> # start dhclient with DEFROUTE=yes
> c = DhcpClient('br0', default_route=True)
> c.start(False)
> time.sleep(10)
> !route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric RefUse Iface
0.0.0.0 240.0.0.254 0.0.0.0 UG0  00 br0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002   00 eth0
192.168.122.0   0.0.0.0 255.255.255.0   U 0  00 eth0
240.0.0.0   0.0.0.0 255.255.255.0   U 0  00 veth_l
240.0.0.0   0.0.0.0 255.255.255.0   U 0  00 br0
> c.shutdown()

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4c3a7c5598f2a7b10670415714d980113bc72ae
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: network: add 'default_route' parameter to DhcpClient

2015-07-22 Thread automation
automat...@ovirt.org has posted comments on this change.

Change subject: network: add 'default_route' parameter to DhcpClient
..


Patch Set 2:

* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 
'ovirt-3.4', 'ovirt-3.3'])

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4c3a7c5598f2a7b10670415714d980113bc72ae
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: network: add 'default_route' parameter to DhcpClient

2015-07-22 Thread automation
automat...@ovirt.org has posted comments on this change.

Change subject: network: add 'default_route' parameter to DhcpClient
..


Patch Set 1:

* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 
'ovirt-3.4', 'ovirt-3.3'])

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4c3a7c5598f2a7b10670415714d980113bc72ae
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: network: add 'default_route' parameter to DhcpClient

2015-07-22 Thread phoracek
Petr Horáček has uploaded a new change for review.

Change subject: network: add 'default_route' parameter to DhcpClient
..

network: add 'default_route' parameter to DhcpClient

Non-ifcfg configurators handle 'default_route' option only with
static IPs, but this should be allowed with dynamic as well.

This patch enhances DhcpClient so it is able to disable standard
default gateway overwriting.

Change-Id: Ia4c3a7c5598f2a7b10670415714d980113bc72ae
Signed-off-by: Petr Horáček 
---
M vdsm/network/configurators/dhclient.py
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/43900/1

diff --git a/vdsm/network/configurators/dhclient.py 
b/vdsm/network/configurators/dhclient.py
index d71b5ff..222d902 100644
--- a/vdsm/network/configurators/dhclient.py
+++ b/vdsm/network/configurators/dhclient.py
@@ -42,9 +42,11 @@
 LEASE_FILE = os.path.join(LEASE_DIR, 'dhclient{0}--{1}.lease')
 DHCLIENT = CommandPath('dhclient', '/sbin/dhclient')
 
-def __init__(self, iface, family=4, cgroup=DHCLIENT_CGROUP):
+def __init__(self, iface, family=4, default_route=True,
+ cgroup=DHCLIENT_CGROUP):
 self.iface = iface
 self.family = family
+self.default_route = default_route
 self.pidFile = self.PID_FILE % (family, self.iface)
 if not os.path.exists(self.LEASE_DIR):
 os.mkdir(self.LEASE_DIR)
@@ -58,6 +60,9 @@
 kill_dhclient(self.iface, self.family)
 cmd = [self.DHCLIENT.cmd, '-%s' % self.family, '-1', '-pf',
self.pidFile, '-lf', self.leaseFile, self.iface]
+if not self.default_route:
+# Instruct Fedora/EL's dhclient-script not to set gateway on iface
+cmd += ['-e', 'DEFROUTE=no']
 cmd = cmdutils.systemd_run(cmd, scope=True, slice=self._cgroup)
 rc, out, err = execCmd(cmd)
 return rc, out, err


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4c3a7c5598f2a7b10670415714d980113bc72ae
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches