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

Add db migration and translation key

parent fefb0436
No related branches found
No related tags found
1 merge request!181Feature/cancel initial subscriptions
"""Add subscription cancellation workflow.
Revision ID: 734e36a3e70b
Revises: d61c0f92da1e
Create Date: 2024-03-21 13:03:08.981028
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '734e36a3e70b'
down_revision = 'd61c0f92da1e'
branch_labels = None
depends_on = None
from orchestrator.migrations.helpers import add_products_to_workflow_by_product_tag, create_workflow, delete_workflow, remove_products_from_workflow_by_product_tag
products = ["RTR", "IPTRUNK"]
new_workflows = [
{
"name": "cancel_subscription",
"target": "TERMINATE",
"description": "Cancel a subscription",
"product_type": "Site"
}
]
def upgrade() -> None:
conn = op.get_bind()
for workflow in new_workflows:
create_workflow(conn, workflow)
for product_tag in products:
add_products_to_workflow_by_product_tag(conn, "cancel_subscription", product_tag)
def downgrade() -> None:
conn = op.get_bind()
for product_tag in products:
remove_products_from_workflow_by_product_tag(conn, "cancel_subscription", product_tag)
for workflow in new_workflows:
delete_workflow(conn, workflow["name"])
......@@ -38,10 +38,12 @@
"workflow": {
"activate_iptrunk": "Activate IP Trunk",
"activate_router": "Activate router",
"cancel_subscription": "Cancel subscription",
"confirm_info": "Please verify this form looks correct.",
"deploy_twamp": "Deploy TWAMP",
"migrate_iptrunk": "Migrate IP Trunk",
"modify_isis_metric": "Modify the ISIS metric",
"modify_site": "Modify site",
"modify_trunk_interface": "Modify IP Trunk interface",
"redeploy_base_config": "Redeploy base config",
"update_ibgp_mesh": "Update iBGP mesh"
......
......@@ -13,11 +13,11 @@ def _initial_input_form(subscription_id: UUIDstr) -> FormGenerator:
class CancelSubscriptionForm(FormPage):
info_label: Label = f"Canceling subscription with ID {subscription_id}" # type:ignore[assignment]
info_label_2: Label = (
"This will immediately mark the subscription as terminated, preventing any other workflows from interacting"
"This will immediately mark the subscription as terminated, preventing any other workflows from interacting" # type:ignore[assignment]
" with this product subscription."
)
info_label_3: Label = "ONLY EXECUTE THIS WORKFLOW WHEN YOU ARE ABSOLUTELY SURE WHAT YOU ARE DOING."
info_label_4: Label = "THIS WORKFLOW IS IRREVERSIBLE AND MAY HAVE UNFORESEEN CONSEQUENCES."
info_label_3: Label = "ONLY EXECUTE THIS WORKFLOW WHEN YOU ARE ABSOLUTELY SURE WHAT YOU ARE DOING." # type:ignore[assignment]
info_label_4: Label = "THIS WORKFLOW IS IRREVERSIBLE AND MAY HAVE UNFORESEEN CONSEQUENCES." # type:ignore[assignment]
yield CancelSubscriptionForm
......
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