Skip to content
Snippets Groups Projects
Verified Commit 09ff7fc2 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

update formatting of provisioning_proxy pages

parent ffbd0a2b
No related branches found
No related tags found
1 merge request!13update formatting of provisioning_proxy pages
......@@ -4,6 +4,7 @@ import logging
import requests
from orchestrator import inputstep
from orchestrator.config.assignee import Assignee
from orchestrator.domain import SubscriptionModel
# noinspection PyProtectedMember
from orchestrator.forms import FormPage, ReadOnlyField
from orchestrator.forms.validators import Accept, Label, LongText
......@@ -67,7 +68,8 @@ def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr,
request = requests.delete(url, json=parameters)
if request.status_code != 200:
raise AssertionError(request.text)
print(request.content)
raise AssertionError(request.content)
def provision_device(
......@@ -162,15 +164,16 @@ def deprovision_ip_trunk(subscription: Iptrunk,
@inputstep('Await provisioning proxy results', assignee=Assignee('SYSTEM'))
def await_pp_results() -> State:
def await_pp_results(subscription: SubscriptionModel) -> State:
class ProvisioningResultPage(FormPage):
class Config:
title = 'Do NOT click on confirm in this step!'
title = f'Deploying {subscription.product.name}...'
warning_label: Label = 'This step relies on an external service to ' \
'send an update to the orchestrator, do not ' \
'interfere with this process please.'
pp_run_results: dict = {'state': 'not_ready'}
warning_label: Label = f'{subscription.product.description} is being' \
f' deployed right now. Feel free to refresh ' \
f'this page every now and again. Just be ' \
f'sure that you do NOT click submit!'
pp_run_results: dict = None
confirm: Accept = Accept('INCOMPLETE')
result_page = yield ProvisioningResultPage
......@@ -182,7 +185,9 @@ def await_pp_results() -> State:
def confirm_pp_results(state: State) -> State:
class ConfirmRunPage(FormPage):
class Config:
title = 'Execution completed, please confirm the results.'
title = f"Execution for " \
f"{state['subscription']['product']['name']} " \
f"completed, please confirm the results below."
run_status: str = ReadOnlyField(state['pp_run_results']['status'])
run_results: LongText = ReadOnlyField(
......
......@@ -122,8 +122,8 @@ def initialize_subscription(
'.geant.net')
subscription.device.device_fqdn = fqdn
subscription.device.device_role = device_role
subscription.description = f'Device {fqdn} type \
({subscription.device_type})'
subscription.description = f'Device {fqdn} ' \
f'({subscription.device_type})'
subscription = device.DeviceProvisioning.from_other_lifecycle(
subscription, SubscriptionLifecycle.PROVISIONING
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment