From a325d9b0898be332a35191aaa2f8152d3a6d845d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Iv=C3=A1n=20L=C3=B3pez=20Gonz=C3=A1lez?= Date: Wed, 30 Oct 2024 11:29:43 +0000 Subject: [PATCH] fix(storage): avoid error when setting storage config - gh#agama-project/agama#1706 --- service/lib/agama/storage/config_conversions.rb | 3 --- .../config_conversions/from_json_conversions/search.rb | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/service/lib/agama/storage/config_conversions.rb b/service/lib/agama/storage/config_conversions.rb index 17ff47ee9b..e8f49d38f5 100644 --- a/service/lib/agama/storage/config_conversions.rb +++ b/service/lib/agama/storage/config_conversions.rb @@ -26,9 +26,6 @@ module Agama module Storage # Conversions for the storage config. module ConfigConversions - # Reserved string for Configs::Search meaning 'match all devices if there is any' - SEARCH_ANYTHING_STRING = "*" - private_constant :SEARCH_ANYTHING_STRING end end end diff --git a/service/lib/agama/storage/config_conversions/from_json_conversions/search.rb b/service/lib/agama/storage/config_conversions/from_json_conversions/search.rb index 7b372f55d8..e742de66a2 100644 --- a/service/lib/agama/storage/config_conversions/from_json_conversions/search.rb +++ b/service/lib/agama/storage/config_conversions/from_json_conversions/search.rb @@ -36,6 +36,12 @@ def convert private + # Reserved search value meaning 'match all devices or ignore the section'. + # + # { search: "*" } is a shortcut for { search: { ifNotFound: "skip" } }. + SEARCH_ANYTHING_STRING = "*" + private_constant :SEARCH_ANYTHING_STRING + alias_method :search_json, :config_json # @see Base#conversions