kitchen-openstack 3.3.0 → 3.4.0

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
  SHA1:
3
- metadata.gz: d66ce0ff71e2179911c7fa1b6537621df9807ac0
4
- data.tar.gz: d1c8922782d6c668225bb025bbbadb49db017c89
3
+ metadata.gz: 84ee970244371b0d525d62e3de2683562249fc49
4
+ data.tar.gz: 9fbd1af6fc48fa29385f04c851d92e3ac91aabf0
5
5
  SHA512:
6
- metadata.gz: 4938e5b6b9ee42907c96afdb8440699c85dc61d8572d92371d40a1497a8bbe333502277bb9836e3b5b11a59ea0ea130b4ebc8230d0442d475abbb2bd3293e5af
7
- data.tar.gz: 6dcd850d52c56601b4b77426cd45fdb7afc23992f0cd0a049cfd4886f2a648df5ae35aa420c0ddcdedc291bf380f81fd5cd0778ce8139022257c11ed3b7d3708
6
+ metadata.gz: 480bf5ffa70f5eab36da5c14d4b32a9ae2c841c893af0cda92268bfe193ba35dfc841e12f647791e8da1b88c17484ce806d66b8a9046d17a70ffedf30ce9bd44
7
+ data.tar.gz: bc296c784c1c1fe36394cd7de4ca636a6f00c350530e677039725133096c9b764d7e45a8fd0cccf3fc3d7a05266f866a0de72def187d5ed797fecf82ef4386be
data/CHANGELOG.md CHANGED
@@ -1,7 +1,22 @@
1
1
  # Change Log
2
2
 
3
- ## [v3.3.0](https://github.com/test-kitchen/kitchen-openstack/tree/v3.3.0)
3
+ ## [Unreleased](https://github.com/test-kitchen/kitchen-openstack/tree/v3.4.0)
4
4
 
