Fix deprecated batctl option

master
Thomas Hooge 2023-12-14 14:10:08 +01:00
parent 4ba3cfb279
commit 0eb14f4c7c
1 changed files with 4 additions and 5 deletions

View File

@ -3,7 +3,6 @@ import json
import os
import re
class Batman(object):
"""
Bindings for B.A.T.M.A.N. Advanced
@ -52,10 +51,10 @@ class Batman(object):
def gateway_list(self):
"""
Parse "batctl -m <mesh_interface> gwl -n"
Parse "batctl meshif <mesh_interface> gwl -n"
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:
cmd.insert(0, 'sudo')
output = subprocess.check_output(cmd, env=self.environ)
@ -81,10 +80,10 @@ class Batman(object):
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
"""
cmd = ['batctl', '-m', self.mesh_interface, 'gw']
cmd = ['batctl', 'meshif', self.mesh_interface, 'gw']
if os.geteuid() > 0:
cmd.insert(0, 'sudo')
output = subprocess.check_output(cmd, env=self.environ)