Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update meta adapter to only send config with acquisition ID #350

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions python/src/odin_data/control/meta_listener_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ def put(self, path, request):

value = str(escape.url_unescape(request.body)).replace('"', '')

if path in self._config_parameters:
# Store config to re-send with acquisition ID when it is changed
self._config_parameters[path] = value

if path == "config/acquisition_id":
self.acquisition_id = value
# Set inactive so process_updates doesn't clear acquisition ID
Expand All @@ -134,14 +138,9 @@ def put(self, path, request):
status_code, response = self._send_config(config)

self.acquisition_id = None
elif path in self._config_parameters:
# Store config to re-send with acquisition ID when it is changed
self._config_parameters[path] = value
elif self.acquisition_id is not None:
parameter = path.split("/", 1)[-1] # Remove 'config/'
config = {
"acquisition_id": self.acquisition_id,
parameter: value
}
config = {"acquisition_id": self.acquisition_id, parameter: value}
status_code, response = self._send_config(config)
else:
return super(MetaListenerAdapter, self).put(path, request)
Expand Down
Loading