Add means to disable the hostname check for nodes behind NAT.
[bootmanager.git] / source / steps / ReadNodeConfiguration.py
index caef8fe..ec01d64 100644 (file)
@@ -18,6 +18,7 @@ import BootServerRequest
 import BootAPI
 import notify_messages
 import UpdateRunLevelWithPLC
+import ModelOptions
 
 
 # two possible names of the configuration files
@@ -473,7 +474,7 @@ def __parse_configuration_file( vars, log, file_contents ):
         log.write( "Configuration file does not contain the node_id value.\n" )
         log.write( "Querying PLC for node_id.\n" )
 
-        bs_request= BootServerRequest.BootServerRequest()
+        bs_request= BootServerRequest.BootServerRequest(vars)
         
         postVars= {"mac_addr" : INTERFACE_SETTINGS["mac"]}
         result= bs_request.DownloadFile( "%s/getnodeid.php" %
@@ -599,7 +600,8 @@ def __parse_configuration_file( vars, log, file_contents ):
         
     vars["INTERFACE_SETTINGS"]= INTERFACE_SETTINGS
 
-    if not hostname_resolve_ok and not vars['DISCONNECTED_OPERATION']:
+    if (not hostname_resolve_ok and not vars['DISCONNECTED_OPERATION'] and
+        (vars['NODE_MODEL_OPTIONS'] & ModelOptions.NAT) == 0):
         log.write( "Hostname does not resolve correctly, will not continue.\n" )
 
         if can_make_api_call: