Correctifs pour le commit précédent, et de quoi tester le chaînage.
This commit is contained in:
parent
201377528c
commit
f228493399
12 changed files with 99 additions and 16 deletions
37
gestion/trigger/services/secours.py
Normal file
37
gestion/trigger/services/secours.py
Normal file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/bash /usr/scripts/python.sh
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Service in charge of firewall for trigger.
|
||||
# Contains multiple subservices for each special
|
||||
# part of firewall.
|
||||
#
|
||||
# Author : Pierre-Elliott Bécue <becue@crans.org>
|
||||
# Licence : GPLv3
|
||||
# Date : 15/06/2014
|
||||
"""
|
||||
Firewall service module. is uses the firewall library as it's, it
|
||||
is not designed to replace it, just to call specific functions from
|
||||
it to regenerate what needs to.
|
||||
"""
|
||||
|
||||
import cranslib.clogger as clogger
|
||||
import gestion.config.trigger as trigger_config
|
||||
logger = clogger.CLogger("trigger", "secours", trigger_config.log_level, trigger_config.debug)
|
||||
|
||||
import lc_ldap.shortcuts
|
||||
|
||||
from gestion.trigger.host import record_service
|
||||
import gestion.trigger.firewall4.firewall4 as firewall4
|
||||
|
||||
@record_service()
|
||||
def secours(ob_id, body=()):
|
||||
"""Regens the specific service
|
||||
|
||||
"""
|
||||
if len(body) != 2:
|
||||
logger.warning("Received body %r, this format is incorrect, discarding.", body)
|
||||
return
|
||||
(service, data) = body
|
||||
logger.info("Calling service %s for data %r", service, data)
|
||||
# XXX - Uncomment when in prod
|
||||
#FwFactory.get(service)(data)
|
Loading…
Add table
Add a link
Reference in a new issue