Change in vdsm[master]: netinfo: routes_by_dev parameter is never None anyway so _ge...

ibarkan at redhat.com ibarkan at redhat.com
Mon Feb 2 08:19:50 UTC 2015


Ido Barkan has uploaded a new change for review.

Change subject: netinfo: routes_by_dev parameter is never None anyway so _get_gateway can be simpified.
......................................................................

netinfo: routes_by_dev parameter is never None anyway
so _get_gateway can be simpified.

Change-Id: I27c1c97e1b59ab45cc1bb3e7a358021c62c919d2
Signed-off-by: Ido Barkan <ibarkan at redhat.com>
---
M lib/vdsm/netinfo.py
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/37441/1

diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index 0ee8405..0d6250a 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -599,14 +599,12 @@
     return addrs
 
 
-def _get_gateway(routes_by_dev=None, dev=None, family=4,
+def _get_gateway(routes_by_dev, dev=None, family=4,
                  table=nl_route._RT_TABLE_MAIN):
     """Returns the default gateway for a device and an address family"""
     if dev is None:  # get all routes
         routes = nl_route.iter_routes()
     else:  # get only routes for the device
-        if routes_by_dev is None:
-            routes_by_dev = _get_routes()
         routes = routes_by_dev[dev]
 
     gateways = [r for r in routes if r['destination'] == 'none' and


-- 
To view, visit http://gerrit.ovirt.org/37441
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I27c1c97e1b59ab45cc1bb3e7a358021c62c919d2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>


More information about the vdsm-patches mailing list