Commit b70385ab48a83c167fe05657c24ce04663461f3b

Authored by Etienne Pallier
1 parent 0aaf2820
Exists in dev

bugfixing pyros start_agents

pyros.py
... ... @@ -587,7 +587,8 @@ class Pyros(AManager):
587 587 # Start the PyROS software
588 588 # By default (what=None), start everything : all the agents and also the web server (website, web viewing, for global monitoring)
589 589 def start(self, what:str = None):
590   - agents = ("alert_manager", "majordome", "monitoring")
  590 + #agents = ("alert_manager", "majordome", "monitoring")
  591 + agents = ("majordome", "monitoring")
591 592 '''
592 593 what="monitoring"
593 594 what="majordome"
... ...
src/majordome/majordome_test.py
... ... @@ -185,7 +185,7 @@ i+=1; print_step_message(i, 'Launch Majordome agent')
185 185 os.chdir(agent)
186 186 #p = execProcessFromVenvAsync(venv_bin + ' start_agent_'+agent+'_from_test.py')
187 187 #p = execProcessFromVenvAsync(venv_bin + ' start_agent_'+agent+'.py')
188   -majordome = execProcessFromVenvAsync("start_agent_"+agent+'.py')
  188 +majordome = execProcessFromVenvAsync("start_agent_"+agent+'.py'+' test')
189 189 #p = self.execProcessFromVenvAsync('./start_agent_'+agent+'.py')
190 190 #p.wait()
191 191 go_sleeping(10)
... ...
src/majordome/start_agent_majordome.py
... ... @@ -4,6 +4,11 @@ import os
4 4 import sys
5 5 from django.conf import settings as djangosettings
6 6  
  7 +FOR_REAL = True
  8 +if len(sys.argv) == 2 and sys.argv[1] == "test":
  9 + FOR_REAL = False
  10 +print("FOR_REAL is", FOR_REAL)
  11 +
7 12  
8 13 # DJANGO setup
9 14 #sys.path.append('/PROJECTS/GFT/SOFT/PYROS_SOFT/PYROS201802')
... ... @@ -29,4 +34,4 @@ agent="majordome"
29 34 if agent=="majordome":
30 35 from majordome.tasks import Majordome
31 36 # Run agent Majordome without actual commands sent to devices (FOR_REAL=False)
32   - Majordome().run(False)
  37 + Majordome().run(FOR_REAL)
... ...
src/misc/templates/base.html
... ... @@ -46,13 +46,12 @@
46 46  
47 47 #wrapper {
48 48 padding-left: 10%;
49   -
50 49 }
51 50  
52 51 .side-nav {
53 52 margin-left: -200px;
54 53 left: 200px;
55   - width: 125px;
  54 + width: 125px; /*200px for base_unlogged*/
56 55 }
57 56  
58 57 a {
... ...
src/misc/templates/base_unlogged.html
... ... @@ -3,7 +3,6 @@
3 3 <head>
4 4  
5 5 {% load staticfiles %}
6   -
7 6 <meta charset="utf-8">
8 7 <meta http-equiv="X-UA-Compatible" content="IE=edge">
9 8 <meta name="viewport" content="width=device-width, initial-scale=1">
... ... @@ -52,7 +51,7 @@
52 51 .side-nav {
53 52 margin-left: -200px;
54 53 left: 200px;
55   - width: 200px;
  54 + width: 200px; /*125px for base*/
56 55 }
57 56  
58 57 a {
... ... @@ -185,8 +184,8 @@ a {
185 184 }
186 185  
187 186 $("#plc_state").text("PLC: " + mode + '\u00A0\u00A0\u00A0\u00A0\u00A0' + safe + '\u00A0\u00A0\u00A0\u00A0\u00A0' + ack);
188   - $("#plc_state").css("color", "black");
189   - if (timeout > max_plc_timeout)
  187 + $("#plc_state").css("color", "black");
  188 + if (timeout > max_plc_timeout)
190 189 {
191 190 $("#plc_state").text("Connection to PLC LOST");
192 191 $("#plc_state").css("color", "red");
... ...