From 84d747dd934f1bc3a1bdeab7aafabe171e9eb368 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 5 Oct 2006 15:32:00 -0400 Subject: --pxe-hostname should be "--pxe-address" --- cobbler/action_sync.py | 4 ++-- cobbler/cobbler.py | 2 +- cobbler/item_system.py | 15 +++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) (limited to 'cobbler') diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py index 2b3e23a..c87650f 100644 --- a/cobbler/action_sync.py +++ b/cobbler/action_sync.py @@ -130,8 +130,8 @@ class BootSync: # can't use pxelinux.0 anymore systxt = systxt + " filename \"/%s\";\n" % elilo systxt = systxt + " hardware ethernet %s;\n" % system.name - if system.pxe_hostname != "": - systxt = systxt + " fixed-address %s;\n" % system.pxe_hostname + if system.pxe_address != "": + systxt = systxt + " fixed-address %s;\n" % system.pxe_address systxt = systxt + "}\n" system_definitions = system_definitions + systxt diff --git a/cobbler/cobbler.py b/cobbler/cobbler.py index 198a0d3..8a57a62 100755 --- a/cobbler/cobbler.py +++ b/cobbler/cobbler.py @@ -130,7 +130,7 @@ class BootCLI: '--kopts' : lambda(a) : sys.set_kernel_options(a), '--ksmeta' : lambda(a) : sys.set_ksmeta(a), '--pxe-arch' : lambda(a) : sys.set_pxe_arch(a), - '--pxe-hostname' : lambda(a) : sys.set_pxe_hostname(a) + '--pxe-address' : lambda(a) : sys.set_pxe_address(a) # FIXME: surface a way to pin the IP. } on_ok = lambda: self.api.systems().add(sys) diff --git a/cobbler/item_system.py b/cobbler/item_system.py index 2279c91..7c584b5 100644 --- a/cobbler/item_system.py +++ b/cobbler/item_system.py @@ -28,7 +28,7 @@ class System(item.Item): self.kernel_options = "" self.ks_meta = "" self.pxe_arch = "standard" - self.pxe_hostname = "" + self.pxe_address = "" def from_datastruct(self,seed_data): self.name = seed_data['name'] @@ -36,7 +36,7 @@ class System(item.Item): self.kernel_options = seed_data['kernel_options'] self.ks_meta = seed_data['ks_meta'] self.pxe_arch = seed_data['pxe_arch'] - self.pxe_hostname = seed_data['pxe_hostname'] + self.pxe_address = seed_data['pxe_address'] return self def set_name(self,name): @@ -54,10 +54,9 @@ class System(item.Item): self.name = name # we check it add time, but store the original value. return True - def set_pxe_hostname(self,hostname): - # we allow this to be set to anything - # though we probably should check to see if it looks like a FQDN - self.pxe_hostname = hostname + def set_pxe_address(self,hostname): + # we allow this to be set to anything and should restrict it + self.pxe_address = hostname return True def set_profile(self,profile_name): @@ -103,7 +102,7 @@ class System(item.Item): 'kernel_options' : self.kernel_options, 'ks_meta' : self.ks_meta, 'pxe_arch' : self.pxe_arch, - 'pxe_hostname' : self.pxe_hostname + 'pxe_address' : self.pxe_address } def printable(self,id): @@ -112,6 +111,6 @@ class System(item.Item): buf = buf + "kernel options : %s\n" % self.kernel_options buf = buf + "ks metadata : %s\n" % self.ks_meta buf = buf + "pxe arch : %s\n" % self.pxe_arch - buf = buf + "pxe hostname : %s\n" % self.pxe_hostname + buf = buf + "pxe address : %s\n" % self.pxe_address return buf -- cgit