fix make sync for the current state of the test infra
[bootmanager.git] / source / BootAPI.py
index d69755b..c7d8105 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-
+#
 # Copyright (c) 2003 Intel Corporation
 # All rights reserved.
 #
@@ -14,6 +14,7 @@ import string
 import sha
 import cPickle
 import utils
+import os
 
 from Exceptions import *
 
@@ -69,6 +70,8 @@ def create_auth_structure( vars, call_params ):
                 vars['NODE_SESSION'] = session
                 # NOTE: save session value to /etc/planetlab/session for 
                 # RunlevelAgent and future BootManager runs
+                if not os.path.exists("/etc/planetlab"):
+                    os.makedirs("/etc/planetlab")
                 sessionfile = open('/etc/planetlab/session', 'w')
                 sessionfile.write( vars['NODE_SESSION'] )
                 sessionfile.close()
@@ -79,8 +82,8 @@ def create_auth_structure( vars, call_params ):
             auth = auth_session
 
         except Exception, e:
-            print e
-            pass
+            # NOTE: BM has failed to authenticate utterly.
+            raise BootManagerAuthenticationException, "%s" % e
 
     return auth