more data stored in verbose mode
[nodemanager.git] / database.py
index c35042a..1985b58 100644 (file)
@@ -36,7 +36,7 @@ MINIMUM_ALLOCATION = {'cpu_pct': 0,
                       }
 LOANABLE_RESOURCES = MINIMUM_ALLOCATION.keys()
 
-DB_FILE = '/var/lib/nodemanager/nodemanager.pickle'
+DB_FILE = '/var/lib/nodemanager/database.pickle'
 
 
 # database object and associated lock
@@ -142,7 +142,7 @@ It may be necessary in the future to do something smarter."""
                     sliver.ensure_created(rec)
                 # Back door to ensure PLC overrides Ticket in delegation.
                 elif rec['instantiation'] == 'delegated' and sliver._get_class() != None:
-                    # if the ticket has been delivered and the nm-contoroller started the slice
+                    # if the ticket has been delivered and the nm-controller started the slice
                     # update rspecs and keep them up to date.
                     if sliver.is_running(): 
                         logger.verbose ("database: sync : ensure_create'ing 'delegated' sliver %s"%name)
@@ -169,8 +169,11 @@ It proceeds to handle dump requests forever."""
             db_pickle = cPickle.dumps(db, cPickle.HIGHEST_PROTOCOL)
             dump_requested = False
             db_lock.release()
-            try: tools.write_file(DB_FILE, lambda f: f.write(db_pickle))
-            except: logger.log_exc("database: failed in database.start.run")
+            try: 
+                tools.write_file(DB_FILE, lambda f: f.write(db_pickle))
+                logger.log_database(db)
+            except: 
+                logger.log_exc("database.start: failed to pickle/dump")
     global db
     try:
         f = open(DB_FILE)
@@ -182,4 +185,5 @@ It proceeds to handle dump requests forever."""
     except:
         logger.log_exc("database: failed in start")
         db = Database()
+    logger.log('database.start')
     tools.as_daemon_thread(run)