summaryrefslogtreecommitdiffstats
path: root/roles/openshift_facts
diff options
context:
space:
mode:
authorJason DeTiberus <jdetiber@redhat.com>2015-11-13 15:09:15 -0500
committerJason DeTiberus <jdetiber@redhat.com>2015-11-13 15:09:15 -0500
commit61adeef4c94eada5182539cf30c55c4b31534bf9 (patch)
treeca97424f67b69fde9e82fc4a8007851ea7248654 /roles/openshift_facts
parent133bea98b62718fbc23d3c1f74e22665b5293603 (diff)
downloadopenshift-61adeef4c94eada5182539cf30c55c4b31534bf9.tar.gz
openshift-61adeef4c94eada5182539cf30c55c4b31534bf9.tar.bz2
openshift-61adeef4c94eada5182539cf30c55c4b31534bf9.tar.xz
openshift-61adeef4c94eada5182539cf30c55c4b31534bf9.zip
pylint openshift_facts
Diffstat (limited to 'roles/openshift_facts')
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py6
1 files 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