Skip to content

Commit

Permalink
Undo addition of agents section in config
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJKoopman committed Dec 11, 2023
1 parent a5da246 commit 3fb7275
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
12 changes: 6 additions & 6 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ A full configuration file example with comments is shown here:
# agents
# sorunlib automatically detects unique agents on the OCS network, so only
# non-unique agents need to be specified here.
agents:
# ocs registry agent
registry: 'registry'
# wiregrid agents
wiregrid:
labjack: 'wg-labjack'
# ocs registry agent
registry: 'registry'
# wiregrid agents
wiregrid:
labjack: 'wg-labjack'
Configuration Selection
-----------------------
Expand Down
4 changes: 2 additions & 2 deletions src/sorunlib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _find_active_instances(agent_class):
"""
cfg = load_config()

reg_client = _try_client(cfg['agents']['registry'])
reg_client = _try_client(cfg['registry'])
_, _, session = reg_client.main.status()

instances = []
Expand Down Expand Up @@ -138,7 +138,7 @@ def _create_wiregrid_clients(config=None, sorunlib_config=None):
kikusui = _find_active_instances('WiregridKikusuiAgent')

cfg = load_config(filename=sorunlib_config)
labjack = cfg['agents']['wiregrid']['labjack']
labjack = cfg['wiregrid']['labjack']

clients = {'actuator': _try_client(actuator),
'encoder': _try_client(encoder),
Expand Down
7 changes: 3 additions & 4 deletions tests/data/example_config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
smurf_failure_threshold: 2
agents:
registry: 'registry'
wiregrid:
labjack: 'wg-labjack'
registry: 'registry'
wiregrid:
labjack: 'wg-labjack'
4 changes: 2 additions & 2 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from sorunlib.config import load_config

CONFIG = {'smurf_failure_threshold': 2,
'agents': {'registry': 'registry',
'wiregrid': {'labjack': 'wg-labjack'}}}
'registry': 'registry',
'wiregrid': {'labjack': 'wg-labjack'}}


def test_load_config():
Expand Down

0 comments on commit 3fb7275

Please sign in to comment.