From 7370b1e24b95243777638e35dcf9e3ea5834f9c2 Mon Sep 17 00:00:00 2001 From: Trey Dockendorf Date: Mon, 18 Dec 2023 12:25:19 -0500 Subject: [PATCH 1/2] (#190) Allow setting SRV domain using environment variable --- lib/mcollective/util/choria.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/mcollective/util/choria.rb b/lib/mcollective/util/choria.rb index 521453b1..76031756 100644 --- a/lib/mcollective/util/choria.rb +++ b/lib/mcollective/util/choria.rb @@ -127,12 +127,13 @@ def facter_domain # Determines the domain to do SRV lookups in # - # This is settable using choria.srv_domain and defaults + # This is settable using the environment variable + # CHORIA_SRV_DOMAIN or choria.srv_domain and defaults # to the domain as reported by facter # # @return [String] def srv_domain - get_option("choria.srv_domain", nil) || facter_domain + env_fetch("CHORIA_SRV_DOMAIN", nil) || get_option("choria.srv_domain", nil) || facter_domain end # Determines the SRV records to look up From 3f86876c428593f954e424cbd81d9115d52f7f31 Mon Sep 17 00:00:00 2001 From: Trey Dockendorf Date: Mon, 18 Dec 2023 13:15:32 -0500 Subject: [PATCH 2/2] Rubocop autocorrect --- lib/mcollective/pluginpackager/forge_packager.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mcollective/pluginpackager/forge_packager.rb b/lib/mcollective/pluginpackager/forge_packager.rb index ca8ff4b5..3602459e 100644 --- a/lib/mcollective/pluginpackager/forge_packager.rb +++ b/lib/mcollective/pluginpackager/forge_packager.rb @@ -191,7 +191,7 @@ def render_templates end def render_template(infile, outfile) - erb = ERB.new(File.read(infile), safe_level:0, trim_mode:"-") + erb = ERB.new(File.read(infile), :safe_level => 0, :trim_mode => "-") File.open(outfile, "w") do |f| f.puts erb.result(binding) end