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

Support all Fog OpenStack options #179

Merged
merged 4 commits into from
Oct 1, 2015

Conversation

BobbyRyterski
Copy link
Contributor

This loads all the openstack options directly from Fog to create auth_params. The only deviations from Fog are the two that existed previously, openstack_insecure and openstack_password.

@BobbyRyterski
Copy link
Contributor Author

This is similar to my pull request to kitchen-openstack. Since knife-openstack is a little more complex, this will probably need some work.

@jjasghar
Copy link
Contributor

We'll need some documentation on the README for the "sane" defaults for this change. I want to make sure something like this is as delightful as possible.

@jjasghar
Copy link
Contributor

I ran the specs against this and it blew up. I'll see if i can fix it, but some help on that would be appreciated.

@BobbyRyterski
Copy link
Contributor Author

I've already dug into this a bit.

The builds have been failing since 84f5a86 because the Rake task runs all tests (spec/\*\*\{,/\*/\*\*\}/\*_spec.rb) instead of just unit tests (spec/unit/**/*_spec.rb). I'm not sure if you want to go back to just running unit tests or not.

Regardless, I was able to fix some of the functional tests by adding the ohai hint to @config.

# spec/functional/server_create_func_spec.rb:76
     context 'for Linux' do
       before do
        @config = { openstack_floating_ip: '-1', bootstrap_ip_address: '75.101.253.10', ssh_password: 'password', hints: { "openstack" => {} }}

The unit test failures cropped up in d120353. It looks like they're using the wrong expectation syntax. It should use be_nil.

# spec/unit/openstack_service_spec.rb:35
     it 'sets the api_endpoint in auth params' do
      expect(@instance.instance_variable_get(:@auth_params)[:openstack_auth_url]).to be_nil

I can throw those fixes in this PR or make a new one. Do you have a preference?

@jjasghar
Copy link
Contributor

Yeah go ahead and add it to this PR. I'm cool with that.

* Use be_nil matchers
* Update test with addresses format from chef#178
* Update test with ohai hint from chef#171
@jjasghar jjasghar mentioned this pull request Sep 29, 2015
@jjasghar
Copy link
Contributor

I'll wait for this to be merged then I'll release the gem.

jjasghar pushed a commit that referenced this pull request Sep 29, 2015
@@ -31,6 +31,14 @@ In order to communicate with an OpenStack API you will need to tell Knife your O
knife[:openstack_tenant] = "Your OpenStack tenant name"
knife[:openstack_region] = "Your OpenStack Region"

All of Fog's `openstack` options (`openstack_domain_name`, `openstack_project_name`, ...) are supported. This includes support for the OpenStack Identity v3 API:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jjasghar, is this the kind of example you were looking for?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this works!

jjasghar pushed a commit that referenced this pull request Oct 1, 2015
Support all Fog OpenStack options
@jjasghar jjasghar merged commit d0ac0d1 into chef:master Oct 1, 2015
@BobbyRyterski BobbyRyterski deleted the all_fog_options branch October 1, 2015 23:43
@tas50 tas50 added Type: Enhancement Adds new functionality. and removed Enhancement labels Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants