Skip to content
Snippets Groups Projects
Commit b21ad589 authored by Karel van Klink's avatar Karel van Klink :smiley_cat: Committed by Neda Moeini
Browse files

udpate documentation, resolve linter warnings

parent d2ed1e7e
No related branches found
No related tags found
1 merge request!115Feature/update docs
......@@ -248,7 +248,7 @@ def update_interfaces_in_netbox(subscription: Iptrunk, removed_ae_members: dict,
# Free removed interfaces
for member in removed_ae_members[str(side)]:
nbclient.free_interface(router_name, member["interface_name"])
# Attach physical interfaces to LAG
# Attach physical interfaces to :term:`LAG`
# Update interface description to subscription ID
# Reserve interfaces
for interface in subscription.iptrunk.iptrunk_sides[side].iptrunk_side_ae_members:
......@@ -274,7 +274,7 @@ def update_interfaces_in_netbox(subscription: Iptrunk, removed_ae_members: dict,
@step("Allocate interfaces in Netbox")
def allocate_interfaces_in_netbox(subscription: Iptrunk, previous_ae_members: dict) -> State:
"""Allocate the LAG interfaces in NetBox.
"""Allocate the :term:`LAG` interfaces in NetBox.
Attach the :term:`LAG` interfaces to the physical interfaces detach old ones from the :term:`LAG`.
"""
......@@ -311,7 +311,7 @@ def modify_trunk_interface() -> StepList:
* Update the subscription in the database
* Reserve new interfaces in Netbox
* Provision the updated version of the IP trunk, first as a dry run
* Allocate the previously reserved interfaces in Netbox
* Allocate the reserved interfaces in Netbox
"""
return (
init
......
......@@ -24,7 +24,7 @@ from gso.utils.helpers import set_isis_to_90000
def initial_input_form_generator() -> FormGenerator:
"""Ask the operator to confirm whether router configuration and/or IPAM resources should be deleted."""
"""Ask the operator to confirm whether router configuration and :term:`IPAM` resources should be deleted."""
class TerminateForm(FormPage):
termination_label: Label = (
......@@ -129,7 +129,7 @@ def terminate_iptrunk() -> StepList:
* Set the :term:`ISIS` metric of the IP trunk to an arbitrarily high value
* Disable and remove configuration from the routers, first as a dry run
* Mark the IP trunk interfaces as free in Netbox
* Clear IPAM resources, if selected by the operator
* Clear :term:`IPAM` resources, if selected by the operator
* Terminate the subscription in the service database
"""
run_config_steps = conditional(lambda state: state["remove_configuration"])
......
......@@ -128,7 +128,7 @@ def ipam_allocate_loopback(subscription: RouterProvisioning, is_ias_connected: b
@step("Allocate IAS connection in IPAM")
def ipam_allocate_ias_networks(subscription: RouterProvisioning) -> State:
"""Allocate required IAS :term:`IPAM` resources."""
"""Allocate required :term:`IAS` :term:`IPAM` resources."""
fqdn = subscription.router.router_fqdn
subscription.router.router_si_ipv4_network = infoblox.allocate_v4_network(
......
......@@ -25,7 +25,7 @@ logger = logging.getLogger(__name__)
def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
"""Let the operator decide whether to delete configuration on the router, and/or clear up :term:`IPAM` resources."""
"""Let the operator decide whether to delete configuration on the router, and clear up :term:`IPAM` resources."""
Router.from_subscription(subscription_id)
class TerminateForm(FormPage):
......@@ -59,7 +59,7 @@ def deprovision_si_ips(subscription: Router) -> dict:
@step("Deprovision IAS LT interfaces from IPAM")
def deprovision_lt_ips(subscription: Router) -> dict:
"""Clear up IAS LT interfaces from :term:`IPAM`."""
"""Clear up :term:`IAS` LT interfaces from :term:`IPAM`."""
infoblox.delete_network(ipaddress.IPv4Network(subscription.router.router_ias_lt_ipv4_network))
infoblox.delete_network(ipaddress.IPv6Network(subscription.router.router_ias_lt_ipv6_network))
......
......@@ -62,8 +62,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
def site_name_must_be_valid(cls, site_name: str) -> str:
"""Validate the site name.
The site name must consist of three uppercase letters (A-Z) followed
by an optional single digit (0-9).
The site name must consist of three uppercase letters, followed by an optional single digit.
"""
validate_site_fields_is_unique("site_name", site_name)
validate_site_name(site_name)
......
......@@ -116,7 +116,7 @@ def extract_error(result):
class WorkflowInstanceForTests(LazyWorkflowInstance):
"""Register Test workflows.
Similar to `LazyWorkflowInstance` but does not require an import during instantiate
Similar to ``LazyWorkflowInstance`` but does not require an import during instantiate
Used for creating test workflows
"""
......@@ -173,7 +173,7 @@ def _store_step(step_log: list[tuple[Step, Process]]) -> Callable[[ProcessStat,
def run_workflow(workflow_key: str, input_data: State | list[State]) -> tuple[Process, ProcessStat, list]:
# ATTENTION!! This code needs to be as similar as possible to `server.services.processes.start_process`
# ATTENTION!! This code needs to be as similar as possible to ``server.services.processes.start_process``
# The main differences are: we use a different step log function, and we don't run in
# a separate thread
user = "john.doe"
......@@ -212,7 +212,7 @@ def resume_workflow(
step_log: list[tuple[Step, Process]],
input_data: State | list[State],
) -> tuple[Process, list]:
# ATTENTION!! This code needs to be as similar as possible to `server.services.processes.resume_process`
# ATTENTION!! This code needs to be as similar as possible to ``server.services.processes.resume_process``
# The main differences are: we use a different step log function, and we don't run in a separate thread
persistent = list(
filter(
......
......@@ -51,10 +51,7 @@ def test_site_name_is_incorrect(responses, faker):
The validation should throw an exception in case of a invalid string.
"""
invalid_site_name = "AMST10"
expected_exception_msg = (
r".*Enter a valid site name\. It must consist of three uppercase letters \(A-Z\) followed by an optional single"
rf" digit \(0\-9\)\. Received: {invalid_site_name} \(type=value_error\)"
)
expected_exception_msg = rf".*Enter a valid site name.+Received: {invalid_site_name}.*"
product_id = get_product_id_by_name(ProductType.SITE)
initial_site_data = [
{"product": product_id},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment