import subprocess
import time
-import soltesz
+import database
+import moncommands
from sets import Set
import ssh.pxssh as pxssh
from unified_model import *
from emailTxt import mailtxt
+import monitorconfig
+
import signal
class Sopen(subprocess.Popen):
def kill(self, signal = signal.SIGTERM):
from Rpyc.Utils import *
def get_fbnode(node):
- fb = soltesz.dbLoad("findbad")
+ fb = database.dbLoad("findbad")
fbnode = fb['nodes'][node]['values']
return fbnode
def dump_plconf_file(self):
c = self.c
- c.modules.sys.path.append("/tmp/source/")
- c.modules.os.chdir('/tmp/source')
+ self.c.modules.sys.path.append("/tmp/source/")
+ self.c.modules.os.chdir('/tmp/source')
log = c.modules.BootManager.log('/tmp/new.log')
bm = c.modules.BootManager.BootManager(log,'boot')
def compare_and_repair_nodekeys(self):
c = self.c
- c.modules.sys.path.append("/tmp/source/")
- c.modules.os.chdir('/tmp/source')
+ self.c.modules.sys.path.append("/tmp/source/")
+ self.c.modules.os.chdir('/tmp/source')
log = c.modules.BootManager.log('/tmp/new.log')
bm = c.modules.BootManager.BootManager(log,'boot')
args['port'] = self.port
args['user'] = 'root'
args['hostname'] = self.node
- args['monitordir'] = "/home/soltesz/monitor"
+ args['monitordir'] = monitorconfig.MONITOR_SCRIPT_ROOT
ssh_port = 22
if self.nosetup:
return
# COPY Rpyc files to host
- cmd = "rsync -qv -az -e ssh %(monitordir)s/Rpyc-2.45-2.3/ %(user)s@%(hostname)s:Rpyc 2> /dev/null" % args
+ cmd = "rsync -qv -az -e ssh %(monitordir)s/Rpyc/ %(user)s@%(hostname)s:Rpyc 2> /dev/null" % args
if self.verbose: print cmd
# TODO: Add timeout
timeout = 120
- localos = soltesz.CMD()
+ localos = moncommands.CMD()
ret = localos.system(cmd, timeout)
print ret
t1 = time.time()
# KILL any already running servers.
- ssh = soltesz.SSH(args['user'], args['hostname'], ssh_port)
+ ssh = moncommands.SSH(args['user'], args['hostname'], ssh_port)
(ov,ev) = ssh.run_noexcept2("""<<\EOF
rm -f out.log
echo "kill server" >> out.log
# TODO: the read() here may block indefinitely. Need a better
# approach therefore, that includes a timeout.
#ret = self.command.stdout.read(5)
- ret = soltesz.read_t(self.command.stdout, 5)
+ ret = moncommands.read_t(self.command.stdout, 5)
t2 = time.time()
if 'READY' in ret: