summaryrefslogtreecommitdiffstats
path: root/cobbler/item_system.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2007-10-10 12:47:52 -0400
committerMichael DeHaan <mdehaan@redhat.com>2007-10-10 12:47:52 -0400
commit4729d6c3acce307fbb15ca8d8ae01affda553da8 (patch)
treeede6446ed00279b10704327c1512ad270eac85bb /cobbler/item_system.py
parent085b157526cd8d23db91e651c1dd4ab3822bb007 (diff)
downloadthird_party-cobbler-4729d6c3acce307fbb15ca8d8ae01affda553da8.tar.gz
third_party-cobbler-4729d6c3acce307fbb15ca8d8ae01affda553da8.tar.xz
third_party-cobbler-4729d6c3acce307fbb15ca8d8ae01affda553da8.zip
Encountered some weird bug presumably related to optimization, so unrolling the command line parser details for now. This can all be fixed should we move the command line parser to use optparse or equivalent in the future.
Diffstat (limited to 'cobbler/item_system.py')
-rw-r--r--cobbler/item_system.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/cobbler/item_system.py b/cobbler/item_system.py
index d8412b3..9f29095 100644
--- a/cobbler/item_system.py
+++ b/cobbler/item_system.py
@@ -90,14 +90,15 @@ class System(item.Item):
# now backfill the interface structure with any old values from
# before the upgrade
- if __hostname != "":
- self.set_hostname(__hostname, "intf0")
- if __mac_address != "":
- self.set_mac_address(__mac_address, "intf0")
- if __ip_address != "":
- self.set_ip_address(__ip_address, "intf0")
- if __dhcp_tag != "":
- self.set_dhcp_tag(__dhcp_tag, "intf0")
+ if not self.interfaces.has_key("intf0"):
+ if __hostname != "":
+ self.set_hostname(__hostname, "intf0")
+ if __mac_address != "":
+ self.set_mac_address(__mac_address, "intf0")
+ if __ip_address != "":
+ self.set_ip_address(__ip_address, "intf0")
+ if __dhcp_tag != "":
+ self.set_dhcp_tag(__dhcp_tag, "intf0")
# backwards compatibility -- convert string entries to dicts for storage
# this allows for better usage from the API.
@@ -148,8 +149,9 @@ class System(item.Item):
intf = self.__get_interface(interface)
if intf["mac_address"] != "":
return intf["mac_address"]
- elif utils.is_mac(self.name) and interface == "intf0":
- return self.name
+ # obsolete, because we should have updated the mac field already with set_name (?)
+ # elif utils.is_mac(self.name) and interface == "intf0":
+ # return self.name
else:
return None
@@ -162,8 +164,8 @@ class System(item.Item):
intf = self.__get_interface(interface)
if intf["ip_address"] != "":
return intf["ip_address"]
- elif utils.is_ip(self.name) and interface == "intf0":
- return self.name
+ #elif utils.is_ip(self.name) and interface == "intf0":
+ # return self.name
else:
return None