From 7cb95188579909fb46d4002bc101de8b8cffcf98 Mon Sep 17 00:00:00 2001 From: Antoine Prieels Date: Thu, 1 Aug 2019 05:52:23 +0000 Subject: [PATCH] [IMP] hw_drivers: PrinterDriver get hotspot name for status ticket When the IoT Box is not connected to the IoT Box, a hotspot would be created to configure it. The name of this hotspot is printed on a status receipt if a printer is connected. Previously, this ticket only showed the default name of the hotspot, but this name will be different if the user renamed the Box. We then read the name of the hotspot from the config. closes odoo/odoo#33095 Signed-off-by: pimodoo --- addons/hw_drivers/drivers/PrinterDriver.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/hw_drivers/drivers/PrinterDriver.py b/addons/hw_drivers/drivers/PrinterDriver.py index 99edad4e6bc..ec769de7599 100644 --- a/addons/hw_drivers/drivers/PrinterDriver.py +++ b/addons/hw_drivers/drivers/PrinterDriver.py @@ -247,7 +247,10 @@ class PrinterDriver(Driver): hosting_ap = os.system('pgrep hostapd') == 0 ssid = subprocess.check_output('iwconfig 2>&1 | grep \'ESSID:"\' | sed \'s/.*"\\(.*\\)"/\\1/\'', shell=True).decode('utf-8').rstrip() if hosting_ap: - wlan = 'Wireless network:\nIoTBox\n\n' + with open('/root_bypass_ramdisks/etc/hostapd/hostapd.conf') as config_file: + lines = config_file.readlines() + ssid = lines[1].split("=")[1].replace("\n", "") + wlan = 'Wireless network:\n%s\n\n' % ssid elif ssid: wlan = 'Wireless network:\n%s\n\n' % ssid