just cleanups... call it housekeeping... ;)
This commit is contained in:
parent
b01b7855ef
commit
c3ec557cb2
4 changed files with 4 additions and 15 deletions
|
|
@ -132,7 +132,7 @@ def main():
|
||||||
jobs = []
|
jobs = []
|
||||||
count = 0
|
count = 0
|
||||||
percent = float(0)
|
percent = float(0)
|
||||||
increment = float(100) / float(job_count )
|
increment = float(100) / float(job_count)
|
||||||
for layout in lin_conf.get_enabled_layouts():
|
for layout in lin_conf.get_enabled_layouts():
|
||||||
for hostgroup in layout.get_hostgroups():
|
for hostgroup in layout.get_hostgroups():
|
||||||
for service in hostgroup.get_services():
|
for service in hostgroup.get_services():
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
__author__ = 'rafael'
|
|
||||||
|
|
||||||
|
|
||||||
class BaseTransaction(object):
|
class BaseTransaction(object):
|
||||||
def __init__(self, linspectorInterface:
|
def __init__(self, linspectorInterface):
|
||||||
self.interface = linspectorInterface
|
self.interface = linspectorInterface
|
||||||
|
|
||||||
def transact(self):
|
def transact(self):
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
from linspector.transactions import HostgroupTransaction
|
from linspector.transactions import HostgroupTransaction
|
||||||
from linspector.core.job import LinspectorJob
|
from linspector.core.job import LinspectorJob
|
||||||
|
|
||||||
__author__ = 'rafael'
|
|
||||||
|
|
||||||
def handle_job(job):
|
def handle_job(job):
|
||||||
job.handle_call()
|
job.handle_call()
|
||||||
|
|
@ -12,12 +11,11 @@ class HostgroupHostTransaction(HostgroupTransaction):
|
||||||
super(HostgroupHostTransaction).__init__(linspectorInterface, hostgroup)
|
super(HostgroupHostTransaction).__init__(linspectorInterface, hostgroup)
|
||||||
self.host = host
|
self.host = host
|
||||||
|
|
||||||
|
|
||||||
class HostgroupAddHostTransaction(HostgroupHostTransaction):
|
class HostgroupAddHostTransaction(HostgroupHostTransaction):
|
||||||
def __init__(self, linspectorInterface, hostgroup, host):
|
def __init__(self, linspectorInterface, hostgroup, host):
|
||||||
super(HostgroupHostTransaction).__init__(linspectorInterface, hostgroup, host)
|
super(HostgroupHostTransaction).__init__(linspectorInterface, hostgroup, host)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def transact(self):
|
def transact(self):
|
||||||
hostgroup = self.interface.get_config().get_hostgroup_by_name(self.hostgroup)
|
hostgroup = self.interface.get_config().get_hostgroup_by_name(self.hostgroup)
|
||||||
if hostgroup is not None:
|
if hostgroup is not None:
|
||||||
|
|
@ -36,9 +34,5 @@ class HostgroupAddHostTransaction(HostgroupHostTransaction):
|
||||||
scheduler_job.misfire_grace_time = 2
|
scheduler_job.misfire_grace_time = 2
|
||||||
job.set_job(scheduler_job)
|
job.set_job(scheduler_job)
|
||||||
self.interface.add_job(job)
|
self.interface.add_job(job)
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise Exception("could not find hostgroup %s" % self.hostgroup )
|
raise Exception("could not find hostgroup %s" % self.hostgroup)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
from cherrypy.test.test_session import host
|
|
||||||
from linspector.transactions import BaseTransaction
|
from linspector.transactions import BaseTransaction
|
||||||
|
|
||||||
__author__ = 'rafael'
|
|
||||||
|
|
||||||
class HostgroupTransaction(BaseTransaction):
|
class HostgroupTransaction(BaseTransaction):
|
||||||
def __init__(self, linspectorInterface, hostgroup):
|
def __init__(self, linspectorInterface, hostgroup):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue