6860d9e54a50a190fe96c075c1194986a8a27d8d
[tests.git] / qaapi / qa / tests / plc_uninstall.py
1 #!/usr/bin/python
2
3 import os, sys
4 import traceback
5 from Test import Test
6 from qa import utils
7
8 class plc_uninstall(Test):
9     """
10     Completely removes the installed myplc
11     """
12
13     def call(self, remove_all = False):
14         
15         command = "/sbin/service plc safestop; rpm -e myplc " 
16         if remove_all:
17             command += " && rm -rf /plc/data" 
18
19         if self.config.verbose:
20             utils.header("Removing myplc")
21
22         (stdout, stderr) = utils.popen(command)
23         if self.config.verbose:
24             utils.header("\n".join(stdout))
25                 
26         (stdout, stderr) = utils.popen(command)
27         if self.config.verbose:
28             utiils.header("\n".join(stdout))
29         
30         return 1
31
32 if __name__ == '__main__':
33     args = tuple(sys.argv[1:])
34     plc_unistall()(*args)