Skip to content

Commit

Permalink
Use fetch in block form when retrieving the hostname
Browse files Browse the repository at this point in the history
This avoids executing hostname unconditionally and is now only called
when it's needed.
  • Loading branch information
ekohl authored and ehelms committed Apr 5, 2024
1 parent cfbb8c4 commit 6a6bffe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/foreman_maintain/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def initialize(options)
@options.fetch(:completion_cache_file, '~/.cache/foreman_maintain_completion.yml')
)
@disable_commands = @options.fetch(:disable_commands, [])
@foreman_url = @options.fetch(:foreman_url, `hostname -f`.chomp)
@foreman_url = @options.fetch(:foreman_url) { `hostname -f`.chomp }
@foreman_port = @options.fetch(:foreman_port, 443)
end

Expand Down

0 comments on commit 6a6bffe

Please sign in to comment.