[FIX] hw_blackbox_be: grep mac address
In the previous debian version, the output of ifconfig was:
ifconfig eth0 Link encap:Ethernet HWaddr b8:27:eb:d6:03:8d
now is
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether b8:27:eb:d6:03:8d txqueuelen 1000 (Ethernet)
closes odoo/odoo#28320
This commit is contained in:
@@ -173,4 +173,4 @@ if isfile("/home/pi/registered_blackbox_be"):
|
||||
|
||||
@http.route('/hw_proxy/request_serial/', type='json', auth='none', cors='*')
|
||||
def request_serial(self):
|
||||
return subprocess.check_output("ifconfig eth0 | grep -o 'HWaddr.*' | sed 's/HWaddr \\(.*\\)/\\1/' | sed 's/://g'", shell=True).rstrip()[-7:]
|
||||
return subprocess.check_output("ifconfig eth0 | grep 'ether.*' | sed 's/://g' | awk '{print $2}'", shell=True).rstrip()[-7:]
|
||||
|
||||
Reference in New Issue
Block a user