initial checkin of qa api
[tests.git] / qaapi / qa / modules / plc / uninstall.py
1 import os, sys
2 import traceback
3 from qa.Test import Test
4 from qa import utils
5
6 class uninstall(Test):
7     """
8     Completely removes the installed myplc
9     """
10
11     def call(self):
12         if self.config.verbose:
13             utils.header("Removing myplc")
14         (stdin, stdout, stderr) = os.popen3('set -x; service plc safestop')
15         self.errors = stderr.readlines()
16         (stdin, stdout, stderr) = os.popen3('set -x; rpm -e myplc')
17         self.errors.extend(stderr.readlines())
18         if self.errors: raise "\n".join(self.errors)
19         (stdin, stdout, stderr) = os.popen3('set -x; rm -rf  /plc/data')
20         self.errors.extend(stderr.readlines())
21         if self.errors: raise "\n".join(self.errors)
22         
23         return 1