6f7c5fa746c2aeb61157a68908e6544eba59d7c6
[certmaster.git] / certmaster / minion / modules / test.py
1 import func_module
2 import time
3 import exceptions
4
5 class Test(func_module.FuncModule):
6 version = "11.11.11"
7 api_version = "0.0.1"
8 description = "Just a very simple example module"
9
10 def add(self, numb1, numb2):
11 return numb1 + numb2
12
13 def ping(self):
14 return 1
15
16 def sleep(self,t):
17 """
18 Sleeps for t seconds, and returns time of day.
19 Simply a test function for trying out async and threaded voodoo.
20 """
21 t = int(t)
22 time.sleep(t)
23 return time.time()
24
25 def explode(self):
26 """
27 Testing remote exception handling is useful
28 """
29 raise exceptions.Exception("khhhhhhaaaaaan!!!!!!")