cobbler/cobbler-koan-rhpl.patch

57 lines
1.8 KiB
Diff

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