Skip to content

(maint) Remove warning about missing configuration file #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/vmfloaty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Vmfloaty

def run # rubocop:disable Metrics/AbcSize
program :version, Vmfloaty::VERSION
program :description, "A CLI helper tool for Puppet's vmpooler to help you stay afloat"
program :description, "A CLI helper tool for Puppet's vmpooler to help you stay afloat.\n\nConfiguration may be placed in a ~/.vmfloaty.yml file."

config = Conf.read_config

Expand Down Expand Up @@ -90,6 +90,7 @@ def run # rubocop:disable Metrics/AbcSize
c.option '--json', 'Prints information as JSON'
c.option '--token STRING', String, 'Token for pooler service'
c.option '--url STRING', String, 'URL of pooler service'
c.option '--user STRING', String, 'User to authenticate with'
c.action do |args, options|
verbose = options.verbose || config['verbose']

Expand Down Expand Up @@ -212,6 +213,7 @@ def run # rubocop:disable Metrics/AbcSize
c.option '--json', 'Outputs hosts scheduled for deletion as JSON'
c.option '--token STRING', String, 'Token for pooler service'
c.option '--url STRING', String, 'URL of pooler service'
c.option '--user STRING', String, 'User to authenticate with'
c.action do |args, options|
verbose = options.verbose || config['verbose']
service = Service.new(options, config)
Expand Down
2 changes: 1 addition & 1 deletion lib/vmfloaty/conf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def self.read_config
begin
conf = YAML.load_file("#{Dir.home}/.vmfloaty.yml")
rescue StandardError
FloatyLogger.warn "WARNING: There was no config file at #{Dir.home}/.vmfloaty.yml"
# ignore
end
conf
end
Expand Down