Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
gerrit-hooks has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. Patch Set 7: * Update tracker: IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found. -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
Dan Kenigsberg has submitted this change and it was merged. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. net: Introduce iface.exists and start using it in ip.dhclient Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Signed-off-by: Edward Haas Reviewed-on: https://gerrit.ovirt.org/63086 Reviewed-by: Petr Horáček Continuous-Integration: Jenkins CI Reviewed-by: Dan Kenigsberg --- M lib/vdsm/network/ip/dhclient.py M lib/vdsm/network/link/iface.py 2 files changed, 10 insertions(+), 3 deletions(-) Approvals: Jenkins CI: Passed CI tests Petr Horáček: Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved Edward Haas: Verified -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
Dan Kenigsberg has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. Patch Set 6: Code-Review+2 raising score -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
gerrit-hooks has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. Patch Set 6: * 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.6', 'ovirt-4.0']) -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
gerrit-hooks has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. Patch Set 5: * 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.6', 'ovirt-4.0']) -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
Petr Horáček has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
gerrit-hooks has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. Patch Set 4: * 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.6', 'ovirt-4.0']) -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
gerrit-hooks has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. 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.6', 'ovirt-4.0']) -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
Edward Haas has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. Patch Set 2: Verified+1 -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
gerrit-hooks has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. 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.6', 'ovirt-4.0']) -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
Edward Haas has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. Patch Set 1: (2 comments) https://gerrit.ovirt.org/#/c/63086/1/lib/vdsm/network/ip/dhclient.py File lib/vdsm/network/ip/dhclient.py: PS1, Line 31: iface > you've already used the term "linkiface" for this module. let's keep that h Done PS1, Line 48: _ > that's too painful to the eye; you could use dhclient_iface if you really w Done -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
Dan Kenigsberg has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. Patch Set 1: Code-Review-1 (2 comments) https://gerrit.ovirt.org/#/c/63086/1/lib/vdsm/network/ip/dhclient.py File lib/vdsm/network/ip/dhclient.py: PS1, Line 31: iface you've already used the term "linkiface" for this module. let's keep that here, too. PS1, Line 48: _ that's too painful to the eye; you could use dhclient_iface if you really want to rename. -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
Petr Horáček has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
Edward Haas has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. Patch Set 1: Verified+1 -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
gerrit-hooks has posted comments on this change. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. 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.6', 'ovirt-4.0']) -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Introduce iface.exists and start using it in ip.dhclient
Edward Haas has uploaded a new change for review. Change subject: net: Introduce iface.exists and start using it in ip.dhclient .. net: Introduce iface.exists and start using it in ip.dhclient Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Signed-off-by: Edward Haas --- M lib/vdsm/network/ip/dhclient.py M lib/vdsm/network/link/iface.py 2 files changed, 12 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/63086/1 diff --git a/lib/vdsm/network/ip/dhclient.py b/lib/vdsm/network/ip/dhclient.py index 65679d9..c44299f 100644 --- a/lib/vdsm/network/ip/dhclient.py +++ b/lib/vdsm/network/ip/dhclient.py @@ -28,10 +28,10 @@ from vdsm import cmdutils from vdsm.network import errors as ne +from vdsm.network.link import iface from vdsm.commands import execCmd from vdsm.utils import CommandPath, memoized, pgrep, kill_and_rm_pid -NET_PATH = '/sys/class/net' DHCLIENT_BINARY = CommandPath('dhclient', '/sbin/dhclient') DHCLIENT_CGROUP = 'vdsm-dhclient' LEASE_DIR = '/var/lib/dhclient' @@ -45,9 +45,9 @@ 'host-name,nis-domain,nis-servers,ntp-servers,' \ 'interface-mtu' -def __init__(self, iface, family=4, default_route=False, duid_source=None, +def __init__(self, _iface, family=4, default_route=False, duid_source=None, cgroup=DHCLIENT_CGROUP): -self.iface = iface +self.iface = _iface self.family = family self.default_route = default_route self.duid_source_file = None if duid_source is None else ( @@ -60,8 +60,7 @@ self._cgroup = cgroup def _dhclient(self): -# Ask dhclient to stop any dhclient running for the device -if os.path.exists(os.path.join(NET_PATH, self.iface)): +if iface.exists(self.iface): kill(self.iface, self.family) cmd = [DHCLIENT_BINARY.cmd, '-%s' % self.family, '-1', '-pf', self.pidFile, '-lf', self.leaseFile] diff --git a/lib/vdsm/network/link/iface.py b/lib/vdsm/network/link/iface.py index 011d7de..fb821d3 100644 --- a/lib/vdsm/network/link/iface.py +++ b/lib/vdsm/network/link/iface.py @@ -18,6 +18,8 @@ # from __future__ import absolute_import +import os + from vdsm.network import ipwrapper from vdsm.network.netlink import link from vdsm.network.netlink.link import get_link, is_link_up @@ -26,6 +28,8 @@ STATE_UP = 'up' STATE_DOWN = 'down' + +NET_PATH = '/sys/class/net' def up(dev, admin_blocking=True, oper_blocking=False): @@ -62,6 +66,10 @@ return bool(get_link(dev)['flags'] & link.IFF_PROMISC) +def exists(dev): +return os.path.exists(os.path.join(NET_PATH, dev)) + + def _up_blocking(dev, link_blocking): with waitfor_linkup(dev, link_blocking): ipwrapper.linkSet(dev, [STATE_UP]) -- To view, visit https://gerrit.ovirt.org/63086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifcece92726e7ef354b4792aee73bfc90fa5f3133 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org