Skip to content

Commit

Permalink
Support all Fog OpenStack options
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbyRyterski committed Sep 16, 2015
1 parent 3e842c7 commit 562e684
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ driver:
The `image_ref` and `flavor_ref` options can be specified as an exact id,
an exact name, or as a regular expression matching the name of the image or flavor.

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

Test Kitchen 1.4 supports multiple transports, and transports can be configure globally:

```yaml
Expand Down
6 changes: 4 additions & 2 deletions lib/kitchen/driver/openstack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def openstack_server
provider: 'OpenStack'
}
required_server_settings.each { |s| server_def[s] = config[s] }
optional_server_settings.each { |s| server_def[s] = config[s] }
optional_server_settings.each { |s| server_def[s] = config[s] if config[s] } # rubocop:disable Metrics/LineLength
server_def
end

Expand All @@ -127,7 +127,9 @@ def required_server_settings
end

def optional_server_settings
[:openstack_tenant, :openstack_region, :openstack_service_name]
Fog::Compute::OpenStack.recognized.select do |k|
k.to_s.start_with?('openstack')
end - required_server_settings
end

def network
Expand Down
6 changes: 3 additions & 3 deletions spec/kitchen/driver/openstack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@

describe '#optional_server_settings' do
it 'returns the optional settings for an OpenStack server' do
expected = [
:openstack_tenant, :openstack_region, :openstack_service_name
excluded = [
:openstack_username, :openstack_api_key, :openstack_auth_url
]
expect(driver.send(:optional_server_settings)).to eq(expected)
expect(driver.send(:optional_server_settings)).not_to include(*excluded)
end
end

Expand Down

0 comments on commit 562e684

Please sign in to comment.