Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail Cinder/Swift Ensures if Service not Present #17067

Merged
merged 4 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def initialize(ems, options = nil)
@data = {}
@data_index = {}

@cinder_service = ems.parent_manager.cinder_service
@cinder_service = ems.parent_manager&.cinder_service
end

def ems_inv_to_hashes
Expand All @@ -39,21 +39,21 @@ def ems_inv_to_hashes
end

def volumes
@volumes ||= @cinder_service.handled_list(:volumes)
@volumes ||= @cinder_service&.handled_list(:volumes)
end

def get_volumes
process_collection(volumes, :cloud_volumes) { |volume| parse_volume(volume) }
end

def get_snapshots
process_collection(@cinder_service.handled_list(:list_snapshots_detailed,
process_collection(@cinder_service&.handled_list(:list_snapshots_detailed,
:__request_body_index => "snapshots"),
:cloud_volume_snapshots) { |snap| parse_snapshot(snap) }
end

def get_backups
process_collection(@cinder_service.list_backups_detailed.body["backups"],
process_collection(@cinder_service&.list_backups_detailed.body["backups"],
:cloud_volume_backups) { |backup| parse_backup(backup) }
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize(ems, options = nil)
@data = {}
@data_index = {}

@swift_service = ems.parent_manager.swift_service
@swift_service = ems.parent_manager&.swift_service
end

def ems_inv_to_hashes
Expand Down
2 changes: 1 addition & 1 deletion spec/models/manageiq/providers/cloud_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
end

context "OpenStack CloudTenant Mapping" do
let(:ems_cloud) { FactoryGirl.create(:ems_openstack, :tenant_mapping_enabled => true) }
let(:ems_cloud) { FactoryGirl.create(:ems_openstack_with_authentication, :tenant_mapping_enabled => true) }
let(:ems_infra) { FactoryGirl.create(:ext_management_system) }

describe "#supports_cloud_tenant_mapping" do
Expand Down