ipset: /usr/sbin -> /sbin dans jessie

This commit is contained in:
Daniel STAN 2015-08-05 19:03:57 +02:00
parent f53e64a14d
commit 29fdd087c3

View file

@ -21,6 +21,12 @@ sys.path.append('/usr/scripts/gestion')
import commands import commands
import os import os
IPSET_PATH = '/sbin/ipset'
# Avant jessie: ipset était dans /usr/sbin
if not os.path.exists(IPSET_PATH):
IPSET_PATH = '/usr' + IPSET_PATH
class IpsetError(Exception): class IpsetError(Exception):
# Gestion des erreurs d'ipset # Gestion des erreurs d'ipset
def __init__(self,cmd,err_code,output): def __init__(self,cmd,err_code,output):
@ -31,7 +37,7 @@ class IpsetError(Exception):
return "%s\n status : %s\n %s" % (self.cmd,self.err_code,self.output) return "%s\n status : %s\n %s" % (self.cmd,self.err_code,self.output)
class Ipset(object): class Ipset(object):
ipset="/usr/sbin/ipset" ipset=IPSET_PATH
def __str__(self): def __str__(self):
return self.set return self.set