kitchen-openstack 2.0.0.dev.2 → 2.0.0.dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -0
- data/lib/kitchen/driver/openstack.rb +23 -12
- data/lib/kitchen/driver/openstack_version.rb +1 -1
- data/spec/kitchen/driver/openstack_spec.rb +11 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66008f6399b2f88b79228a8e4bdcb0d4d66e1e23
|
4
|
+
data.tar.gz: 025e776aeb603cf6e5c461eec6af7ba9517f2f35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f8887259c413711e78cac4bb47c364c4d234601a30b76c93a18dd1961904fee17748f61ef9e9a70a3248405372e4ac0e266f5310c85b41c793f12b2ee7792d6
|
7
|
+
data.tar.gz: 2b861ee3fb1d09f3e74e5b38e57b284277a300fb752c5456aba843225da1f55b9e0f85907080f5e1eae7f1090111600a148c1f892f9b8d5aec00656236b4681b
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@
|
|
5
5
|
* Re-written for the new test-kitchen underlying framework
|
6
6
|
* Windows and WinRM support
|
7
7
|
* Stole some code from PR [#80][] - from [@jmahowald][]
|
8
|
+
* Resolve for issue [#96][]
|
9
|
+
* Don't create instance if name is already created [#100][] - from [@dpetzel][]
|
10
|
+
* Load openstack_version for plugin_version [#99][] - from [@BobbyRyterski][]
|
11
|
+
* Support all Fog OpenStack options [#98][] - from [@BobbyRyterski][]
|
8
12
|
|
9
13
|
# 1.8.1 / 2015-07-22
|
10
14
|
|
data/README.md
CHANGED
@@ -55,6 +55,9 @@ driver:
|
|
55
55
|
The `image_ref` and `flavor_ref` options can be specified as an exact id,
|
56
56
|
an exact name, or as a regular expression matching the name of the image or flavor.
|
57
57
|
|
58
|
+
All of Fog's `openstack` options (`openstack_domain_name`, `openstack_project_name`,
|
59
|
+
...) are supported. This includes support for the OpenStack Identity v3 API.
|
60
|
+
|
58
61
|
Test Kitchen 1.4 supports multiple transports, and transports can be configure globally:
|
59
62
|
|
60
63
|
```yaml
|
@@ -73,15 +73,24 @@ module Kitchen
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
# Set the proper server name in the config
|
77
|
+
def config_server_name
|
78
|
+
return if config[:server_name]
|
79
|
+
|
80
|
+
if config[:server_name_prefix]
|
81
|
+
config[:server_name] = server_name_prefix(
|
82
|
+
config[:server_name_prefix]
|
83
|
+
)
|
84
|
+
else
|
85
|
+
config[:server_name] = default_name
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
76
89
|
def create(state)
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
)
|
82
|
-
else
|
83
|
-
config[:server_name] = default_name
|
84
|
-
end
|
90
|
+
config_server_name
|
91
|
+
if state[:server_id]
|
92
|
+
info "#{config[:server_name]} (#{state[:server_id]}) already exists."
|
93
|
+
return
|
85
94
|
end
|
86
95
|
disable_ssl_validation if config[:disable_ssl_validation]
|
87
96
|
server = create_server
|
@@ -118,7 +127,7 @@ module Kitchen
|
|
118
127
|
provider: 'OpenStack'
|
119
128
|
}
|
120
129
|
required_server_settings.each { |s| server_def[s] = config[s] }
|
121
|
-
optional_server_settings.each { |s| server_def[s] = config[s] }
|
130
|
+
optional_server_settings.each { |s| server_def[s] = config[s] if config[s] } # rubocop:disable Metrics/LineLength
|
122
131
|
server_def
|
123
132
|
end
|
124
133
|
|
@@ -127,7 +136,9 @@ module Kitchen
|
|
127
136
|
end
|
128
137
|
|
129
138
|
def optional_server_settings
|
130
|
-
|
139
|
+
Fog::Compute::OpenStack.recognized.select do |k|
|
140
|
+
k.to_s.start_with?('openstack')
|
141
|
+
end - required_server_settings
|
131
142
|
end
|
132
143
|
|
133
144
|
def network
|
@@ -323,14 +334,14 @@ module Kitchen
|
|
323
334
|
if bourne_shell?
|
324
335
|
info 'Adding OpenStack hint for ohai'
|
325
336
|
mkdir_cmd = "sudo mkdir -p #{hints_path}"
|
326
|
-
touch_cmd = "sudo
|
337
|
+
touch_cmd = "sudo cat '{}' >> #{hints_path}/openstack.json"
|
327
338
|
instance.transport.connection(state).execute(
|
328
339
|
"#{mkdir_cmd} && #{touch_cmd}"
|
329
340
|
)
|
330
341
|
elsif windows_os?
|
331
342
|
info 'Adding OpenStack hint for ohai'
|
332
343
|
mkdir_cmd = "mkdir #{hints_path}"
|
333
|
-
touch_cmd = "'' > #{hints_path}\\openstack.json"
|
344
|
+
touch_cmd = "'{}' > #{hints_path}\\openstack.json"
|
334
345
|
instance.transport.connection(state).execute(
|
335
346
|
"#{mkdir_cmd} && #{touch_cmd}"
|
336
347
|
)
|
@@ -232,6 +232,14 @@ describe Kitchen::Driver::Openstack do
|
|
232
232
|
driver.create(state)
|
233
233
|
end
|
234
234
|
end
|
235
|
+
|
236
|
+
context 'when a server is already created' do
|
237
|
+
it 'does not create a new instance' do
|
238
|
+
state[:server_id] = '123'
|
239
|
+
expect(driver).not_to receive(:create_server)
|
240
|
+
driver.create(state)
|
241
|
+
end
|
242
|
+
end
|
235
243
|
end
|
236
244
|
|
237
245
|
describe '#destroy' do
|
@@ -330,10 +338,10 @@ describe Kitchen::Driver::Openstack do
|
|
330
338
|
|
331
339
|
describe '#optional_server_settings' do
|
332
340
|
it 'returns the optional settings for an OpenStack server' do
|
333
|
-
|
334
|
-
:
|
341
|
+
excluded = [
|
342
|
+
:openstack_username, :openstack_api_key, :openstack_auth_url
|
335
343
|
]
|
336
|
-
expect(driver.send(:optional_server_settings)).
|
344
|
+
expect(driver.send(:optional_server_settings)).not_to include(*excluded)
|
337
345
|
end
|
338
346
|
end
|
339
347
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-openstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.dev.
|
4
|
+
version: 2.0.0.dev.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Hartman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-09-
|
12
|
+
date: 2015-09-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: test-kitchen
|