From 61adeef4c94eada5182539cf30c55c4b31534bf9 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Fri, 13 Nov 2015 15:09:15 -0500 Subject: pylint openshift_facts --- roles/openshift_facts/library/openshift_facts.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 192c3c4bc..091ba4e2b 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -35,10 +35,8 @@ def first_ip(network): Returns: str: first IPv4 address """ - def atoi(addr): - return struct.unpack("!I", socket.inet_aton(addr))[0] - def itoa(addr): - return socket.inet_ntoa(struct.pack("!I", addr)) + atoi = lambda addr: struct.unpack("!I", socket.inet_aton(addr))[0] + itoa = lambda addr: socket.inet_ntoa(struct.pack("!I", addr)) (address, netmask) = network.split('/') netmask_i = (0xffffffff << (32 - atoi(netmask))) & 0xffffffff -- cgit v1.2.3