Fix deprecated batctl option
parent
4ba3cfb279
commit
0eb14f4c7c
|
@ -3,7 +3,6 @@ import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
class Batman(object):
|
class Batman(object):
|
||||||
"""
|
"""
|
||||||
Bindings for B.A.T.M.A.N. Advanced
|
Bindings for B.A.T.M.A.N. Advanced
|
||||||
|
@ -52,10 +51,10 @@ class Batman(object):
|
||||||
|
|
||||||
def gateway_list(self):
|
def gateway_list(self):
|
||||||
"""
|
"""
|
||||||
Parse "batctl -m <mesh_interface> gwl -n"
|
Parse "batctl meshif <mesh_interface> gwl -n"
|
||||||
into an array of dictionaries.
|
into an array of dictionaries.
|
||||||
"""
|
"""
|
||||||
cmd = ['batctl', '-m', self.mesh_interface, 'gwl', '-n']
|
cmd = ['batctl', 'meshif', self.mesh_interface, 'gwl', '-n']
|
||||||
if os.geteuid() > 0:
|
if os.geteuid() > 0:
|
||||||
cmd.insert(0, 'sudo')
|
cmd.insert(0, 'sudo')
|
||||||
output = subprocess.check_output(cmd, env=self.environ)
|
output = subprocess.check_output(cmd, env=self.environ)
|
||||||
|
@ -81,10 +80,10 @@ class Batman(object):
|
||||||
|
|
||||||
def gateway_mode(self):
|
def gateway_mode(self):
|
||||||
"""
|
"""
|
||||||
Parse "batctl -m <mesh_interface> gw"
|
Parse "batctl meshif <mesh_interface> gw"
|
||||||
return: tuple mode, bandwidth, if mode != server then bandwidth is None
|
return: tuple mode, bandwidth, if mode != server then bandwidth is None
|
||||||
"""
|
"""
|
||||||
cmd = ['batctl', '-m', self.mesh_interface, 'gw']
|
cmd = ['batctl', 'meshif', self.mesh_interface, 'gw']
|
||||||
if os.geteuid() > 0:
|
if os.geteuid() > 0:
|
||||||
cmd.insert(0, 'sudo')
|
cmd.insert(0, 'sudo')
|
||||||
output = subprocess.check_output(cmd, env=self.environ)
|
output = subprocess.check_output(cmd, env=self.environ)
|
||||||
|
|
Loading…
Reference in New Issue