From 67b1dec822f9f0ab70ddd92625006a2d05085458 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Thu, 17 Jan 2008 22:47:10 +0000 Subject: [PATCH] support starting vservers and chroot myplc --- qaapi/qa/modules/plc/start.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/qaapi/qa/modules/plc/start.py b/qaapi/qa/modules/plc/start.py index 97c3c75..f1b3038 100644 --- a/qaapi/qa/modules/plc/start.py +++ b/qaapi/qa/modules/plc/start.py @@ -1,15 +1,33 @@ import os, sys import traceback from qa.Test import Test +from qa import utils class start(Test): """ - Installs a myplc + Starts the myplc service """ - def call(self): - (stdin, stdout, stderr) = os.popen3('set -x ; service plc start') + def call(self, system_type, vserver_or_root_dir_name): + + start_command = " /sbin/service plc start " + full_command = "" + + if system_type in ['vserv', 'vserver']: + full_command += " vserver %(vserver_or_root_dir_name)s exec " + elif system_type in ['chroot']: + pass + else: + raise Exception, "Invalid system type %(system_type)s" % locals() + + full_command += start_command + full_command = full_command % locals() + + if self.config.verbose: + utils.header(full_command) + + (stdin, stdout, stderr) = os.popen3(full_command) self.errors = stderr.readlines() - if self.errors: raise "\n".join(self.errors) + if self.errors: raise Exception, "\n".join(self.errors) return 1 -- 2.45.2