Antoni Segura Puimedon has uploaded a new change for review. Change subject: netinfo: drop unused intToAddress ......................................................................
netinfo: drop unused intToAddress Back when we introduced ipwrapper's Route class (commit 9903861228c4b16fa5636f626e7548f8f0d0f41f), we dropped the only usage of netinfo's intToAddress. Since it had a very specific usage, it is safe to drop it. Change-Id: I29bc8467cd25c298221d68d10379a123b2d735e7 Signed-off-by: Antoni S. Puimedon <[email protected]> --- M lib/vdsm/netinfo.py M tests/netinfoTests.py 2 files changed, 0 insertions(+), 18 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/04/29604/1 diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py index 72e0745..82d4a6d 100644 --- a/lib/vdsm/netinfo.py +++ b/lib/vdsm/netinfo.py @@ -390,17 +390,6 @@ return vlan, bonding, nics -def intToAddress(ip_num): - "Convert an integer to the corresponding ip address in the dot-notation" - ip_address = [] - - for i in xrange(4): - ip_num, ip_val = divmod(ip_num, 256) - ip_address.append(str(ip_val)) - - return '.'.join(ip_address) - - def getIfaceCfg(iface): ifaceCfg = {} try: diff --git a/tests/netinfoTests.py b/tests/netinfoTests.py index e8a7399..020ef68 100644 --- a/tests/netinfoTests.py +++ b/tests/netinfoTests.py @@ -69,13 +69,6 @@ self.assertFalse(s < 0) self.assertTrue(s in ETHTOOL_SPEEDS or s == 0) - def testIntToAddress(self): - num = [0, 1, 16777344, 16777408, 4294967295] - ip = ["0.0.0.0", "1.0.0.0", "128.0.0.1", - "192.0.0.1", "255.255.255.255"] - for n, addr in zip(num, ip): - self.assertEqual(addr, netinfo.intToAddress(n)) - @MonkeyPatch(ipwrapper.Link, '_detectType', partial(_fakeTypeDetection, ipwrapper.Link)) @MonkeyPatch(netinfo, 'networks', lambda: {'fake': {'bridged': True}}) -- To view, visit http://gerrit.ovirt.org/29604 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I29bc8467cd25c298221d68d10379a123b2d735e7 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Antoni Segura Puimedon <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
