Commit e3caee0e authored by Valentin Samir's avatar Valentin Samir

trigger_generate seulement si on utilise pas la base de test

et en plus on trigger odlyd et plus komaz
parent ed8507f5
......@@ -8,16 +8,22 @@ from django.utils.importlib import import_module
from django.db.models import Q
conn_pool = import_module('conn_pool', 'intranet')
import settings
import datetime
import netaddr
import sys
import gestion.gen_confs.generate as generate
# Create your models here.
get_user = conn_pool.get_user
get_machine = conn_pool.get_machine
# odlyd
def trigger_generate(server):
if not settings.BASE_LDAP_TEST:
import gestion.gen_confs.generate as generate
generate.trigger(server, background=True)
def create_machine(user, type, mac, host, club=None):
ldif = {
......@@ -191,7 +197,7 @@ class Machine(dict):
self.machine.validate_changes()
self.machine.save()
if mac_changed:
generate.trigger('komaz', background=True)
trigger_generate('odlyd')
conn_pool.get_user(self.user, refresh=True)
self.machine = get_machine(self.user, self.machine['mid'][0], mode=self.mode)
......@@ -210,4 +216,4 @@ class Machine(dict):
raise ValueError("La machine existe déjà")
self.machine = create_machine(self.user, self['realm'], self['mac'], self._format_host(self['host']), club=cid if cid else None)
self.update(self._get_machine_info())
generate.trigger('komaz', background=True)
trigger_generate('odlyd')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment