Skip to content
Snippets Groups Projects
Commit 80cb3065 authored by JORGE SASIAIN's avatar JORGE SASIAIN
Browse files

Make members field in each side of the trunk be a drop down list

parent 3d14476a
No related branches found
No related tags found
1 merge request!2Develop patch
...@@ -2,3 +2,4 @@ __pycache__/ ...@@ -2,3 +2,4 @@ __pycache__/
*.egg-info *.egg-info
.coverage .coverage
coverage.xml coverage.xml
.tox/
...@@ -65,7 +65,6 @@ Is process the same as subscription? If not, what’s the endpoint/way to create ...@@ -65,7 +65,6 @@ Is process the same as subscription? If not, what’s the endpoint/way to create
## TODO ## TODO
- Fix flake8 errors for main.py products and workflows imports - 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 - Integrate provision step (in CreateTrunkConfigSide) with IPAM/Infoblox
## Resources ## Resources
......
...@@ -43,6 +43,25 @@ def trunk_config_selector() -> list: ...@@ -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: def initial_input_form_generator(product_name: str) -> FormGenerator:
class CreateTrunkConfigSideForm(FormPage): class CreateTrunkConfigSideForm(FormPage):
class Config: class Config:
...@@ -53,7 +72,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: ...@@ -53,7 +72,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
geant_a_sid: str geant_a_sid: str
ipv4_address: Optional[str] ipv4_address: Optional[str]
ipv6_address: Optional[str] ipv6_address: Optional[str]
members: List[str] members: member_selector() # type:ignore
trunk_config_ids: trunk_config_selector() # type:ignore trunk_config_ids: trunk_config_selector() # type:ignore
user_input = yield CreateTrunkConfigSideForm user_input = yield CreateTrunkConfigSideForm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment