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

Update docstrings in a more product blocks, remove obsolete :class:`` references

parent c67b05ad
No related branches found
No related tags found
No related merge requests found
...@@ -74,7 +74,7 @@ def available_lags_choices(router_id: UUID) -> Choice | None: ...@@ -74,7 +74,7 @@ def available_lags_choices(router_id: UUID) -> Choice | None:
"""Return a list of available lags for a given router. """Return a list of available lags for a given router.
For Nokia routers, return a list of available lags. For Nokia routers, return a list of available lags.
For Juniper routers, return ``None``. For Juniper routers, return `None`.
""" """
if get_router_vendor(router_id) != Vendor.NOKIA: if get_router_vendor(router_id) != Vendor.NOKIA:
return None return None
...@@ -86,7 +86,7 @@ def available_service_lags_choices(router_id: UUID) -> Choice | None: ...@@ -86,7 +86,7 @@ def available_service_lags_choices(router_id: UUID) -> Choice | None:
"""Return a list of available lags for a given router for services. """Return a list of available lags for a given router for services.
For Nokia routers, return a list of available lags. For Nokia routers, return a list of available lags.
For Juniper routers, return ``None``. For Juniper routers, return `None`.
""" """
if get_router_vendor(router_id) != Vendor.NOKIA: if get_router_vendor(router_id) != Vendor.NOKIA:
return None return None
...@@ -164,7 +164,7 @@ def generate_inventory_for_routers( ...@@ -164,7 +164,7 @@ def generate_inventory_for_routers(
router_role: The role of the routers to include in the inventory. router_role: The role of the routers to include in the inventory.
exclude_routers: List of routers to exclude from the inventory. exclude_routers: List of routers to exclude from the inventory.
router_vendor: The vendor of the routers to include in the inventory. router_vendor: The vendor of the routers to include in the inventory.
include_provisioning_routers: Include routers that are in a ``PROVISIONING`` state. include_provisioning_routers: Include routers that are in a `PROVISIONING` state.
Returns: Returns:
A dictionary representing the inventory of active routers. A dictionary representing the inventory of active routers.
...@@ -262,7 +262,7 @@ def active_edge_port_selector(*, partner_id: UUIDstr | None = None) -> Choice: ...@@ -262,7 +262,7 @@ def active_edge_port_selector(*, partner_id: UUIDstr | None = None) -> Choice:
) )
if partner_id: if partner_id:
# ``partner_id`` is set, so we will filter accordingly. # `partner_id` is set, so we will filter accordingly.
edge_port_subscriptions = list( edge_port_subscriptions = list(
filter(lambda subscription: bool(subscription["customer_id"] == partner_id), edge_port_subscriptions) filter(lambda subscription: bool(subscription["customer_id"] == partner_id), edge_port_subscriptions)
) )
... ...
......
...@@ -25,7 +25,7 @@ class LAGMember(BaseModel): ...@@ -25,7 +25,7 @@ class LAGMember(BaseModel):
def validate_interface_names_are_unique(interfaces: list[LAGMember]) -> list[LAGMember]: def validate_interface_names_are_unique(interfaces: list[LAGMember]) -> list[LAGMember]:
"""Verify if interfaces are unique. """Verify if interfaces are unique.
Raises a ``ValueError`` if the interfaces are not unique. Raises a `ValueError` if the interfaces are not unique.
Args: Args:
interfaces: The list of interfaces. interfaces: The list of interfaces.
... ...
......
""":term:`VRF` Virtual Routing and Forwarding.""" """VRF Virtual Routing and Forwarding."""
"""A creation workflow for adding a new virtual routing and forwarding (:term:`VRF`) service.""" """A creation workflow for adding a new virtual routing and forwarding (VRF) service."""
from orchestrator.forms import FormPage from orchestrator.forms import FormPage
from orchestrator.targets import Target from orchestrator.targets import Target
...@@ -39,7 +39,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: ...@@ -39,7 +39,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
@step("Create subscription") @step("Create subscription")
def create_subscription(product: UUIDstr, partner: str) -> State: def create_subscription(product: UUIDstr, partner: str) -> State:
"""Create a new :term:`VRF` subscription.""" """Create a new VRF subscription."""
subscription = VRFInactive.from_product_id(product, get_partner_by_name(partner)["partner_id"]) subscription = VRFInactive.from_product_id(product, get_partner_by_name(partner)["partner_id"])
return { return {
...@@ -72,7 +72,7 @@ def initialize_subscription( ...@@ -72,7 +72,7 @@ def initialize_subscription(
target=Target.CREATE, target=Target.CREATE,
) )
def create_vrf() -> StepList: def create_vrf() -> StepList:
"""Create a virtual routing and forwarding (:term:`VRF`) service.""" """Create a virtual routing and forwarding (VRF) service."""
return ( return (
begin begin
>> create_subscription >> create_subscription
... ...
......
"""Modify :term:`VRF` to add or remove routers.""" """Modify VRF to add or remove routers."""
from typing import Annotated from typing import Annotated
...@@ -17,7 +17,7 @@ from gso.utils.helpers import active_router_selector ...@@ -17,7 +17,7 @@ from gso.utils.helpers import active_router_selector
def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
"""Modify :term:`VRF` to add or remove routers.""" """Modify VRF to add or remove routers."""
subscription = VRF.from_subscription(subscription_id) subscription = VRF.from_subscription(subscription_id)
class RouterSelection(BaseModel): class RouterSelection(BaseModel):
...@@ -57,5 +57,5 @@ def update_subscription_model(subscription: VRF, router_list: list[dict[str, UUI ...@@ -57,5 +57,5 @@ def update_subscription_model(subscription: VRF, router_list: list[dict[str, UUI
target=Target.MODIFY, target=Target.MODIFY,
) )
def modify_vrf_router_list() -> StepList: def modify_vrf_router_list() -> StepList:
"""Modify the :term:`VRF` router list.""" """Modify the VRF router list."""
return begin >> store_process_subscription(Target.MODIFY) >> unsync >> update_subscription_model >> resync >> done return begin >> store_process_subscription(Target.MODIFY) >> unsync >> update_subscription_model >> resync >> done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment