Commit 38654b56 authored by Łukasz Nowak's avatar Łukasz Nowak

Support delivery-less instances.

parent bb1826f7
...@@ -1060,6 +1060,15 @@ class SlapTool(BaseTool): ...@@ -1060,6 +1060,15 @@ class SlapTool(BaseTool):
instance = self._getSoftwareInstanceForComputerPartition( instance = self._getSoftwareInstanceForComputerPartition(
computer_id, computer_id,
computer_partition_id) computer_partition_id)
if instance.getSlapState() == 'destroy_requested':
# remove certificate from SI
if instance.getSslKey() is not None or instance.getSslCertificate() is not None:
instance.edit(
ssl_key=None,
ssl_certificate=None,
)
if instance.getValidationState() == 'validated':
instance.invalidate()
delivery = instance.getCausalityValue(portal_type=["Sale Packing List"]) delivery = instance.getCausalityValue(portal_type=["Sale Packing List"])
if delivery is not None: if delivery is not None:
portal = self.getPortalObject() portal = self.getPortalObject()
...@@ -1083,13 +1092,6 @@ class SlapTool(BaseTool): ...@@ -1083,13 +1092,6 @@ class SlapTool(BaseTool):
# even if certificate was already revoked # even if certificate was already revoked
pass pass
# remove certificate from SI
instance.edit(
ssl_key=None,
ssl_certificate=None,
)
instance.invalidate()
@convertToREST @convertToREST
def _setComputerPartitionConnectionXml(self, computer_id, def _setComputerPartitionConnectionXml(self, computer_id,
......
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