-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
At the moment, if we change one thing in the config, there are multiple things that have to change to keep the cli up to date. E.g.,
Lines 23 to 35 in 2d0fe14
| for i, item in enumerate(instruments): | |
| if "name" not in item: | |
| msg = f"Instrument number #{i + 1} configuration is missing the field 'name'" | |
| raise InvalidNetworkConfigurationError(msg) | |
| if "import" not in item: | |
| msg = f"Instrument number #{i + 1} configuration is missing the field 'import'" | |
| raise InvalidNetworkConfigurationError(msg) | |
| if "desc" not in item: | |
| msg = f"Instrument number #{i + 1} configuration is missing the field 'desc'" | |
| raise InvalidNetworkConfigurationError(msg) | |
| if "address" not in item: | |
| msg = f"Instrument number #{i + 1} configuration is missing the field 'address'" | |
| raise InvalidNetworkConfigurationError(msg) |
Lines 55 to 64 in 2d0fe14
| if "name" in provider: | |
| kwargs["name"] = str(provider["name"]) | |
| if "router_name" in provider: | |
| kwargs["router_name"] = str(provider["router_name"]) | |
| if "host" in provider: | |
| kwargs["host"] = str(provider["host"]) | |
| if "port" in provider: | |
| kwargs["port"] = int(provider["port"]) | |
| if "beat_period" in provider: | |
| kwargs["beat_period"] = int(provider["beat_period"]) |
Lines 109 to 118 in 2d0fe14
| if name: | |
| kwargs["name"] = name | |
| if router_name: | |
| kwargs["router_name"] = router_name | |
| if host: | |
| kwargs["host"] = host | |
| if port: | |
| kwargs["port"] = port | |
| if beat_period: | |
| kwargs["beat_period"] = beat_period |
Ideally the cli should be aware of the config schema and other models.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request