Skip to content
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

(maint) Fix up nspooler list active bug #154

Conversation

cthorn42
Copy link

@cthorn42 cthorn42 commented Feb 8, 2022

If no reason is defined for checking out a nspooler VM we'd get a nil
reference error message when listing active nspooler VMs. This PR fixes
that.

If no reason is defined for checking out a nspooler VM we'd get a nil
refrence error message when listing active nspooler VMs. This PR fixes
that.
@cthorn42 cthorn42 requested review from briancain, highb and a team as code owners February 8, 2022 19:57
@cthorn42
Copy link
Author

cthorn42 commented Feb 8, 2022

The error for reference is:

Traceback (most recent call last):
	10: from /Users/cthorn/repo/vmfloaty/bin/floaty:8:in `<main>'
	 9: from /Users/cthorn/repo/vmfloaty/lib/vmfloaty.rb:583:in `run'
	 8: from /Users/cthorn/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
	 7: from /Users/cthorn/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/runner.rb:58:in `run!'
	 6: from /Users/cthorn/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
	 5: from /Users/cthorn/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
	 4: from /Users/cthorn/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
	 3: from /Users/cthorn/repo/vmfloaty/lib/vmfloaty.rb:130:in `block (2 levels) in run'
	 2: from /Users/cthorn/repo/vmfloaty/lib/vmfloaty/utils.rb:113:in `pretty_print_hosts'
	 1: from /Users/cthorn/repo/vmfloaty/lib/vmfloaty/utils.rb:113:in `each'
/Users/cthorn/repo/vmfloaty/lib/vmfloaty/utils.rb:149:in `block in pretty_print_hosts': undefined method `empty?' for nil:NilClass (NoMethodError)

The object in question this was the value I had when looking at it in a pry statement:
{"fqdn"=>"arm64-centos7-2.ops.puppetlabs.net", "os_triple"=>"centos-7-arm64", "user"=>"christopher.thorn", "tags"=>"", "remaining_lifetime"=>5.6}

@sbeaulie
Copy link
Contributor

sbeaulie commented Feb 8, 2022

Thanks for fixing this

@sbeaulie sbeaulie merged commit 1b64ce3 into puppetlabs:main Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants