making inspector object singleton again by assigning to the base pollster class
Change-Id: I1afc02d595273f7b699afac9c12fcb17a777b4a8 Closes-Bug: #1819562
This commit is contained in:
parent
062e02c612
commit
ab73c911dd
|
@ -47,21 +47,21 @@ class GenericComputePollster(plugin_base.PollsterBase):
|
||||||
|
|
||||||
def setup_environment(self):
|
def setup_environment(self):
|
||||||
super(GenericComputePollster, self).setup_environment()
|
super(GenericComputePollster, self).setup_environment()
|
||||||
self.inspector = self._get_inspector(self.conf)
|
self.inspector = GenericComputePollster._get_inspector(self.conf)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def aggregate_method(stats):
|
def aggregate_method(stats):
|
||||||
# Don't aggregate anything by default
|
# Don't aggregate anything by default
|
||||||
return stats
|
return stats
|
||||||
|
|
||||||
@classmethod
|
@staticmethod
|
||||||
def _get_inspector(cls, conf):
|
def _get_inspector(conf):
|
||||||
# FIXME(sileht): This doesn't looks threadsafe...
|
# FIXME(sileht): This doesn't looks threadsafe...
|
||||||
try:
|
try:
|
||||||
inspector = cls._inspector
|
inspector = GenericComputePollster._inspector
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
inspector = virt_inspector.get_hypervisor_inspector(conf)
|
inspector = virt_inspector.get_hypervisor_inspector(conf)
|
||||||
cls._inspector = inspector
|
GenericComputePollster._inspector = inspector
|
||||||
return inspector
|
return inspector
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in New Issue