Commit 5a9f4c64c01afb87e6d7146b36bc4656a4eb72f0

Authored by Alexis Koralewski
1 parent 14b16a64
Exists in dev

add is_active field for agents in tnc obsconfig

  1 +25-11-2022 (AKo): v0.6.13.0
  2 + - Add is_active field for agents in tnc obsconfig
  3 +
1 24-11-2022 (EP): v0.6.12.0 4 24-11-2022 (EP): v0.6.12.0
2 - Added tooltip to Agent specific commands 5 - Added tooltip to Agent specific commands
3 - get_all_cmds => returns also tooltips 6 - get_all_cmds => returns also tooltips
1 -0.6.12.0  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +0.6.13.0
3 \ No newline at end of file 3 \ No newline at end of file
config/schemas/schema_observatory-2.0.yml
@@ -44,6 +44,9 @@ schema;schema_AGENT_DEVICE: @@ -44,6 +44,9 @@ schema;schema_AGENT_DEVICE:
44 # if path_data_root is not defined, the default value will be os.environ['PROJECT_ROOT_PATH'] 44 # if path_data_root is not defined, the default value will be os.environ['PROJECT_ROOT_PATH']
45 path_data_root: 45 path_data_root:
46 type: str 46 type: str
  47 + is_active:
  48 + type: bool
  49 + required: False
47 50
48 schema;schema_AGENT: 51 schema;schema_AGENT:
49 type: map 52 type: map
@@ -62,6 +65,9 @@ schema;schema_AGENT: @@ -62,6 +65,9 @@ schema;schema_AGENT:
62 # if path_data_root is not defined, the default value will be os.environ['PROJECT_ROOT_PATH'] 65 # if path_data_root is not defined, the default value will be os.environ['PROJECT_ROOT_PATH']
63 path_data_root: 66 path_data_root:
64 type: str 67 type: str
  68 + is_active:
  69 + type: bool
  70 + required: False
65 71
66 schema;schema_ALBUMS: 72 schema;schema_ALBUMS:
67 type: seq 73 type: seq
src/core/pyros_django/agent/AgentSST.py
@@ -166,7 +166,8 @@ class AgentSST(Agent): @@ -166,7 +166,8 @@ class AgentSST(Agent):
166 continue 166 continue
167 agent_informations = obs_config.get_agent_information(obs_config.unit_name,agent) 167 agent_informations = obs_config.get_agent_information(obs_config.unit_name,agent)
168 protocol = agent_informations.get("protocol") 168 protocol = agent_informations.get("protocol")
169 - if protocol: 169 + is_active = agent_informations.get("is_active",True)
  170 + if protocol and is_active == True:
170 protocol_folder_abs_path = os.path.join(self.PROJECT_ROOT_PATH, os.path.dirname(protocol)) 171 protocol_folder_abs_path = os.path.join(self.PROJECT_ROOT_PATH, os.path.dirname(protocol))
171 172
172 protocol_script_name = protocol.split("/")[-1] 173 protocol_script_name = protocol.split("/")[-1]