summaryrefslogtreecommitdiffstats
path: root/cobbler/utils.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2007-10-08 16:39:41 -0400
committerMichael DeHaan <mdehaan@redhat.com>2007-10-08 16:39:41 -0400
commit0b56b91457c3c6002c12c7cff15a08ce3e695e6a (patch)
tree51e9384ee9d468d7f462f1713686085c7cb62dfc /cobbler/utils.py
parentdd19b31fc9367592dd2e00c02757db05182c1aba (diff)
downloadthird_party-cobbler-0b56b91457c3c6002c12c7cff15a08ce3e695e6a.tar.gz
third_party-cobbler-0b56b91457c3c6002c12c7cff15a08ce3e695e6a.tar.xz
third_party-cobbler-0b56b91457c3c6002c12c7cff15a08ce3e695e6a.zip
More work on the new multi-NIC code. Largely working at this point, sync has
been updated, and backwards compatibility (upgrades) have been tested. Koan still has to be modified and tested, and templating still needs to be tested.
Diffstat (limited to 'cobbler/utils.py')
-rw-r--r--cobbler/utils.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/cobbler/utils.py b/cobbler/utils.py
index a2cefbb..75d895a 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -70,7 +70,7 @@ def get_config_filename(sys,interface=0):
if sys.name == "default":
return "default"
- mac = sys.get_mac_address(nterface)
+ mac = sys.get_mac_address(interface)
ip = sys.get_ip_address(interface)
if mac != None:
return "01-" + "-".join(mac.split(":")).lower()
@@ -316,11 +316,12 @@ def flatten(data):
# make interfaces accessible without Cheetah-voodoo in the templates
# EXAMPLE: $ip == $ip0, $ip1, $ip2 and so on.
counter = 0
- for x in data["interfaces"]:
- data["%s%d" % (x,counter)] = data["interfaces"][x]
- # just to keep templates backwards compatibile
- if counter == 0:
- data[x] = data["interfaces"][x]
+ for interface in data["interfaces"]:
+ for key in interface.keys():
+ data["%s%d" % (key,counter)] = interface[key]
+ # just to keep templates backwards compatibile
+ if counter == 0:
+ data[key] = interface[key]
counter = counter + 1
return data