|
 |
1070a0 |
--- ./koan/app.py 2010-10-18 15:40:34.000000000 +0200
|
|
 |
1070a0 |
+++ ./koan/app.py 2011-01-07 11:47:23.173337611 +0100
|
|
 |
1070a0 |
@@ -382,10 +382,6 @@ class Koan:
|
|
 |
1070a0 |
Determine the name of the cobbler system record that
|
|
 |
1070a0 |
matches this MAC address.
|
|
 |
1070a0 |
"""
|
|
 |
1070a0 |
- try:
|
|
 |
1070a0 |
- import rhpl
|
|
 |
1070a0 |
- except:
|
|
 |
1070a0 |
- raise CX("the rhpl module is required to autodetect a system. Your OS does not have this, please manually specify --profile or --system")
|
|
 |
1070a0 |
systems = self.get_data("systems")
|
|
 |
1070a0 |
my_netinfo = utils.get_network_info()
|
|
 |
1070a0 |
my_interfaces = my_netinfo.keys()
|
|
 |
1070a0 |
--- ./koan/utils.py 2010-10-18 15:40:34.000000000 +0200
|
|
 |
1070a0 |
+++ ./koan/utils.py 2011-01-07 11:47:23.173337611 +0100
|
|
 |
1070a0 |
@@ -383,22 +383,26 @@ def uniqify(lst, purge=None):
|
|
 |
1070a0 |
|
|
 |
1070a0 |
def get_network_info():
|
|
 |
1070a0 |
try:
|
|
 |
1070a0 |
- import rhpl.ethtool
|
|
 |
1070a0 |
+ import ethtool
|
|
 |
1070a0 |
except:
|
|
 |
1070a0 |
- raise InfoException("the rhpl module is required to use this feature (is your OS>=EL3?)")
|
|
 |
1070a0 |
+ try:
|
|
 |
1070a0 |
+ import rhpl.ethtool
|
|
 |
1070a0 |
+ ethtool = rhpl.ethtool
|
|
 |
1070a0 |
+ except:
|
|
 |
1070a0 |
+ raise InfoException("the rhpl or ethtool module is required to use this feature (is your OS>=EL3?)")
|
|
 |
1070a0 |
|
|
 |
1070a0 |
interfaces = {}
|
|
 |
1070a0 |
# get names
|
|
 |
1070a0 |
- inames = rhpl.ethtool.get_devices()
|
|
 |
1070a0 |
+ inames = ethtool.get_devices()
|
|
 |
1070a0 |
|
|
 |
1070a0 |
for iname in inames:
|
|
 |
1070a0 |
- mac = rhpl.ethtool.get_hwaddr(iname)
|
|
 |
1070a0 |
+ mac = ethtool.get_hwaddr(iname)
|
|
 |
1070a0 |
|
|
 |
1070a0 |
if mac == "00:00:00:00:00:00":
|
|
 |
1070a0 |
mac = "?"
|
|
 |
1070a0 |
|
|
 |
1070a0 |
try:
|
|
 |
1070a0 |
- ip = rhpl.ethtool.get_ipaddr(iname)
|
|
 |
1070a0 |
+ ip = ethtool.get_ipaddr(iname)
|
|
 |
1070a0 |
if ip == "127.0.0.1":
|
|
 |
1070a0 |
ip = "?"
|
|
 |
1070a0 |
except:
|
|
 |
1070a0 |
@@ -408,7 +412,7 @@ def get_network_info():
|
|
 |
1070a0 |
module = ""
|
|
 |
1070a0 |
|
|
 |
1070a0 |
try:
|
|
 |
1070a0 |
- nm = rhpl.ethtool.get_netmask(iname)
|
|
 |
1070a0 |
+ nm = ethtool.get_netmask(iname)
|
|
 |
1070a0 |
except:
|
|
 |
1070a0 |
nm = "?"
|
|
 |
1070a0 |
|