Recent Cobbler (as of 741faeafc4782ee66d7d1934a29b107602f1ebe9 in the
Cobbler git tree) only writes dhcpd.conf entries for netboot-enabled
systems. When we mark a system as netboot_enabled, therefore, we need to
also ensure dhcpd is synchronized, and there is a new API for this
purpose.
    
Signed-off-by: Nishanth Aravamudan <n...@us.ibm.com>

diff --git a/server/hosts/install_server.py b/server/hosts/install_server.py
index 5eb4ae3..2c70766 100644
--- a/server/hosts/install_server.py
+++ b/server/hosts/install_server.py
@@ -97,6 +97,14 @@ class CobblerInterface(object):
             # reinstalled)
             self.server.modify_system(system_handle, 'netboot_enabled', 'True',
                                       self.token)
+            try:
+                # Cobbler only generates the DHCP configuration for netboot 
enabled
+                # machines, so we need to synchronize the dhcpd file after 
changing
+                # the value above
+                self.server.sync_dhcp(self.token)
+            except Exception:
+                # implies older Cobbler, where no action is necessary
+                pass
             # Now, let's just restart the machine (machine has to have
             # power management data properly set up).
             self.server.save_system(system_handle, self.token)

-- 
Nishanth Aravamudan <n...@us.ibm.com>
IBM Linux Technology Center

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to