From 5e1bf7764350976cd4844581ed60ba653fc35a37 Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Tue, 23 Jan 2018 15:13:57 -0500 Subject: [PATCH] Don't dependent => destroy child managers Destroying child_managers is orchestrated by the parent and destroying them prematurely leads to issues when the endpoints are shared between the two managers. --- app/models/mixins/cinder_manager_mixin.rb | 3 +-- app/models/mixins/has_network_manager_mixin.rb | 3 +-- app/models/mixins/swift_manager_mixin.rb | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/models/mixins/cinder_manager_mixin.rb b/app/models/mixins/cinder_manager_mixin.rb index b699e2d4e91..c08b92613f7 100644 --- a/app/models/mixins/cinder_manager_mixin.rb +++ b/app/models/mixins/cinder_manager_mixin.rb @@ -7,8 +7,7 @@ module CinderManagerMixin has_one :cinder_manager, :foreign_key => :parent_ems_id, :class_name => "ManageIQ::Providers::StorageManager::CinderManager", - :autosave => true, - :dependent => :destroy + :autosave => true delegate :cloud_volumes, :cloud_volume_snapshots, diff --git a/app/models/mixins/has_network_manager_mixin.rb b/app/models/mixins/has_network_manager_mixin.rb index 43003804d37..7818043eaa8 100644 --- a/app/models/mixins/has_network_manager_mixin.rb +++ b/app/models/mixins/has_network_manager_mixin.rb @@ -5,8 +5,7 @@ module HasNetworkManagerMixin has_one :network_manager, :foreign_key => :parent_ems_id, :class_name => "ManageIQ::Providers::NetworkManager", - :autosave => true, - :dependent => :destroy + :autosave => true delegate :floating_ips, :security_groups, diff --git a/app/models/mixins/swift_manager_mixin.rb b/app/models/mixins/swift_manager_mixin.rb index 7456a4b4c46..8bcb8944749 100644 --- a/app/models/mixins/swift_manager_mixin.rb +++ b/app/models/mixins/swift_manager_mixin.rb @@ -5,8 +5,7 @@ module SwiftManagerMixin has_one :swift_manager, :foreign_key => :parent_ems_id, :class_name => "ManageIQ::Providers::StorageManager::SwiftManager", - :autosave => true, - :dependent => :destroy + :autosave => true delegate :cloud_object_store_containers, :cloud_object_store_objects,