optimize the fault notification test
[doctor.git] / doctor_tests / inspector / base.py
1 ##############################################################################
2 # Copyright (c) 2017 ZTE Corporation and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 import abc
10 import six
11
12
13 @six.add_metaclass(abc.ABCMeta)
14 class BaseInspector(object):
15
16     def __init__(self, conf, log):
17         self.conf = conf
18         self.log = log
19         self._host_down_time = None
20         self._vm_down_time = None
21
22     @property
23     def host_down_time(self):
24         return self._host_down_time
25
26     @host_down_time.setter
27     def host_down_time(self, host_down_time):
28         self._host_down_time = host_down_time
29
30     @property
31     def vm_down_time(self):
32         return self._vm_down_time
33
34     @vm_down_time.setter
35     def vm_down_time(self, vm_down_time):
36         self._vm_down_time = vm_down_time
37
38     @abc.abstractmethod
39     def get_inspector_url(self):
40         pass
41
42     @abc.abstractmethod
43     def start(self):
44         pass
45
46     @abc.abstractmethod
47     def stop(self):
48         pass