diff --git a/.gitignore b/.gitignore index 2cedd2b19bb463f65d760f3f75b313028b58253a..71e1def92b37ee1e2a107c9b37e26b2794b7060e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ __pycache__/ *.egg-info .coverage coverage.xml +.tox/ diff --git a/README.md b/README.md index 24da4021c95022562e13af02128b095b6df20ff3..e976492b98ce02245547c039f164b3065c4923a2 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,6 @@ Is process the same as subscription? If not, what’s the endpoint/way to create ## TODO - Fix flake8 errors for main.py products and workflows imports -- The current input form for the members list in create_trunk_config_side is not apprpriate for a list - Integrate provision step (in CreateTrunkConfigSide) with IPAM/Infoblox ## Resources diff --git a/geant_service_orchestrator/workflows/trunk_config_side/create_trunk_config_side.py b/geant_service_orchestrator/workflows/trunk_config_side/create_trunk_config_side.py index 625f7b4d1ce02766f71b6d56f460d7a154470fc2..fa35bc65a3e70190bd7fb3ffdd9135bee411e281 100644 --- a/geant_service_orchestrator/workflows/trunk_config_side/create_trunk_config_side.py +++ b/geant_service_orchestrator/workflows/trunk_config_side/create_trunk_config_side.py @@ -43,6 +43,25 @@ def trunk_config_selector() -> list: ) +def member_selector() -> list: + interfaces_dict = { + "ge-0/0/1": "ge-0/0/1", + "ge-0/0/2": "ge-0/0/2", + "ge-0/0/3": "ge-0/0/3", + "ge-0/0/4": "ge-0/0/4", + "ge-0/0/5": "ge-0/0/5" + } + + return choice_list( + Choice("Member Interfaces", zip( + interfaces_dict.keys(), + interfaces_dict.items())), # type:ignore + min_items=1, + max_items=4, + unique_items=True, + ) + + def initial_input_form_generator(product_name: str) -> FormGenerator: class CreateTrunkConfigSideForm(FormPage): class Config: @@ -53,7 +72,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: geant_a_sid: str ipv4_address: Optional[str] ipv6_address: Optional[str] - members: List[str] + members: member_selector() # type:ignore trunk_config_ids: trunk_config_selector() # type:ignore user_input = yield CreateTrunkConfigSideForm