portail_captif: corrige path vers ipset

This commit is contained in:
Daniel STAN 2015-09-30 23:29:21 +02:00
parent e7ba8c346d
commit ade4a9d82e

View file

@ -10,6 +10,7 @@ if '/usr/scripts' not in sys.path:
import lc_ldap.shortcuts
import lc_ldap.objets
from iptools import AddrInNet, NetSubnets, IpSubnet
from gestion.gen_confs.ipset import IPSET_PATH
def _get_ldap_connection():
return lc_ldap.shortcuts.lc_ldap_readonly(user=u'root')
QUERY = _get_ldap_connection()
@ -91,7 +92,7 @@ def mac_from_ip(ip):
def enable_access(ip):
"""Lance la commande idoine pour autoriser l'adresse IP"""
cmd = ['/usr/sbin/ipset', 'add', 'CONFIRMATION', ip]
cmd = [IPSET_PATH, 'add', 'CONFIRMATION', ip]
p = subprocess.Popen(['sudo', '-n'] + cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)