miscell cosmetic + pass the substrate object to TestBonding so it can compute an...
[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, plc_name = None, remove_all = False):
14
15         # Get plc configuration from config
16         plc = self.config.get_plc(plc_name)     
17         command = "/sbin/service plc safestop && rpm -e myplc " 
18         if remove_all:
19             command += " && rm -rf /plc/data" 
20
21         if self.config.verbose:
22             utils.header("Removing myplc", logfile = self.config.logfile)
23             utils.header("\n".join(command), logfile = self.config.logfile)
24         
25         (status, output) = plc.commands(command)
26                 
27         if self.config.verbose:
28             utiils.header("\n".join(output))
29         
30         return 1
31
32 if __name__ == '__main__':
33     args = tuple(sys.argv[1:])
34     plc_unistall()(*args)