Skip to content

Commit

Permalink
Bump ruby, fog-core
Browse files Browse the repository at this point in the history
  • Loading branch information
gildub committed Jun 21, 2018
1 parent 6edf362 commit a6a19dd
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 23 deletions.
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ env:
matrix:
fast_finish: true
include:
- rvm: 2.2.0
- rvm: 2.2.10
gemfile: Gemfile
- rvm: 2.3.0
- rvm: 2.3.7
gemfile: Gemfile
- rvm: 2.3.1
- rvm: 2.4.4
gemfile: Gemfile
- rvm: 2.4.2
- rvm: 2.5.1
gemfile: Gemfile
- rvm: jruby-head
gemfile: Gemfile
Expand Down
16 changes: 8 additions & 8 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
run: playbooks/fog-openstack-unittest-test/run.yaml
vars:
rvm:
2.2.0
2.3.0
2.3.1
2.4.2
2.2.10
2.3.7
2.4.4
2.5.1
jruby-head
nodeset: ubuntu-xenial

Expand All @@ -27,9 +27,9 @@
run: playbooks/fog-openstack-unittest-spec/run.yaml
vars:
rvm:
2.2.0
2.3.0
2.3.1
2.4.2
2.2.10
2.3.7
2.4.4
2.5.1
jruby-head
nodeset: ubuntu-xenial
4 changes: 2 additions & 2 deletions fog-openstack.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.required_ruby_version = '>= 2.1.0'
spec.required_ruby_version = '>= 2.2.0'

spec.add_dependency 'fog-core', '~> 1.40'
spec.add_dependency 'fog-core', '~> 2.1'
spec.add_dependency 'fog-json', '>= 1.0'
spec.add_dependency 'ipaddress', '>= 0.8'

Expand Down
2 changes: 1 addition & 1 deletion lib/fog/compute/openstack/models/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def metadata
def metadata=(new_metadata = {})
return unless new_metadata
metas = []
new_metadata.each_pair { |k, v| metas << {"key" => k, "value" => v} }
new_metadata.each { |k, v| metas << {"key" => k, "value" => v} }
@metadata = metadata.load(metas)
end

Expand Down
17 changes: 17 additions & 0 deletions lib/fog/image/openstack/v2/models/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ class Image < Fog::OpenStack::Model
attribute :instance_uuid
attribute :user_id

# Overload super class since behaviour as changed since fog-core 1.40.0
# https://github.com/fog/fog-core/issues/236
def reload
requires :identity

object = collection.get(identity)

return unless object

merge_attributes(object.attributes)
merge_attributes(object.all_associations)

self
rescue Excon::Errors::SocketError
nil
end

def method_missing(method_sym, *arguments, &block)
if attributes.key?(method_sym)
attributes[method_sym]
Expand Down
17 changes: 17 additions & 0 deletions lib/fog/network/openstack/models/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ class Network < Fog::OpenStack::Model
attribute :provider_segmentation_id, :aliases => 'provider:segmentation_id'
attribute :router_external, :aliases => 'router:external'

# Overload super class since behaviour as changed since fog-core 1.40.0
# https://github.com/fog/fog-core/issues/236
def reload
requires :identity

object = collection.get(identity)

return unless object

merge_attributes(object.attributes)
merge_attributes(object.all_associations)

self
rescue Excon::Errors::SocketError
nil
end

def subnets
service.subnets.select { |s| s.network_id == id }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/identity_v3_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@
booboo_parents[booboo_parent_id].length.must_equal 1
booboo_grandparent_id = booboo_parents[booboo_parent_id].keys.first
booboo_grandparent_id.must_equal foobar_id
booboo_parents[booboo_parent_id][booboo_grandparent_id].must_equal nil
assert_nil booboo_parents[booboo_parent_id][booboo_grandparent_id]

# Get the parents of booboo, as a list of objects
booboo_parents = @service.projects.find_by_id(booboo_id, :parents_as_list).parents
Expand Down
8 changes: 4 additions & 4 deletions spec/monitoring_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@

# failure cases
proc { @service.metrics.create(:name => "this won't be created due to insufficient args") }.
must_raise Fog::Monitoring::OpenStack::ArgumentError
must_raise ArgumentError
proc { @service.metrics.create(:name => "this wont't be created due to invalid timestamp", :timestamp => 1234) }.
must_raise Fog::Monitoring::OpenStack::ArgumentError
must_raise ArgumentError
end
end

Expand Down Expand Up @@ -143,7 +143,7 @@

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

ensure
Expand Down Expand Up @@ -220,7 +220,7 @@

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

ensure
alarm_definition.destroy if alarm_definition
Expand Down
4 changes: 2 additions & 2 deletions spec/volume_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def cleanup_test_object(collection, id)
)

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

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

# check that the transfer object is gone on both sides
[@service, other_service].each do |service|
service.transfers.get(transfer.id).must_equal nil
assert_nil service.transfers.get(transfer.id)
service.transfers.all(:name => transfer_name).length.must_equal 0
end
ensure
Expand Down

0 comments on commit a6a19dd

Please sign in to comment.