support hardcoded suspend plan for exoscale
All checks were successful
Tests / test (push) Successful in 27s
All checks were successful
Tests / test (push) Successful in 27s
This commit is contained in:
parent
208f3c357d
commit
3e17e03da9
1 changed files with 17 additions and 12 deletions
|
|
@ -233,6 +233,9 @@ The Servala Team"""
|
|||
|
||||
try:
|
||||
service = Service.objects.get(osb_service_id=service_id)
|
||||
# Special handling: when plan_id is "suspend", don't lookup service_offering
|
||||
service_offering = None
|
||||
if plan_id != "suspend":
|
||||
service_offering = ServiceOffering.objects.get(
|
||||
osb_plan_id=plan_id, service=service
|
||||
)
|
||||
|
|
@ -258,7 +261,7 @@ The Servala Team"""
|
|||
return self.request.build_absolute_uri(admin_path)
|
||||
|
||||
def _create_action_helpdesk_ticket(
|
||||
self, request, action, instance_id, service, service_offering, users=None
|
||||
self, request, action, instance_id, service, service_offering=None, users=None
|
||||
):
|
||||
"""
|
||||
Create an Odoo helpdesk ticket for offboarding or suspension actions.
|
||||
|
|
@ -269,11 +272,12 @@ The Servala Team"""
|
|||
organization = None
|
||||
try:
|
||||
# Look for instances with this name in the service offering's context
|
||||
filter_kwargs = {"name": instance_id}
|
||||
if service_offering:
|
||||
filter_kwargs["context__service_offering"] = service_offering
|
||||
|
||||
service_instance = (
|
||||
ServiceInstance.objects.filter(
|
||||
name=instance_id,
|
||||
context__service_offering=service_offering,
|
||||
)
|
||||
ServiceInstance.objects.filter(**filter_kwargs)
|
||||
.select_related("organization")
|
||||
.first()
|
||||
)
|
||||
|
|
@ -302,6 +306,7 @@ The Servala Team"""
|
|||
else:
|
||||
description_parts.append(f"Instance: {instance_id}")
|
||||
|
||||
if service_offering:
|
||||
offering_url = self._get_admin_url(
|
||||
"core_serviceoffering_change", service_offering.pk
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue