kitchen-openstack 7.0.0 → 7.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 431a4cae8533390ccb721da8645f872bcf4703cf09b3c4fecdbab3b52bb2050a
4
- data.tar.gz: 3e0718cd558cac16cbd62d206a4a701cb64ee178ee5215fbfd37cd3868191cc6
3
+ metadata.gz: 1f6ada19a9cfed5b59243e8ce7692c0154af0c58d8f644f7767a5ae0c7250854
4
+ data.tar.gz: 4acb3ae040435e3cc9701e34f524bb4840760ff934d777632414a07709e52368
5
5
  SHA512:
6
- metadata.gz: 2e71554edd9c953b862d67a76b05474ceba4ebe5b083051a215301eaad9119484e497be16da6b16096218bdcfc716af6b47921a5823ca3a894227212bfe834dc
7
- data.tar.gz: aecfb9894b8d57324b94e388d01d56e92d04c92ec811d3e0a0a977930a2f10ec9932e3e8e068dce03c97577a19121d829608c4f06313a8d4a9209028c75257c5
6
+ metadata.gz: a87b14b12ce6f527b972b64aaf8c5a12b0e6fa4f6383fc9613462114bf44ce58623dfbb389d3a2f2b5858f957d6fe086de2750d8eeb502e94ec0252edf315a5a
7
+ data.tar.gz: 28abcfff62bfba75b479db29553a25e1ea4eaa3b53d7d247ac83741eb9a084191b1e369d713f86837479f07d7c024b4bca5da6e2deca4c512097709f86867c9b
@@ -48,6 +48,10 @@ module Kitchen
48
48
  "identity_api_version" => :openstack_identity_api_version,
49
49
  }.freeze
50
50
 
51
+ # Fog expects these config values to be strings. YAML may parse
52
+ # unquoted scalars as integers/booleans, so normalize on ingest.
53
+ STRING_CONFIG_KEYS = (CLOUDS_YAML_AUTH_MAP.values + CLOUDS_YAML_TOP_MAP.values).freeze
54
+
51
55
  # Mapping of OS_* environment variables to Fog OpenStack config keys
52
56
  ENV_VAR_MAP = {
53
57
  "OS_AUTH_URL" => :openstack_auth_url,
@@ -100,7 +104,7 @@ module Kitchen
100
104
  result = {}
101
105
  ENV_VAR_MAP.each do |env_var, fog_key|
102
106
  value = ENV[env_var]
103
- result[fog_key] = value if value && !value.empty?
107
+ result[fog_key] = normalize_config_value(fog_key, value) if value && !value.empty?
104
108
  end
105
109
  result
106
110
  end
@@ -175,12 +179,14 @@ module Kitchen
175
179
  # Map auth section
176
180
  auth = cloud["auth"] || {}
177
181
  CLOUDS_YAML_AUTH_MAP.each do |yaml_key, fog_key|
178
- result[fog_key] = auth[yaml_key] if auth[yaml_key]
182
+ value = auth[yaml_key]
183
+ result[fog_key] = normalize_config_value(fog_key, value) if value
179
184
  end
180
185
 
181
186
  # Map top-level keys
182
187
  CLOUDS_YAML_TOP_MAP.each do |yaml_key, fog_key|
183
- result[fog_key] = cloud[yaml_key] if cloud[yaml_key]
188
+ value = cloud[yaml_key]
189
+ result[fog_key] = normalize_config_value(fog_key, value) if value
184
190
  end
185
191
 
186
192
  # SSL settings
@@ -189,6 +195,12 @@ module Kitchen
189
195
 
190
196
  result
191
197
  end
198
+
199
+ def normalize_config_value(fog_key, value)
200
+ return value unless STRING_CONFIG_KEYS.include?(fog_key)
201
+
202
+ value.to_s
203
+ end
192
204
  end
193
205
  end
194
206
  end
@@ -36,6 +36,27 @@ module Kitchen
36
36
  module Driver
37
37
  # This takes from the Base Class and creates the OpenStack driver.
38
38
  class Openstack < Kitchen::Driver::Base
39
+ FOG_STRING_SETTINGS = %i{
40
+ openstack_username
41
+ openstack_api_key
42
+ openstack_auth_url
43
+ openstack_project_name
44
+ openstack_project_id
45
+ openstack_user_domain
46
+ openstack_user_domain_id
47
+ openstack_project_domain
48
+ openstack_project_domain_id
49
+ openstack_domain_id
50
+ openstack_domain_name
51
+ openstack_region
52
+ openstack_endpoint_type
53
+ openstack_identity_api_version
54
+ openstack_application_credential_id
55
+ openstack_application_credential_secret
56
+ openstack_tenant
57
+ openstack_tenant_id
58
+ }.freeze
59
+
39
60
  include Clouds
40
61
  include Config
41
62
  include Helpers
@@ -149,8 +170,8 @@ module Kitchen
149
170
  server_def = {
150
171
  connection_options: {},
151
172
  }
152
- required_server_settings.each { |s| server_def[s] = config[s] }
153
- optional_server_settings.each { |s| server_def[s] = config[s] if config[s] }
173
+ required_server_settings.each { |s| server_def[s] = normalize_fog_setting(s, config[s]) }
174
+ optional_server_settings.each { |s| server_def[s] = normalize_fog_setting(s, config[s]) if config[s] }
154
175
  connection_options.each { |s| server_def[:connection_options][s] = config[s] if config[s] }
155
176
  server_def
156
177
  end
@@ -184,6 +205,30 @@ module Kitchen
184
205
  def get_bdm(config)
185
206
  volume.get_bdm(config, openstack_server)
186
207
  end
208
+
209
+ def normalize_fog_setting(setting, value)
210
+ return value if value.nil?
211
+ return normalize_identity_api_version(value) if setting == :openstack_identity_api_version
212
+ return value unless FOG_STRING_SETTINGS.include?(setting)
213
+
214
+ value.to_s
215
+ end
216
+
217
+ # Fog::Service#coerce_options re-coerces any value where
218
+ # `value.to_s.to_i.to_s == value.to_s` back to an Integer, which
219
+ # then breaks Fog::OpenStack::Auth::Token.build (it calls `=~`
220
+ # on the value). Prefixing with "v" keeps Fog from coercing and
221
+ # still satisfies Token.build's `/(v)*2(\.0)*/i` regex check.
222
+ def normalize_identity_api_version(value)
223
+ str = value.to_s.strip
224
+ return str if str.empty?
225
+ return str if str.start_with?("v", "V")
226
+
227
+ case str
228
+ when "2", "2.0" then "v2.0"
229
+ else "v#{str}"
230
+ end
231
+ end
187
232
  end
188
233
  end
189
234
  end
@@ -23,6 +23,6 @@ module Kitchen
23
23
  #
24
24
  # @author Jonathan Hartman <j@p4nt5.com>
25
25
  module Driver
26
- OPENSTACK_VERSION = "7.0.0"
26
+ OPENSTACK_VERSION = "7.0.1"
27
27
  end
28
28
  end
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: 7.0.0
4
+ version: 7.0.1
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: 2026-04-07 00:00:00.000000000 Z
12
+ date: 2026-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-kitchen