Skip to content

Commit

Permalink
Merge pull request #98 from BobbyRyterski/all_fog_options
Browse files Browse the repository at this point in the history
Support all Fog OpenStack options
  • Loading branch information
JJ Asghar committed Sep 21, 2015
2 parents a6c4826 + 562e684 commit 5edcbf1
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 @@ -127,7 +127,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 @@ -136,7 +136,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 @@ -338,10 +338,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 5edcbf1

Please sign in to comment.