From 3c1c6b97a939e6236b8e4d06d288a4e8fd52cc19 Mon Sep 17 00:00:00 2001 From: Jerry Keselman Date: Mon, 17 Apr 2017 14:10:24 -0400 Subject: [PATCH] Fix StorageManagers Cross Linkers Fix Cinder and Swift Cross Linkers to make sure valid data is available before processing. Cinder should have Volumes, Backups, or Snapshots. Swift must have Object Storage. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1441144. --- .../cinder_manager/refresh_parser/cross_linkers.rb | 4 ++++ .../swift_manager/refresh_parser/cross_linkers.rb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/models/manageiq/providers/storage_manager/cinder_manager/refresh_parser/cross_linkers.rb b/app/models/manageiq/providers/storage_manager/cinder_manager/refresh_parser/cross_linkers.rb index 7003bc745af..5150978c188 100644 --- a/app/models/manageiq/providers/storage_manager/cinder_manager/refresh_parser/cross_linkers.rb +++ b/app/models/manageiq/providers/storage_manager/cinder_manager/refresh_parser/cross_linkers.rb @@ -5,6 +5,10 @@ def self.cross_link(ems, data) _log.warn "Manager does not have a parent." return end + unless data + _log.warn "Manager does not have volumes, snapshots, or volume backups." + return + end parent_type = parent_manager.class.ems_type _log.debug "Parent type: #{parent_type}" diff --git a/app/models/manageiq/providers/storage_manager/swift_manager/refresh_parser/cross_linkers.rb b/app/models/manageiq/providers/storage_manager/swift_manager/refresh_parser/cross_linkers.rb index 5863f2daa90..103d4362bc6 100644 --- a/app/models/manageiq/providers/storage_manager/swift_manager/refresh_parser/cross_linkers.rb +++ b/app/models/manageiq/providers/storage_manager/swift_manager/refresh_parser/cross_linkers.rb @@ -5,6 +5,10 @@ def self.cross_link(ems, data) _log.warn "Manager does not have a parent." return end + unless data + _log.warn "Manager does not have any object storage." + return + end parent_type = parent_manager.class.ems_type _log.debug "Parent type: #{parent_type}"