updated to support remote plcs and nodes
[tests.git] / qaapi / qa / tests / plc_stop.py
1 #!/usr/bin/python
2
3 import os, sys
4 import traceback
5 from Test import Test
6 from qa import utils
7 from qa.PLCs import PLC, PLCs
8
9 class plc_stop(Test):
10     """
11     Installs a myplc
12     """
13
14     def call(self, plc_name):
15         
16         # Get plc qa config
17         plc = PLC(self.config)
18         plcs = getattr(self.config, 'plcs', [])
19         for p in plcs:
20             if p['name'] in [plc_name]:
21                 plc.update(p)
22
23         command = " /sbin/service plc stop "
24         if self.config.verbose:
25             utils.header(command)
26         
27         (status, output) = plc.commands(command)
28
29         if self.config.verbose:
30             utils.header(output)
31
32         return 1
33
34 if __name__ == '__main__':
35     args = tuple(sys.argv[1:])
36     plc_stop()(*args)