remove never used breakpoint
[bootmanager.git] / source / BootManager.py
index e5a448e..f47748d 100755 (executable)
@@ -1,8 +1,5 @@
 #!/usr/bin/python -u
 #
-# $Id$
-# $URL$
-#
 # Copyright (c) 2003 Intel Corporation
 # All rights reserved.
 #
@@ -18,6 +15,7 @@ from steps import *
 from Exceptions import *
 import notify_messages
 import BootServerRequest
+import utils
 
 # all output is written to this file
 BM_NODE_LOG= "/tmp/bm.log"
@@ -112,7 +110,7 @@ class log:
         self.LogEntry( str, 0, 1 )
     
     # bm log uploading is available back again, as of nodeconfig-5.0-2
-    def Upload( self ):
+    def Upload( self, extra_file=None ):
         """
         upload the contents of the log to the server
         """
@@ -144,6 +142,11 @@ class log:
                                        FormData = [('log',(pycurl.FORM_FILE, self.OutputFilePath)),
                                                    ("hostname",hostname),
                                                    ("type","bm.log")])
+        if extra_file is not None:
+            # NOTE: for code-reuse, evoke the bash function 'upload_logs'; 
+            # by adding --login, bash reads .bash_profile before execution.
+            # Also, never fail, since this is an optional feature.
+            utils.sysexec_noerr( """bash --login -c "upload_logs %s" """ % extra_file, self)
 
 
 ##############################
@@ -353,7 +356,7 @@ def main(argv):
     import utils
     utils.prompt_for_breakpoint_mode()
 
-    utils.breakpoint ("Entering BootManager::main")
+#    utils.breakpoint ("Entering BootManager::main")
     
     # set to 1 if error occurred
     error= 0
@@ -362,6 +365,9 @@ def main(argv):
     # the data back to PlanetLab central
     LOG= log( BM_NODE_LOG )
 
+    # NOTE: assume CWD is BM's source directory, but never fail
+    utils.sysexec_noerr("./setup_bash_history_scripts.sh", LOG)
+
     LOG.LogEntry( "BootManager started at: %s" % \
                   time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()) )