From 44e4cce73bb6ca60fc3f5cd2073d073c21fc21ce Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Wed, 13 Apr 2016 13:50:58 -0700 Subject: [PATCH] Allow status and ssh to run without a lock Prior to this patch long running operations, such as provisioners, would prevent `vagrant status` or `vagrant ssh` from being run due to Vagrant action locking. Attempting such actions would result in an error message. This is inconvienant as shelling into a VM is a common debugging step in figuring out why a provisioner is taking longer than usual. Vagrant 1.7 introduced the ability to mark certain actions as not requireing a lock. This patch adds `lock: false` to the `get_state` and `get_ssh_info` calls which allows both `vagrant status` and `vagrant ssh` to function while a long-running action is executing in another process. Vagrant 1.6 will ignore the unknown `lock` option and fail as usual. --- source/lib/vagrant-openstack-provider/provider.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/lib/vagrant-openstack-provider/provider.rb b/source/lib/vagrant-openstack-provider/provider.rb index c53815d..70eb99d 100644 --- a/source/lib/vagrant-openstack-provider/provider.rb +++ b/source/lib/vagrant-openstack-provider/provider.rb @@ -22,7 +22,7 @@ def ssh_info # Run a custom action called "read_ssh_info" which does what it # says and puts the resulting SSH info into the `:machine_ssh_info` # key in the environment. - env = @machine.action('read_ssh_info') + env = @machine.action('read_ssh_info', lock: false) env[:machine_ssh_info] end @@ -30,7 +30,7 @@ def state # Run a custom action we define called "read_state" which does # what it says. It puts the state in the `:machine_state_id` # key in the environment. - env = @machine.action('read_state') + env = @machine.action('read_state', lock: false) state_id = env[:machine_state_id]