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

Add guard method for image_family selector #192

Open
Temikus opened this issue Apr 10, 2018 · 4 comments
Open

Add guard method for image_family selector #192

Temikus opened this issue Apr 10, 2018 · 4 comments
Labels

Comments

@Temikus
Copy link
Collaborator

Temikus commented Apr 10, 2018

If image family does not exist we trace back:

undefined method `self_link' for nil:NilClass

/Users/temikus/.vagrant.d/gems/2.4.3/gems/vagrant-google-2.0.0/lib/vagrant-google/action/run_instance.rb:99:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/temikus/.vagrant.d/gems/2.4.3/gems/vagrant-google-2.0.0/lib/vagrant-google/action/warn_ssh_keys.rb:28:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/temikus/.vagrant.d/gems/2.4.3/gems/vagrant-google-2.0.0/lib/vagrant-google/action/warn_networks.rb:28:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builtin/synced_folders.rb:87:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builtin/provision.rb:80:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builtin/call.rb:53:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/temikus/.vagrant.d/gems/2.4.3/gems/vagrant-google-2.0.0/lib/vagrant-google/action/connect_google.rb:44:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builtin/box_check_outdated.rb:79:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/machine.rb:227:in `action_raw'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/machine.rb:202:in `block in action'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/environment.rb:592:in `lock'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/machine.rb:188:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/machine.rb:188:in `action'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

Need a guard method that rolls back the process of machine creation here:

image = env[:google_compute].images.get_from_family(image_family, image_project_id).self_link

@Temikus Temikus added the bug label May 25, 2018
@fatmcgav
Copy link

Should update the docs example aswell to account for this..

I got the example working by adding:

google.image_project_id = "ubuntu-os-cloud"

@Temikus
Copy link
Collaborator Author

Temikus commented Oct 2, 2018

@fatmcgav Thank you for this. I missed a piece of logic here. Default image project id's should be autopopulated. I'll address this in the nearest patch.

@Temikus
Copy link
Collaborator Author

Temikus commented Oct 6, 2018

@fatmcgav what you've experienced is actually a regression, apologies - see #206. I'll roll out a fix today.

@fatmcgav
Copy link

fatmcgav commented Oct 6, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants