[FIX] hw_drivers: Hide hostapd status in IoT

We call the status of the hostapd in each request of 'get_odoo_server_url()' and 'get_ssid()'
And this call display in the log the status '0' or 'inactive' in the log

With this commit we hide this useless information

closes odoo/odoo#72133

X-original-commit: e5e9f9f91cf9bf35f1e0b307008840a0de134e2f
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
This commit is contained in:
lejeune quentin
2021-06-14 13:13:32 +00:00
parent 2ebcec9807
commit b4920bfe55
+2 -2
View File
@@ -146,7 +146,7 @@ def get_mac_address():
return netifaces.ifaddresses('wlan0')[netifaces.AF_LINK][0]['addr']
def get_ssid():
ap = subprocess.call(['systemctl', 'is-active', 'hostapd']) # if service is active return 0 else inactive
ap = subprocess.call(['systemctl', 'is-active', '--quiet', 'hostapd']) # if service is active return 0 else inactive
if not ap:
return subprocess.check_output(['grep', '-oP', '(?<=ssid=).*', '/etc/hostapd/hostapd.conf']).decode('utf-8').rstrip()
process_iwconfig = subprocess.Popen(['iwconfig'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
@@ -154,7 +154,7 @@ def get_ssid():
return subprocess.check_output(['sed', 's/.*"\\(.*\\)"/\\1/'], stdin=process_grep.stdout).decode('utf-8').rstrip()
def get_odoo_server_url():
ap = subprocess.call(['systemctl', 'is-active', 'hostapd']) # if service is active return 0 else inactive
ap = subprocess.call(['systemctl', 'is-active', '--quiet', 'hostapd']) # if service is active return 0 else inactive
if not ap:
return False
return read_file_first_line('odoo-remote-server.conf')