Commit 38674e6ef35bb7dfb7e6d71b7eff3aa775f36e12

Authored by Alexis Koralewski
1 parent 92583b55
Exists in dev

Fix AD_PLC & plc_checker

src/core/pyros_django/env_monitor/AD_PLC.py
@@ -10,7 +10,7 @@ from src.core.pyros_django.majordome.agent.Agent import Agent, build_agent, log, @@ -10,7 +10,7 @@ from src.core.pyros_django.majordome.agent.Agent import Agent, build_agent, log,
10 from src.core.pyros_django.devices.PLC import PLCController 10 from src.core.pyros_django.devices.PLC import PLCController
11 from src.core.pyros_django.env_monitor.plc_checker import PlcChecker 11 from src.core.pyros_django.env_monitor.plc_checker import PlcChecker
12 from common.models import * 12 from common.models import *
13 -from env_monitor.models import Sensors_data_last_value 13 +from env_monitor.models import Sensors_data_last_value, Sensors_data
14 from dashboard.config_pyros import ConfigPyros 14 from dashboard.config_pyros import ConfigPyros
15 15
16 16
src/core/pyros_django/env_monitor/plc_checker.py
@@ -158,7 +158,7 @@ class PlcChecker(object): @@ -158,7 +158,7 @@ class PlcChecker(object):
158 _file.write(json.dumps(_struct)) 158 _file.write(json.dumps(_struct))
159 _file.close() 159 _file.close()
160 logger.info("Saved : plc_config.json") 160 logger.info("Saved : plc_config.json")
161 - except Exception as : 161 + except:
162 logger.error("Not saved plc_config.json") 162 logger.error("Not saved plc_config.json")
163 raise Exception(f"Could not save plc_config.json ; current dir is {os.getcwd()} ; plc_config_dir is {plc_config_dir}") 163 raise Exception(f"Could not save plc_config.json ; current dir is {os.getcwd()} ; plc_config_dir is {plc_config_dir}")
164 164