ggiamarchi / vagrant-openstack-provider

Use Vagrant to manage OpenStack Cloud instances.
MIT License
247 stars 101 forks source link

Berkshelf got broken after #229 #248

Closed artem-sidorenko closed 8 years ago

artem-sidorenko commented 9 years ago

berkshelf from chefdk and vagrant-berkshelf are often used to test the chef cookbooks.

After #229 vagrant-berkshelf and berkshelf don't work anymore: before #229:

root@af2e082c0f42:/mnt/share/vagrant-openstack-provider/source# git status
HEAD detached at d4d9f43
...
root@af2e082c0f42:/mnt/share/vagrant-openstack-provider/source# bundle exec vagrant up test-server --provider=openstack
.....
Bringing machine 'test-server' up with 'openstack' provider...
    test-server: The Berkshelf shelf is at "/root/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150911-559-psmng7-test-server"
==> test-server: Sharing cookbooks with VM
==> test-server: Updating Vagrant's Berkshelf...
The authenticity of host 'bla'....    <- SSH/Git run via Berkshelf

after #229:

root@af2e082c0f42:/mnt/share/vagrant-openstack-provider/source# git status
HEAD detached at 92d8687
root@af2e082c0f42:/mnt/share/vagrant-openstack-provider/source# bundle exec vagrant up test-server --provider=openstack
...
Bringing machine 'test-server' up with 'openstack' provider...
    test-server: The Berkshelf shelf is at "/root/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150911-1172-1szqf5v-test-server"
==> test-server: Sharing cookbooks with VM
==> test-server: Finding flavor for server...  <- No Berkshelf run
==> test-server: Finding image for server...
==> test-server: Finding network(s) for server...
artem-sidorenko commented 9 years ago

I don't know Vagrant code well, but if I take a look here and here my feeling is vagrant-berkshelf is registering the hook to the built-in Provision, which isn't involved anymore by vagrant-openstack-provider.

Right?

artem-sidorenko commented 9 years ago

I tested it with following diff, it looks good to me:

diff --git a/source/lib/vagrant-openstack-provider/action.rb b/source/lib/vagrant-openstack-provider/action.rb
index ce55cec..d2fb22d 100644
--- a/source/lib/vagrant-openstack-provider/action.rb
+++ b/source/lib/vagrant-openstack-provider/action.rb
@@ -33,6 +33,7 @@ module VagrantPlugins
             if env[:machine_state_id] == :not_created
               b2.use Message, I18n.t('vagrant_openstack.not_created')
             else
+              b2.use Provision
               b2.use ProvisionWrapper
               b2.use SyncFolders
             end
@@ -99,6 +100,7 @@ module VagrantPlugins
             case env[:machine_state_id]
             when :not_created
               ssh_disabled = env[:machine].provider_config.ssh_disabled
+              b2.use Provision unless ssh_disabled
               b2.use ProvisionWrapper unless ssh_disabled
               b2.use SyncFolders
               b2.use CreateStack
ggiamarchi commented 8 years ago

@artem-sidorenko Yes, your diagnostic is right :disappointed_relieved:

artem-sidorenko commented 8 years ago

@ggiamarchi Do you have probably any news on this? its somehow a dead lock situation:-(

ggiamarchi commented 8 years ago

@artem-sidorenko Release 0.7.2 fixes this bug among others.

artem-sidorenko commented 8 years ago

@ggiamarchi cool, many thx!