From: Daniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Date: Wed, 18 Nov 2009 04:25:44 +0000 (+0000)
Subject: Add means to disable the hostname check for nodes behind NAT.
X-Git-Tag: BootManager-4.3-14~4
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e852304a6790c784556eb6cba41bff935037b7b0;p=bootmanager.git

Add means to disable the hostname check for nodes behind NAT.
---

diff --git a/source/ModelOptions.py b/source/ModelOptions.py
index 8c8e979..7c3d08a 100644
--- a/source/ModelOptions.py
+++ b/source/ModelOptions.py
@@ -19,6 +19,7 @@ GEODE   = 0x040
 BADHD   = 0x080
 LAST    = 0x100
 RAWDISK = 0x200
+NAT     = 0x400
 
 modeloptions = {'smp':SMP,
                 'x64':X86_64,
@@ -30,7 +31,8 @@ modeloptions = {'smp':SMP,
                 'geode':GEODE,
                 'badhd':BADHD,
                 'minhw':MINHW,
-                'rawdisk':RAWDISK}
+                'rawdisk':RAWDISK,
+                'nat':NAT}
 
 def Get(model):
     modelinfo = string.split(model,'/')
diff --git a/source/steps/ReadNodeConfiguration.py b/source/steps/ReadNodeConfiguration.py
index e51e9b0..ec01d64 100644
--- a/source/steps/ReadNodeConfiguration.py
+++ b/source/steps/ReadNodeConfiguration.py
@@ -18,6 +18,7 @@ import BootServerRequest
 import BootAPI
 import notify_messages
 import UpdateRunLevelWithPLC
+import ModelOptions
 
 
 # two possible names of the configuration files
@@ -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: