remove monitorconfig.py on trunk also.
Stephen Soltesz [Wed, 24 Sep 2008 19:28:51 +0000 (19:28 +0000)]
bootman.py
database.py
getconf.py
getsshkeys.py
mailer.py
nodequery.py
prep_power_users.py
rt.py
soltesz.py

index faf77a2..ff2a6d5 100755 (executable)
@@ -24,7 +24,7 @@ from unified_model import *
 from emailTxt import mailtxt
 from nodeconfig import network_config_to_str
 import traceback
-import monitorconfig
+import config
 
 import signal
 class Sopen(subprocess.Popen):
@@ -207,7 +207,7 @@ class PlanetLabSession:
                args['port'] = self.port
                args['user'] = 'root'
                args['hostname'] = self.node
-               args['monitordir'] = monitorconfig.MONITOR_SCRIPT_ROOT
+               args['monitordir'] = config.MONITOR_SCRIPT_ROOT
                ssh_port = 22
 
                if self.nosetup:
index 1173d8a..b9fc10d 100644 (file)
@@ -12,10 +12,9 @@ except:
 import inspect
 import shutil
 import config
-import config as monitorconfig
 
 DEBUG= 0
-PICKLE_PATH=monitorconfig.MONITOR_DATA_ROOT
+PICKLE_PATH=config.MONITOR_DATA_ROOT
 
 
 def dbLoad(name, type=None):
index 205f0ff..721932f 100755 (executable)
@@ -4,7 +4,7 @@ import plc
 api = plc.getAuthAPI()
 import sys
 import os
-import monitorconfig
+import config
 
 def getconf(hostname, force=False, media=None):
        n = api.GetNodes(hostname)
@@ -21,16 +21,16 @@ def getconf(hostname, force=False, media=None):
 
        args = {}
        if not media:
-               args['url_list']  = "   http://%s/bootcds/%s-partition.usb\n" % (monitorconfig.MONITOR_HOSTNAME, hostname)
-               args['url_list'] += "   http://%s/bootcds/%s.iso" % (monitorconfig.MONITOR_HOSTNAME, hostname)
+               args['url_list']  = "   http://%s/bootcds/%s-partition.usb\n" % (config.MONITOR_HOSTNAME, hostname)
+               args['url_list'] += "   http://%s/bootcds/%s.iso" % (config.MONITOR_HOSTNAME, hostname)
        else:
                if media == "usb":
-                       args['url_list']  = "   http://%s/bootcds/%s-partition.usb\n" % (monitorconfig.MONITOR_HOSTNAME, hostname)
+                       args['url_list']  = "   http://%s/bootcds/%s-partition.usb\n" % (config.MONITOR_HOSTNAME, hostname)
                elif media == "iso":
-                       args['url_list']  = "   http://%s/bootcds/%s.iso" % (monitorconfig.MONITOR_HOSTNAME, hostname)
+                       args['url_list']  = "   http://%s/bootcds/%s.iso" % (config.MONITOR_HOSTNAME, hostname)
                else:
-                       args['url_list']  = "   http://%s/bootcds/%s-partition.usb\n" % (monitorconfig.MONITOR_HOSTNAME, hostname)
-                       args['url_list'] += "   http://%s/bootcds/%s.iso" % (monitorconfig.MONITOR_HOSTNAME, hostname)
+                       args['url_list']  = "   http://%s/bootcds/%s-partition.usb\n" % (config.MONITOR_HOSTNAME, hostname)
+                       args['url_list'] += "   http://%s/bootcds/%s.iso" % (config.MONITOR_HOSTNAME, hostname)
                        
 
        return args
index 95df2e6..fbfc65e 100755 (executable)
@@ -6,10 +6,10 @@ import string
 import time
 import xml, xmlrpclib
 try:
-       import monitorconfig
-       auth = {'Username'   : monitorconfig.API_AUTH_USER,
+       import config
+       auth = {'Username'   : config.API_AUTH_USER,
                'AuthMethod' : "password",
-                       'AuthString' : monitorconfig.API_AUTH_PASSWORD}
+                       'AuthString' : config.API_AUTH_PASSWORD}
 except:
        import traceback
        print traceback.print_exc()
index 97bd173..46fdcae 100755 (executable)
--- a/mailer.py
+++ b/mailer.py
@@ -12,7 +12,6 @@ import calendar
 import logging
 import os
 import time
