client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py | 14 +++++++++++++
1 file changed, 14 insertions(+)
New commits:
commit 11ecc40fb2f8bbacbbd273b652fb84337d0e3a9d
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Tue Nov 29 18:36:34 2011 +0100
IPv6: routines to determine IPv6 address/netmask
diff --git a/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py
b/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py
index 5dc8a7f..281e594 100644
--- a/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py
+++ b/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py
@@ -48,9 +48,23 @@ def find_host_name():
def find_netmask(device):
return execute("LANG=C ifconfig %s | perl -lne '/Mask:([\d.]+)/ and print
$1'" % device)[0]
+def find_netmask6(device):
+ nm6 = execute("LANG=C ifconfig %s | perl -lne '/inet6 addr:
[[:xdigit:]:]+\/([\d]+).+Scope:Global/ and print $1'" % device)
+ if nm6:
+ return nm6[0]
+ else:
+ return ""
+
def find_ip(device):
return execute("LANG=C ifconfig %s | perl -lne '/inet addr:([\d.]+)/ and
print $1'" % device)[0]
+def find_ip6(device):
+ ip6 = execute("LANG=C ifconfig %s | perl -lne '/inet6 addr:
([[:xdigit:]:]+).+Scope:Global/ and print $1'" % device)
+ if ip6:
+ return ip6[0]
+ else:
+ return ""
+
def find_name_servers():
servers = execute("cat /etc/resolv.conf | perl -lne '/^nameserver\s+(\S+)/
and print $1'")
ret = []
Show replies by thread