Merge pull request #91 from nwolfe/maint/remove-warning

(maint) Remove warning about missing configuration file
This commit is contained in:
Gene Liverman 2020-09-03 07:06:05 -04:00 committed by GitHub
commit 5a0640c515
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -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
@ -90,6 +90,7 @@ class Vmfloaty
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']
@ -212,6 +213,7 @@ class Vmfloaty
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)

View file

@ -8,7 +8,7 @@ class Conf
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