mirror of
https://codeberg.org/prof_x_pvt_ltd/captive.whump.shanti-portal
synced 2024-08-14 22:46:42 +00:00
add sudo option throughout client lib
This commit is contained in:
parent
82b5e46159
commit
6a9fcb9f0c
2 changed files with 7 additions and 3 deletions
|
@ -16,6 +16,7 @@ class Client(object):
|
|||
# Required parameters
|
||||
self.storage = kw.pop('storage')
|
||||
self.ipset_name = kw.pop('ipset_name')
|
||||
self.use_sudo = kw.pop('use_sudo', False)
|
||||
|
||||
self.ip_address = kw.pop('ip_address', '127.0.0.1')
|
||||
self.protocol = kw.pop('protocol', 'tcp')
|
||||
|
@ -89,7 +90,8 @@ class Client(object):
|
|||
'del',
|
||||
'-exist',
|
||||
self.ipset_name,
|
||||
self.ip_address
|
||||
self.ip_address,
|
||||
use_sudo=self.use_sudo
|
||||
)
|
||||
|
||||
|
||||
|
@ -98,7 +100,8 @@ class Client(object):
|
|||
'add',
|
||||
'-exist',
|
||||
self.ipset_name,
|
||||
self.ip_address
|
||||
self.ip_address,
|
||||
use_sudo=self.use_sudo
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -136,7 +136,8 @@ if args.refresh:
|
|||
client = Client(
|
||||
storage=sr,
|
||||
ip_address=client_ip,
|
||||
ipset_name=config.get('ipset', 'ipset_name')
|
||||
ipset_name=config.get('ipset', 'ipset_name'),
|
||||
use_sudo=use_sudo
|
||||
)
|
||||
except Exception as e:
|
||||
if args.verbose:
|
||||
|
|
Loading…
Reference in a new issue