diff --git a/app/models/manageiq/providers/storage_manager/cinder_manager/refresh_parser.rb b/app/models/manageiq/providers/storage_manager/cinder_manager/refresh_parser.rb index 571aa3491bf..96992b2d294 100644 --- a/app/models/manageiq/providers/storage_manager/cinder_manager/refresh_parser.rb +++ b/app/models/manageiq/providers/storage_manager/cinder_manager/refresh_parser.rb @@ -19,7 +19,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 @@ -40,7 +40,7 @@ def ems_inv_to_hashes end def volumes - @volumes ||= @cinder_service.handled_list(:volumes) + @volumes ||= @cinder_service&.handled_list(:volumes) end def get_volumes @@ -48,13 +48,13 @@ def get_volumes 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 diff --git a/app/models/manageiq/providers/storage_manager/swift_manager/refresh_parser.rb b/app/models/manageiq/providers/storage_manager/swift_manager/refresh_parser.rb index 7c843a56a1f..e84d440931e 100644 --- a/app/models/manageiq/providers/storage_manager/swift_manager/refresh_parser.rb +++ b/app/models/manageiq/providers/storage_manager/swift_manager/refresh_parser.rb @@ -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 diff --git a/spec/models/manageiq/providers/cloud_manager_spec.rb b/spec/models/manageiq/providers/cloud_manager_spec.rb index 7143697386a..78818b0bbf5 100644 --- a/spec/models/manageiq/providers/cloud_manager_spec.rb +++ b/spec/models/manageiq/providers/cloud_manager_spec.rb @@ -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