Commit 5a9f4c64c01afb87e6d7146b36bc4656a4eb72f0
1 parent
14b16a64
Exists in
dev
add is_active field for agents in tnc obsconfig
Showing
4 changed files
with
12 additions
and
2 deletions
Show diff stats
CHANGELOG
VERSION
config/schemas/schema_observatory-2.0.yml
... | ... | @@ -44,6 +44,9 @@ schema;schema_AGENT_DEVICE: |
44 | 44 | # if path_data_root is not defined, the default value will be os.environ['PROJECT_ROOT_PATH'] |
45 | 45 | path_data_root: |
46 | 46 | type: str |
47 | + is_active: | |
48 | + type: bool | |
49 | + required: False | |
47 | 50 | |
48 | 51 | schema;schema_AGENT: |
49 | 52 | type: map |
... | ... | @@ -62,6 +65,9 @@ schema;schema_AGENT: |
62 | 65 | # if path_data_root is not defined, the default value will be os.environ['PROJECT_ROOT_PATH'] |
63 | 66 | path_data_root: |
64 | 67 | type: str |
68 | + is_active: | |
69 | + type: bool | |
70 | + required: False | |
65 | 71 | |
66 | 72 | schema;schema_ALBUMS: |
67 | 73 | type: seq | ... | ... |
src/core/pyros_django/agent/AgentSST.py
... | ... | @@ -166,7 +166,8 @@ class AgentSST(Agent): |
166 | 166 | continue |
167 | 167 | agent_informations = obs_config.get_agent_information(obs_config.unit_name,agent) |
168 | 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 | 171 | protocol_folder_abs_path = os.path.join(self.PROJECT_ROOT_PATH, os.path.dirname(protocol)) |
171 | 172 | |
172 | 173 | protocol_script_name = protocol.split("/")[-1] | ... | ... |