From af280705f67b30f03c37b136678599ff8477cb48 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Fri, 18 Jan 2008 18:06:05 +0000 Subject: [PATCH] support vserver and chroot myplc --- qaapi/qa/modules/plc/uninstall.py | 33 ++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/qaapi/qa/modules/plc/uninstall.py b/qaapi/qa/modules/plc/uninstall.py index fdca683..1ed8ab5 100644 --- a/qaapi/qa/modules/plc/uninstall.py +++ b/qaapi/qa/modules/plc/uninstall.py @@ -8,16 +8,31 @@ class uninstall(Test): Completely removes the installed myplc """ - def call(self): + def call(self, system_type, root_dir): + + remove_command = " rpm -e myplc " + full_command = "" + + if system_type in ['vserv', 'vserver']: + full_command += " vserver %(root_dir)s exec " + elif system_type in ['chroot']: + pass + else: + raise Exception, "Invalid system type %(system_type)s" % locals() + if self.config.verbose: utils.header("Removing myplc") - (stdin, stdout, stderr) = os.popen3('set -x; service plc safestop') - self.errors = stderr.readlines() - (stdin, stdout, stderr) = os.popen3('set -x; rpm -e myplc') - self.errors.extend(stderr.readlines()) - if self.errors: raise "\n".join(self.errors) - (stdin, stdout, stderr) = os.popen3('set -x; rm -rf /plc/data') - self.errors.extend(stderr.readlines()) - if self.errors: raise "\n".join(self.errors) + + (stdout, stderr) = utils.popen(full_command + "service plc safestop") + if self.config.verbose: + utils.header("\n".join(stdout)) + + (stdin, stdout, stderr) = utils.popen(full_command + remove_command) + if self.config.verbose: + utils.header("\n".join(stdout)) + + (stdin, stdout, stderr) = utils.popen(full_command + " rm -rf /plc/data") + if self.config.verbose: + utiils.header("\n".join(stdout)) return 1 -- 2.47.0