-remove unnecessary code
[tests.git] / qaapi / qa / modules / plc / start.py
1 import os, sys
2 import traceback
3 from qa.Test import Test
4 from qa import utils
5
6 class start(Test):
7     """
8     Starts the myplc service
9     """
10
11     def call(self, system_type, root_dir):
12         
13         start_command = " /sbin/service plc start "
14         full_command = ""
15
16         if system_type in ['vserv', 'vserver']:
17             full_command += " vserver %(root_dir)s exec "
18         elif system_type in ['chroot']:
19             pass
20         else:
21             raise Exception, "Invalid system type %(system_type)s" % locals()
22         
23         full_command += start_command % locals()
24
25         if self.config.verbose:
26             utils.header(full_command)  
27
28         (stdout, stderr) = utils.popen(full_command)
29         
30         if self.config.verbose:
31             utils.header("\n".join(stdout))
32          
33         return 1