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

Remove Sphinx term statements

These are not needed anymore, as MkDocs will pick up on them automatically
parent e2d6bf85
No related branches found
No related tags found
No related merge requests found
Showing with 50 additions and 50 deletions
......@@ -175,12 +175,12 @@ def get_trunks_that_terminate_on_router(
def get_product_id_by_name(product_name: ProductName) -> UUID:
"""Retrieve the :term:`UUID` of a product by its name.
"""Retrieve the UUID of a product by its name.
:param product_name: The name of the product.
:type product_name: ProductName
:return UUID: The :term:`UUID` of the product.
:return UUID: The UUID of the product.
:rtype: UUID
"""
return ProductTable.query.filter_by(name=product_name).first().product_id
......
""":term:`GSO` settings.
"""GSO settings.
Ensuring that the required parameters are set correctly. An example file ``oss-params-example.json`` is present in the
:term:`GSO` package itself.
GSO package itself.
"""
import ipaddress
......@@ -30,12 +30,12 @@ class EnvironmentEnum(strEnum):
class GeneralParams(BaseSettings):
"""General parameters for a :term:`GSO` configuration file."""
"""General parameters for a GSO configuration file."""
public_hostname: str
"""The hostname that :term:`GSO` is publicly served at, used for building callback URLs for public use."""
"""The hostname that GSO is publicly served at, used for building callback URLs for public use."""
internal_hostname: str
"""The hostname of :term:`GSO` that is for internal use, such as the provisioning proxy."""
"""The hostname of GSO that is for internal use, such as the provisioning proxy."""
isis_high_metric: int
environment: EnvironmentEnum
......@@ -90,7 +90,7 @@ class ServiceNetworkParams(BaseSettings):
class IPAMParams(BaseSettings):
"""A set of parameters related to :term:`IPAM`."""
"""A set of parameters related to IPAM."""
INFOBLOX: InfoBloxParams
LO: ServiceNetworkParams
......@@ -129,7 +129,7 @@ class SNMPParams(BaseSettings):
v2c: MonitoringSNMPV2Params
#: .. versionadded :: 2.0
#: Support for :term:`SNMP` v3 will get added in a later version of :term:`GSO`. Parameters are optional for now.
#: Support for SNMP v3 will get added in a later version of GSO. Parameters are optional for now.
v3: MonitoringSNMPV3Params | None = None
......@@ -213,7 +213,7 @@ class MoodiParams(BaseSettings):
class OSSParams(BaseSettings):
"""The set of parameters required for running :term:`GSO`."""
"""The set of parameters required for running GSO."""
GENERAL: GeneralParams
IPAM: IPAMParams
......
"""Custom exceptions for :term:`GSO`."""
"""Custom exceptions for GSO."""
class NotFoundError(Exception):
......
"""Helper methods that are used across :term:`GSO`."""
"""Helper methods that are used across GSO."""
import random
import re
......@@ -96,7 +96,7 @@ def available_service_lags_choices(router_id: UUID) -> Choice | None:
def get_router_vendor(router_id: UUID) -> Vendor:
"""Retrieve the vendor of a router.
:param router_id: The :term:`UUID` of the router.
:param router_id: The UUID of the router.
:type router_id: :class:`uuid.UUID`
:return: The vendor of the router.
......@@ -106,10 +106,10 @@ def get_router_vendor(router_id: UUID) -> Vendor:
def iso_from_ipv4(ipv4_address: IPv4AddressType) -> str:
"""Calculate an :term:`ISO` address, based on an IPv4 address.
"""Calculate an ISO address, based on an IPv4 address.
:param IPv4Address ipv4_address: The address that's to be converted
:returns: An :term:`ISO`-formatted address.
:returns: An ISO-formatted address.
"""
padded_octets = [f"{x:>03}" for x in str(ipv4_address).split(".")]
joined_octets = "".join(padded_octets)
......@@ -118,7 +118,7 @@ def iso_from_ipv4(ipv4_address: IPv4AddressType) -> str:
def generate_fqdn(hostname: str, site_name: str, country_code: str) -> str:
"""Generate an :term:`FQDN` from a hostname, site name, and a country code."""
"""Generate an FQDN from a hostname, site name, and a country code."""
oss = settings.load_oss_params()
return f"{hostname}.{site_name.lower()}.{country_code.lower()}{oss.IPAM.LO.domain_name}"
......@@ -252,11 +252,11 @@ def partner_choice() -> Choice:
def validate_edge_port_number_of_members_based_on_lacp(*, number_of_members: int, enable_lacp: bool) -> None:
"""Validate the number of edge port members based on the :term:`LACP` setting.
"""Validate the number of edge port members based on the LACP setting.
:param number_of_members: The number of members to validate.
:param enable_lacp: Whether :term:`LACP` is enabled or not.
:raises ValueError: If the number of members is greater than 1 and :term:`LACP` is disabled.
:param enable_lacp: Whether LACP is enabled or not.
:raises ValueError: If the number of members is greater than 1 and LACP is disabled.
"""
if number_of_members > 1 and not enable_lacp:
err_msg = "Number of members must be 1 if LACP is disabled."
......
......@@ -308,7 +308,7 @@ def update_sdp_single_pe_real(subscription: dict[str, Any], tt_number: str, proc
@step("[FOR REAL] Set ISIS metric to very high value")
def set_isis_to_max(subscription: Iptrunk, process_id: UUIDstr, tt_number: str) -> LSOState:
"""Workflow step for setting the :term:`ISIS` metric to an arbitrarily high value to drain a link."""
"""Workflow step for setting the ISIS metric to an arbitrarily high value to drain a link."""
old_isis_metric = subscription.iptrunk.iptrunk_isis_metric
params = load_oss_params()
subscription.iptrunk.iptrunk_isis_metric = params.GENERAL.isis_high_metric
......@@ -398,7 +398,7 @@ _is_moodi_enabled = conditional(lambda _: load_oss_params().MOODI.moodi_enabled)
def start_moodi() -> StepList:
"""Start monitoring on demand using :term:`Moodi` Telemetry stack."""
"""Start monitoring on demand using Moodi Telemetry stack."""
host = load_oss_params().MOODI.host
@step("Start Moodi")
......@@ -413,7 +413,7 @@ def start_moodi() -> StepList:
def stop_moodi() -> StepList:
"""Stop :term:`Moodi` Telemetry monitoring on demand."""
"""Stop Moodi Telemetry monitoring on demand."""
host = load_oss_params().MOODI.host
@step("Stop Moodi")
......
"""Module that sets up :term:`GSO` as a Celery worker. This will allow for the scheduling of regular task workflows."""
"""Module that sets up GSO as a Celery worker. This will allow for the scheduling of regular task workflows."""
from typing import Any
from uuid import UUID
......@@ -43,7 +43,7 @@ def process_broadcast_fn(process_id: UUID) -> None:
class OrchestratorWorker(Celery):
"""A :term:`GSO` instance that functions as a Celery worker."""
"""A GSO instance that functions as a Celery worker."""
websocket_manager: WebSocketManager
process_broadcast_fn: BroadcastFunc
......
"""Initialisation class that imports all workflows into :term:`GSO`."""
"""Initialisation class that imports all workflows into GSO."""
from orchestrator.services.subscriptions import WF_USABLE_MAP
from orchestrator.types import SubscriptionLifecycle
......
......@@ -228,7 +228,7 @@ def create_subscription(product: UUIDstr, partner: str) -> State:
@step("Get information from IPAM")
def get_info_from_ipam(subscription: IptrunkInactive) -> State:
"""Allocate IP resources in :term:`IPAM`."""
"""Allocate IP resources in IPAM."""
new_ipv4_network = infoblox.allocate_v4_network(
"TRUNK",
subscription.iptrunk.iptrunk_description,
......
"""Workflow for adding :term:`TWAMP` to an existing IP trunk.
"""Workflow for adding TWAMP to an existing IP trunk.
Takes a trunk that is either `PROVISIONING` or `ACTIVE` and deploy configuration for TWAMP. The trunk will not change
state after running this workflow.
......@@ -38,7 +38,7 @@ def _initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
@step("[DRY RUN] Deploy TWAMP on both sides")
def deploy_twamp_dry(subscription: Iptrunk, process_id: UUIDstr, tt_number: str) -> LSOState:
"""Perform a dry run of deploying the :term:`TWAMP` session."""
"""Perform a dry run of deploying the TWAMP session."""
extra_vars = {
"subscription": json.loads(json_dumps(subscription)),
"process_id": process_id,
......@@ -63,7 +63,7 @@ def deploy_twamp_dry(subscription: Iptrunk, process_id: UUIDstr, tt_number: str)
@step("[FOR REAL] Deploy TWAMP on both sides")
def deploy_twamp_real(subscription: Iptrunk, process_id: UUIDstr, tt_number: str) -> LSOState:
"""Deploy the :term:`TWAMP` session."""
"""Deploy the TWAMP session."""
extra_vars = {
"subscription": json.loads(json_dumps(subscription)),
"process_id": process_id,
......
......@@ -167,7 +167,7 @@ def netbox_reserve_interfaces(
"""Reserve new interfaces in Netbox, only when the new side's router is a Nokia router."""
new_side = Router.from_subscription(new_node).router
nbclient = NetboxClient()
# Create :term:`LAG` interfaces
# Create LAG interfaces
lag_interface: Interfaces = nbclient.create_interface(
iface_name=new_lag_interface,
interface_type="lag",
......
"""A modification workflow for setting a new :term:`ISIS` metric for an IP trunk.
"""A modification workflow for setting a new ISIS metric for an IP trunk.
The strategy is to re-apply the necessary template to the configuration construct: using a "replace" strategy only the
necessary modifications will be applied.
......@@ -21,7 +21,7 @@ from gso.workflows.shared import modify_summary_form
def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
"""Ask the operator for the new :term:`ISIS` metric."""
"""Ask the operator for the new ISIS metric."""
subscription = Iptrunk.from_subscription(subscription_id)
class ModifyIptrunkForm(FormPage):
......@@ -38,7 +38,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
@step("Update subscription")
def modify_iptrunk_subscription(subscription: Iptrunk, isis_metric: int) -> State:
"""Store the new :term:`ISIS` metric in the database by updating the subscription."""
"""Store the new ISIS metric in the database by updating the subscription."""
subscription.iptrunk.iptrunk_isis_metric = isis_metric
return {"subscription": subscription}
......@@ -46,7 +46,7 @@ def modify_iptrunk_subscription(subscription: Iptrunk, isis_metric: int) -> Stat
@step("[DRY RUN] Provision IP trunk ISIS interface")
def provision_ip_trunk_isis_iface_dry(subscription: Iptrunk, process_id: UUIDstr, tt_number: str) -> LSOState:
"""Perform a dry run of deploying the new :term:`ISIS` metric on both sides of the trunk."""
"""Perform a dry run of deploying the new ISIS metric on both sides of the trunk."""
extra_vars = {
"wfo_trunk_json": json.loads(json_dumps(subscription)),
"dry_run": True,
......@@ -72,7 +72,7 @@ def provision_ip_trunk_isis_iface_dry(subscription: Iptrunk, process_id: UUIDstr
@step("[FOR REAL] Provision IP trunk ISIS interface")
def provision_ip_trunk_isis_iface_real(subscription: Iptrunk, process_id: UUIDstr, tt_number: str) -> LSOState:
"""Deploy the new :term:`ISIS` metric on both sides of the trunk."""
"""Deploy the new ISIS metric on both sides of the trunk."""
extra_vars = {
"wfo_trunk_json": json.loads(json_dumps(subscription)),
"dry_run": False,
......@@ -102,11 +102,11 @@ def provision_ip_trunk_isis_iface_real(subscription: Iptrunk, process_id: UUIDst
target=Target.MODIFY,
)
def modify_isis_metric() -> StepList:
"""Modify the :term:`ISIS` metric of an existing IP trunk.
"""Modify the ISIS metric of an existing IP trunk.
* Modify the subscription model in the database
* Perform a dry run of setting the new :term:`ISIS` metric
* Deploy the new :term:`ISIS` metric on both sides of the trunk
* Perform a dry run of setting the new ISIS metric
* Deploy the new ISIS metric on both sides of the trunk
"""
return (
begin
......
"""A modification workflow that updates the :term:`LAG` interfaces that are part of an existing IP trunk.
"""A modification workflow that updates the LAG interfaces that are part of an existing IP trunk.
Modifies LAG interfaces and members. This is used to increase capacity or to change SID/interface descriptions.
......@@ -211,7 +211,7 @@ def check_ip_trunk_connectivity(subscription: Iptrunk) -> LSOState:
@step("Check LLDP on the trunk endpoints")
def check_ip_trunk_lldp(subscription: Iptrunk) -> LSOState:
"""Check :term:`LLDP` on trunk endpoints."""
"""Check LLDP on trunk endpoints."""
extra_vars = {"wfo_ip_trunk_json": json.loads(json_dumps(subscription)), "check": "lldp"}
return {
......
......@@ -40,7 +40,7 @@ from gso.utils.workflow_steps import set_isis_to_max
def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
"""Ask the operator to confirm whether router configuration and :term:`IPAM` resources should be deleted."""
"""Ask the operator to confirm whether router configuration and IPAM resources should be deleted."""
iptrunk = Iptrunk.from_subscription(subscription_id)
class TerminateForm(FormPage):
......@@ -141,7 +141,7 @@ def netbox_clean_up_side_b(subscription: Iptrunk) -> State:
@step("Deprovision IPv4 networks")
def deprovision_ip_trunk_ipv4(subscription: Iptrunk) -> dict:
"""Clear up IPv4 resources in :term:`IPAM`."""
"""Clear up IPv4 resources in IPAM."""
infoblox.delete_network(ipaddress.IPv4Network(subscription.iptrunk.iptrunk_ipv4_network))
return {"subscription": subscription}
......@@ -149,7 +149,7 @@ def deprovision_ip_trunk_ipv4(subscription: Iptrunk) -> dict:
@step("Deprovision IPv6 networks")
def deprovision_ip_trunk_ipv6(subscription: Iptrunk) -> dict:
"""Clear up IPv6 resources in :term:`IPAM`."""
"""Clear up IPv6 resources in IPAM."""
infoblox.delete_network(ipaddress.IPv6Network(subscription.iptrunk.iptrunk_ipv6_network))
return {"subscription": subscription}
......@@ -164,10 +164,10 @@ def terminate_iptrunk() -> StepList:
"""Terminate an IP trunk.
* Let the operator decide whether to remove configuration from the routers, if so:
* Set the :term:`ISIS` metric of the IP trunk to an arbitrarily high value
* Set the 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 :term:`IPAM` resources
* Clear IPAM resources
* Terminate the subscription in the service database
"""
run_config_steps = conditional(lambda state: state["remove_configuration"])
......
......@@ -153,7 +153,7 @@ def initialize_subscription(
@step("Allocate loopback interfaces in IPAM")
def ipam_allocate_loopback(subscription: RouterInactive) -> State:
"""Allocate :term:`IPAM` resources for the loopback interface."""
"""Allocate IPAM resources for the loopback interface."""
fqdn = subscription.router.router_fqdn
if not fqdn:
msg = f"Router fqdn for subscription id {subscription.subscription_id} is missing!"
......
......@@ -51,7 +51,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 clear up :term:`IPAM` resources."""
"""Let the operator decide whether to delete configuration on the router, and clear up IPAM resources."""
router = Router.from_subscription(subscription_id)
class TerminateForm(FormPage):
......@@ -77,7 +77,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
@step("Deprovision loopback IPs from IPAM")
def deprovision_loopback_ips(subscription: Router) -> dict:
"""Clear up the loopback addresses from :term:`IPAM`."""
"""Clear up the loopback addresses from IPAM."""
infoblox.delete_host_by_ip(ipaddress.IPv4Address(subscription.router.router_lo_ipv4_address))
return {"subscription": subscription}
......@@ -276,8 +276,8 @@ def kentik_apply_archive_license(subscription: Router) -> State:
def terminate_router() -> StepList:
"""Terminate a router subscription.
* Let the operator decide whether to delete :term:`IPAM` resources, and remove configuration from the router
* Clear up :term:`IPAM` resources, if selected by the operator
* Let the operator decide whether to delete IPAM resources, and remove configuration from the router
* Clear up IPAM resources, if selected by the operator
* Disable and delete configuration on the router, if selected by the operator
* Mark the subscription as terminated in the service database
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment