Skip to content

Commit

Permalink
Provide min/max for port ref
Browse files Browse the repository at this point in the history
This commit adds changes to provide min/max for port ref and no longer populates an enum.
  • Loading branch information
sonicaj committed Aug 8, 2024
1 parent dd5309b commit bcce5c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion catalog_reader/app_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def get_default_questions_context() -> dict:
'certificates': [],
'certificate_authorities': [],
'system.general.config': {'timezone': 'America/Los_Angeles'},
'unused_ports': [i for i in range(1025, 65535)],
'gpu_choices': {}
}

Expand Down
9 changes: 4 additions & 5 deletions catalog_reader/questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,10 @@ def normalize_question(question: dict, version_data: dict, context: dict) -> Non
for i in context['certificate_authorities']
]
elif ref == 'definitions/port':
data['enum'] = [{'value': None, 'description': 'No Port Selected'}] if schema.get('null') else []
data['enum'] += [
{'value': i, 'description': f'{i!r} Port'}
for i in context['unused_ports']
]
data.update({
'min': 1,
'max': 65534,
})
elif ref == 'normalize/acl':
data['attrs'] = ACL_QUESTION
elif ref == 'normalize/ix_volume':
Expand Down

0 comments on commit bcce5c5

Please sign in to comment.