5
+ [Full Changelog](https://github.com/test-kitchen/kitchen-openstack/compare/v3.3.0...v3.4.0)
6
+
7
+ **Closed issues:**
8
+
9
+ - Multiple networks in network\_id causes error [\#163](https://github.com/test-kitchen/kitchen-openstack/issues/163)
10
+ - Can't create VM [\#160](https://github.com/test-kitchen/kitchen-openstack/issues/160)
11
+ - Why is private\_key\_path required? [\#151](https://github.com/test-kitchen/kitchen-openstack/issues/151)
12
+ - version 3.1.0 does not properly wait for VM to be up before failing [\#147](https://github.com/test-kitchen/kitchen-openstack/issues/147)
13
+
14
+ **Merged pull requests:**
15
+
16
+ - Fix creation of floating IP to use network ID instead of name [\#162](https://github.com/test-kitchen/kitchen-openstack/pull/162) ([dannytrigo](https://github.com/dannytrigo))
17
+ - Updated readme with clarity [\#161](https://github.com/test-kitchen/kitchen-openstack/pull/161) ([jjasghar](https://github.com/jjasghar))
18
+
19
+ ## [v3.3.0](https://github.com/test-kitchen/kitchen-openstack/tree/v3.3.0) (2017-03-13)
5
20
  [Full Changelog](https://github.com/test-kitchen/kitchen-openstack/compare/v3.2.0...v3.3.0)
6
21
 
7
22
  **Merged pull requests:**
data/README.md CHANGED
@@ -49,7 +49,7 @@ driver:
49
49
  name: openstack
50
50
  openstack_username: [YOUR OPENSTACK USERNAME]
51
51
  openstack_api_key: [YOUR OPENSTACK API KEY] # AKA your OpenStack Password
52
- openstack_auth_url: [YOUR OPENSTACK AUTH URL]
52
+ openstack_auth_url: [YOUR OPENSTACK AUTH URL] # if you are using v3, API_URL/v3/auth/tokens
53
53
  require_chef_omnibus: [e.g. 'true' or a version number if you need Chef]
54
54
  image_ref: [SERVER IMAGE ID]
55
55
  flavor_ref: [SERVER FLAVOR ID]
@@ -79,7 +79,7 @@ All of Fog's `openstack` options (`openstack_domain_name`, `openstack_project_na
79
79
 
80
80
  ### openstack\_auth\_url
81
81
 
82
- **Required** Your OpenStack auth url.
82
+ **Required** Your OpenStack auth url. If you are using ID v3, you'll need to use `API_URL/v3/auth/tokens`.
83
83
 
84
84
  ### require\_chef_omnibus
85
85
 
@@ -93,7 +93,7 @@ All of Fog's `openstack` options (`openstack_domain_name`, `openstack_project_na
93
93
 
94
94
  **image_ref or image_id required** Server Image ID. Specifying the ID instead of reference results in a faster create time.
95
95
 
96
- **Note** If the image UUID changes this value will need to be updated.
96
+ **Note** If the image UUID changes this value will need to be updated.
97
97
 
98
98
  ### flavor\_ref
99
99
 
@@ -214,7 +214,7 @@ network_ref:
214
214
 
215
215
  A list of network ids to create instances with. Specifying the id instead of reference results in a faster create time.
216
216
 
217
- **Note** If the network UUID changes this value will need to be updated.
217
+ **Note** If the network UUID changes this value will need to be updated.
218
218
 
219
219
  ```yaml
220
220
  network_ref:
@@ -339,7 +339,7 @@ assuming that test network is configured as private.
339
339
  ### use_ipv6
340
340
 
341
341
  If true use IPv6 addresses to for SSH connections. If false, the default, use
342
- IPv4 addresses for SSH connections.
342
+ IPv4 addresses for SSH connections.
343
343
 
344
344
  ### network\_ref
345
345
 
@@ -109,11 +109,17 @@ module Kitchen
109
109
 
110
110
  unless server.nil?
111
111
  if config[:floating_ip_pool] && config[:allocate_floating_ip]
112
- ip = get_ip(server)
113
- floating_ip_id = network.list_floating_ips(floating_ip_address: ip)
114
- .body['floatingips'][0]['id']
115
- network.delete_floating_ip(floating_ip_id)
116
- info "OpenStack Floating IP <#{ip}> released."
112
+ info 'Retrieve the floating IP'
113
+ pub, priv = get_public_private_ips(server)
114
+ pub, = parse_ips(pub, priv)
115
+ pub_ip = pub[config[:public_ip_order].to_i] || nil
116
+ if pub_ip
117
+ info "Retrieve the ID of floating IP <#{pub_ip}>"
118
+ floating_ip_id = network.list_floating_ips(floating_ip_address: pub_ip) # rubocop:disable Metrics/LineLength
119
+ .body['floatingips'][0]['id']
120
+ network.delete_floating_ip(floating_ip_id)
121
+ info "OpenStack Floating IP <#{pub_ip}> released."
122
+ end
117
123
  end
118
124
  server.destroy
119
125
  end
@@ -289,9 +295,11 @@ module Kitchen
289
295
  @@ip_pool_lock.synchronize do
290
296
  info "Attaching floating IP from <#{pool}> pool"
291
297
  if config[:allocate_floating_ip]
292
- resp = network.create_floating_ip(pool)
298
+ network_id = network.list_networks(name: pool)
299
+ .body['networks'][0]['id']
300
+ resp = network.create_floating_ip(network_id)
293
301
  ip = resp.body['floatingip']['floating_ip_address']
294
- info "Attaching floating IP from <#{pool}> pool"
302
+ info "Created floating IP <#{ip}> from <#{pool}> pool"
295
303
  config[:floating_ip] = ip
296
304
  else
297
305
  free_addrs = compute.addresses.map do |i|
@@ -22,6 +22,6 @@ module Kitchen
22
22
  #
23
23
  # @author Jonathan Hartman <j@p4nt5.com>
24
24
  module Driver
25
- OPENSTACK_VERSION = '3.3.0'.freeze
25
+ OPENSTACK_VERSION = '3.4.0'.freeze
26
26
  end
27
27
  end
@@ -293,7 +293,7 @@ describe Kitchen::Driver::Openstack do
293
293
 
294
294
  let(:driver) do
295
295
  d = super()
296
- allow(d).to receive(:get_ip).and_return(ip)
296
+ allow(d).to receive(:get_public_private_ips).and_return([ip, nil])
297
297
  allow(d).to receive(:compute).and_return(compute)
298
298
  allow(d).to receive(:network).and_return(network)
299
299
  d
@@ -952,14 +952,18 @@ describe Kitchen::Driver::Openstack do
952
952
  let(:server) { nil }
953
953
  let(:pool) { 'swimmers' }
954
954
  let(:config) { { allocate_floating_ip: true } }
955
+ let(:network_id) { 123 }
955
956
  let(:ip) { '1.1.1.1' }
956
957
  let(:address) do
957
958
  double(ip: ip, fixed_ip: nil, instance_id: nil, pool: pool)
958
959
  end
959
- let(:network_response) do
960
+ let(:list_networks_response) do
961
+ double(body: { 'networks' => [{ 'name' => pool, 'id' => network_id }] })
962
+ end
963
+ let(:create_ip_network_response) do
960
964
  double(body: { 'floatingip' => { 'floating_ip_address' => ip } })
961
965
  end
962
- let(:network) { double(create_floating_ip: network_response) }
966
+ let(:network) { double(list_networks: list_networks_response, create_floating_ip: create_ip_network_response) } # rubocop:disable Metrics/LineLength
963
967
 
964
968
  before(:each) do
965
969
  allow(driver).to receive(:attach_ip).with(server, ip).and_return('bing!')
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: 3.3.0
4
+ version: 3.4.0
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: 2017-03-13 00:00:00.000000000 Z
12
+ date: 2017-03-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-kitchen