summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Prieels <anp@odoo.com>2019-08-01 05:52:23 +0000
committerAntoine Prieels <anp@odoo.com>2019-08-08 11:53:37 +0000
commit7cb95188579909fb46d4002bc101de8b8cffcf98 (patch)
tree60a0a0312b5214ccab43b7f5b31a3886106b9ca9
parent1e5ed54866acdd61b94f86513f6fe98ff23be5b4 (diff)
[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 <pimodoo@users.noreply.github.com>
-rw-r--r--addons/hw_drivers/drivers/PrinterDriver.py5
1 files changed, 4 insertions, 1 deletions
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