Skip to content

Commit a6a19dd

Browse files
committed
Bump ruby, fog-core
1 parent 6edf362 commit a6a19dd

File tree

10 files changed

+56
-23
lines changed

10 files changed

+56
-23
lines changed

.ruby-version

-1
This file was deleted.

.travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ env:
1010
matrix:
1111
fast_finish: true
1212
include:
13-
- rvm: 2.2.0
13+
- rvm: 2.2.10
1414
gemfile: Gemfile
15-
- rvm: 2.3.0
15+
- rvm: 2.3.7
1616
gemfile: Gemfile
17-
- rvm: 2.3.1
17+
- rvm: 2.4.4
1818
gemfile: Gemfile
19-
- rvm: 2.4.2
19+
- rvm: 2.5.1
2020
gemfile: Gemfile
2121
- rvm: jruby-head
2222
gemfile: Gemfile

.zuul.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
run: playbooks/fog-openstack-unittest-test/run.yaml
1313
vars:
1414
rvm:
15-
2.2.0
16-
2.3.0
17-
2.3.1
18-
2.4.2
15+
2.2.10
16+
2.3.7
17+
2.4.4
18+
2.5.1
1919
jruby-head
2020
nodeset: ubuntu-xenial
2121

@@ -27,9 +27,9 @@
2727
run: playbooks/fog-openstack-unittest-spec/run.yaml
2828
vars:
2929
rvm:
30-
2.2.0
31-
2.3.0
32-
2.3.1
33-
2.4.2
30+
2.2.10
31+
2.3.7
32+
2.4.4
33+
2.5.1
3434
jruby-head
3535
nodeset: ubuntu-xenial

fog-openstack.gemspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
1919
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
2020
spec.require_paths = ["lib"]
2121

22-
spec.required_ruby_version = '>= 2.1.0'
22+
spec.required_ruby_version = '>= 2.2.0'
2323

24-
spec.add_dependency 'fog-core', '~> 1.40'
24+
spec.add_dependency 'fog-core', '~> 2.1'
2525
spec.add_dependency 'fog-json', '>= 1.0'
2626
spec.add_dependency 'ipaddress', '>= 0.8'
2727

lib/fog/compute/openstack/models/server.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def metadata
8282
def metadata=(new_metadata = {})
8383
return unless new_metadata
8484
metas = []
85-
new_metadata.each_pair { |k, v| metas << {"key" => k, "value" => v} }
85+
new_metadata.each { |k, v| metas << {"key" => k, "value" => v} }
8686
@metadata = metadata.load(metas)
8787
end
8888

lib/fog/image/openstack/v2/models/image.rb

+17
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,23 @@ class Image < Fog::OpenStack::Model
4141
attribute :instance_uuid
4242
attribute :user_id
4343

44+
# Overload super class since behaviour as changed since fog-core 1.40.0
45+
# https://github.com/fog/fog-core/issues/236
46+
def reload
47+
requires :identity
48+
49+
object = collection.get(identity)
50+
51+
return unless object
52+
53+
merge_attributes(object.attributes)
54+
merge_attributes(object.all_associations)
55+
56+
self
57+
rescue Excon::Errors::SocketError
58+
nil
59+
end
60+
4461
def method_missing(method_sym, *arguments, &block)
4562
if attributes.key?(method_sym)
4663
attributes[method_sym]

lib/fog/network/openstack/models/network.rb

+17
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,23 @@ class Network < Fog::OpenStack::Model
1717
attribute :provider_segmentation_id, :aliases => 'provider:segmentation_id'
1818
attribute :router_external, :aliases => 'router:external'
1919

20+
# Overload super class since behaviour as changed since fog-core 1.40.0
21+
# https://github.com/fog/fog-core/issues/236
22+
def reload
23+
requires :identity
24+
25+
object = collection.get(identity)
26+
27+
return unless object
28+
29+
merge_attributes(object.attributes)
30+
merge_attributes(object.all_associations)
31+
32+
self
33+
rescue Excon::Errors::SocketError
34+
nil
35+
end
36+
2037
def subnets
2138
service.subnets.select { |s| s.network_id == id }
2239
end

spec/identity_v3_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@
677677
booboo_parents[booboo_parent_id].length.must_equal 1
678678
booboo_grandparent_id = booboo_parents[booboo_parent_id].keys.first
679679
booboo_grandparent_id.must_equal foobar_id
680-
booboo_parents[booboo_parent_id][booboo_grandparent_id].must_equal nil
680+
assert_nil booboo_parents[booboo_parent_id][booboo_grandparent_id]
681681

682682
# Get the parents of booboo, as a list of objects
683683
booboo_parents = @service.projects.find_by_id(booboo_id, :parents_as_list).parents

spec/monitoring_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@
7272

7373
# failure cases
7474
proc { @service.metrics.create(:name => "this won't be created due to insufficient args") }.
75-
must_raise Fog::Monitoring::OpenStack::ArgumentError
75+
must_raise ArgumentError
7676
proc { @service.metrics.create(:name => "this wont't be created due to invalid timestamp", :timestamp => 1234) }.
77-
must_raise Fog::Monitoring::OpenStack::ArgumentError
77+
must_raise ArgumentError
7878
end
7979
end
8080

@@ -143,7 +143,7 @@
143143

144144
# failure cases
145145
proc { @service.notification_methods.create(:name => "this won't be created due to insufficient args") }.
146-
must_raise Fog::Monitoring::OpenStack::ArgumentError
146+
must_raise ArgumentError
147147
proc { @service.notification_methods.find_by_id('bogus_id') }.must_raise Fog::Monitoring::OpenStack::NotFound
148148

149149
ensure
@@ -220,7 +220,7 @@
220220

221221
# failure cases
222222
proc { @service.alarm_definitions.create(:name => "this won't be created due to insufficient args") }.
223-
must_raise Fog::Monitoring::OpenStack::ArgumentError
223+
must_raise ArgumentError
224224

225225
ensure
226226
alarm_definition.destroy if alarm_definition

spec/volume_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def cleanup_test_object(collection, id)
294294
)
295295

296296
# check that recipient cannot see the transfer object
297-
other_service.transfers.get(transfer.id).must_equal nil
297+
assert_nil other_service.transfers.get(transfer.id)
298298
other_service.transfers.all(:name => transfer_name).length.must_equal 0
299299

300300
# # check that recipient cannot see the volume before transfer
@@ -334,7 +334,7 @@ def cleanup_test_object(collection, id)
334334

335335
# check that the transfer object is gone on both sides
336336
[@service, other_service].each do |service|
337-
service.transfers.get(transfer.id).must_equal nil
337+
assert_nil service.transfers.get(transfer.id)
338338
service.transfers.all(:name => transfer_name).length.must_equal 0
339339
end
340340
ensure

0 commit comments

Comments
 (0)