From ed577598240990666f665be4bdba728285e71a41 Mon Sep 17 00:00:00 2001 From: Marek Kwaczynski Date: Thu, 18 Sep 2025 10:40:21 +0200 Subject: [PATCH] cloud_discovery: Skip rewriting discovery.state.json when no discovery metho d is set In cases where gateway.json exists, the discovery method may be unset. Writing an empty value to discovery.state.json is not useful, so avoid updating the file in this case. Signed-off-by: Marek Kwaczynski --- feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery | 3 +++ 1 file changed, 3 insertions(+) diff --git a/feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery b/feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery index dba3d35ed..4f6a0db8c 100755 --- a/feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery +++ b/feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery @@ -102,6 +102,9 @@ function gateway_load() { } function discovery_state_write() { + if (length(discovery_method) == 0) + return; + let discovery_state = { "type": discovery_method, "updated": time()