Commit be0d00d6 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Update in case of conflict

parent 4692cf02
...@@ -103,9 +103,15 @@ def HostingSubscription_checkInstanceTreeMigrationConsistency(self, fixit=False) ...@@ -103,9 +103,15 @@ def HostingSubscription_checkInstanceTreeMigrationConsistency(self, fixit=False)
portal = self.getPortalObject() portal = self.getPortalObject()
# Do not use accessor, as backward compatibility will not be kept if self.getParentValue().getId() != "hosting_subscription_module":
# Skip if the document isn't on the hosting_subscription_module
return error_list
mod = __import__('erp5.portal_type', globals(), locals(), ['Instance Tree'])
klass = getattr(mod, 'Instance Tree')
if ((getattr(self, 'workflow_history', None) is not None) and if ((getattr(self, 'workflow_history', None) is not None) and
('hosting_subscription_workflow' in self.workflow_history)) or \ ('hosting_subscription_workflow' in self.workflow_history)) or \
(self.__class__ == klass) or \
(self.getProperty('sla_xml', None) is not None) or \ (self.getProperty('sla_xml', None) is not None) or \
([x for x in self.getCategoryList() if (x.startswith('predecessor/') or ([x for x in self.getCategoryList() if (x.startswith('predecessor/') or
x.startswith('successor/'))]): x.startswith('successor/'))]):
...@@ -117,9 +123,6 @@ def HostingSubscription_checkInstanceTreeMigrationConsistency(self, fixit=False) ...@@ -117,9 +123,6 @@ def HostingSubscription_checkInstanceTreeMigrationConsistency(self, fixit=False)
self.getParentValue()._delObject(hosting_subscription_id) self.getParentValue()._delObject(hosting_subscription_id)
mod = __import__('erp5.portal_type', globals(), locals(), ['Instance Tree'])
klass = getattr(mod, 'Instance Tree')
self.__class__ = klass self.__class__ = klass
# self.upgradeObjectClass(returnTrue, 'erp5.portal_type.Hosting Subscription', 'erp5.portal_type.Instance Tree', returnTrue) # self.upgradeObjectClass(returnTrue, 'erp5.portal_type.Hosting Subscription', 'erp5.portal_type.Instance Tree', returnTrue)
self.portal_type = 'Instance Tree' self.portal_type = 'Instance Tree'
......
...@@ -10,6 +10,7 @@ Computer | SlaposComputerConstraint ...@@ -10,6 +10,7 @@ Computer | SlaposComputerConstraint
Computer | Url Computer | Url
Email | SlaposEmailConstraint Email | SlaposEmailConstraint
Hosting Subscription | HostingSubscriptionUpgradeConstraint Hosting Subscription | HostingSubscriptionUpgradeConstraint
Instance Tree | HostingSubscriptionUpgradeConstraint
Instance Tree | InstanceTree Instance Tree | InstanceTree
Instance Tree | SlaposInstanceTreeConstraint Instance Tree | SlaposInstanceTreeConstraint
Instance Tree | SoftwareInstance Instance Tree | SoftwareInstance
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment