From 59b940961c2c56176760861935418c72503dfcad Mon Sep 17 00:00:00 2001 From: Davide Principi Date: Mon, 4 Nov 2024 12:52:27 +0100 Subject: [PATCH] Fix CLM configuration error (#29) The "filter" field is optional, ensure it is present before setting the environment variable. Refs NethServer/dev#7061 --- imageroot/actions/set-clm-forwarder/10set | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imageroot/actions/set-clm-forwarder/10set b/imageroot/actions/set-clm-forwarder/10set index 97f62a6..d03fabd 100755 --- a/imageroot/actions/set-clm-forwarder/10set +++ b/imageroot/actions/set-clm-forwarder/10set @@ -22,7 +22,8 @@ if not bool(subscription): if (request['active']): agent.set_env('CLOUD_LOG_MANAGER_ADDRESS', f"{request['address']}") agent.set_env('CLOUD_LOG_MANAGER_TENANT', f"{request['tenant']}") - agent.set_env('CLOUD_LOG_MANAGER_FILTER', f"{request['filter']}") + if 'filter' in request: + agent.set_env('CLOUD_LOG_MANAGER_FILTER', request['filter']) if 'start_time' in request and request['start_time'] != '': agent.set_env('CLOUD_LOG_MANAGER_START_TIME', f"{request['start_time']}")