-import monitorconfig
 
 logger = logging.getLogger("monitor")
 
@@ -28,11 +27,11 @@ def reformat_for_rt(text):
                
 
 def _setupRTenvironment():
-       os.environ['PATH'] = os.environ['PATH'] + ":" + monitorconfig.RT_WEB_TOOLS_PATH
-       os.environ['RTSERVER'] = monitorconfig.RT_WEB_SERVER
-       os.environ['RTUSER']   = monitorconfig.RT_WEB_USER
-       os.environ['RTPASSWD'] = monitorconfig.RT_WEB_PASSWORD
-       os.environ['RTDEBUG'] = monitorconfig.RT_WEB_DEBUG
+       os.environ['PATH'] = os.environ['PATH'] + ":" + config.RT_WEB_TOOLS_PATH
+       os.environ['RTSERVER'] = config.RT_WEB_SERVER
+       os.environ['RTUSER']   = config.RT_WEB_USER
+       os.environ['RTPASSWD'] = config.RT_WEB_PASSWORD
+       os.environ['RTDEBUG'] = config.RT_WEB_DEBUG
        return
 
 def setTicketStatus(ticket_id, status):
index e746e5b..16c0bad 100755 (executable)
@@ -46,8 +46,12 @@ def fb_print_nodeinfo(fbnode, hostname, fields=None):
                        fbnode['kernel'] = fbnode['kernel'].split()[2]
                fbnode['boot_state'] = fbnode['plcnode']['boot_state']
 
-               if len(fbnode['nodegroups']) > 0:
-                       fbnode['category'] = fbnode['nodegroups'][0]
+               try:
+                       if len(fbnode['nodegroups']) > 0:
+                               fbnode['category'] = fbnode['nodegroups'][0]
+               except:
+                       #print "ERROR!!!!!!!!!!!!!!!!!!!!!"
+                       pass
 
                print "%(hostname)-45s | %(checked)11.11s | %(boot_state)5.5s| %(state)8.8s | %(ssh)5.5s | %(pcu)6.6s | %(bootcd)6.6s | %(category)8.8s | %(kernel)s" % fbnode
        else:
index 8566a6d..a2c5047 100755 (executable)
@@ -15,9 +15,9 @@ email_list = [ 'monitor@planet-lab.org',
                 # 'vivek@cs.princeton.edu',
                ]
 
-import monitorconfig
-api   = plc.PLC(monitorconfig.API_AUTH, monitorconfig.API_SERVER)
-api06 = plc.PLC(monitorconfig.API_AUTH06, monitorconfig.API_SERVER06)
+import config
+api   = plc.PLC(config.API_AUTH, config.API_SERVER)
+api06 = plc.PLC(config.API_AUTH06, config.API_SERVER06)
 
 
 # add planetlab-15.cs.princeton.edu, and use the key on the CD.
diff --git a/rt.py b/rt.py
index 0ea0a55..8194036 100644 (file)
--- a/rt.py
+++ b/rt.py
@@ -9,7 +9,7 @@ import time
 import re
 import database
 from threading import *
-import monitorconfig
+import config
 
 # TODO: merge the RT mailer from mailer.py into this file.
 
@@ -73,10 +73,10 @@ def open_rt_db():
        #       return -1
 
        try:
-               rt_db = MySQLdb.connect(host=monitorconfig.RT_DB_HOST,
-                                                               user=monitorconfig.RT_DB_USER,
-                                                               passwd=monitorconfig.RT_DB_PASSWORD,
-                                                               db=monitorconfig.RT_DB_NAME)
+               rt_db = MySQLdb.connect(host=config.RT_DB_HOST,
+                                                               user=config.RT_DB_USER,
+                                                               passwd=config.RT_DB_PASSWORD,
+                                                               db=config.RT_DB_NAME)
        except Exception, err:
                print "Failed to connect to RT database: %s" %err
                return -1
index 3f57530..6fc714f 100644 (file)
@@ -13,10 +13,10 @@ import inspect
 import shutil
 import config
 
-import monitorconfig
+import config
 
 DEBUG= 0
-PICKLE_PATH=monitorconfig.MONITOR_DATA_ROOT
+PICKLE_PATH=config.MONITOR_DATA_ROOT
 
 class ExceptionTimeout(Exception): pass