Skip to content

Commit

Permalink
Fix node_ip feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Qubad786 committed Jul 23, 2024
1 parent ac9bccf commit 834bcf6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
10 changes: 2 additions & 8 deletions apps_schema/features/node.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
from apps_schema.attrs import IntegerSchema, StringSchema
from apps_schema.attrs import StringSchema

from .base import BaseFeature


class DefinitionNodeIPFeature(BaseFeature):

NAME = 'definitions/node_ip'
NAME = 'definitions/node_bind_ip'
VALID_SCHEMAS = [StringSchema]


class ValidationNodePortFeature(BaseFeature):

NAME = 'validations/node_port'
VALID_SCHEMAS = [IntegerSchema]
7 changes: 5 additions & 2 deletions catalog_reader/questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ def normalize_question(question: dict, version_data: dict, context: dict) -> Non
'enum': [{'value': t, 'description': f'{t!r} timezone'} for t in sorted(context['timezones'])],
'default': context['system.general.config']['timezone']
})
elif ref == 'definitions/nodeIP':
data['default'] = context['node_ip']
elif ref == 'definitions/node_bind_ip':
data.update({
'default': '0.0.0.0',
'enum': [{'value': i, 'description': f'{i!r} IP Address'} for i in context['ip_choices']],
})
elif ref == 'definitions/certificate':
get_cert_ca_options(schema, data, {'value': None, 'description': 'No Certificate'})
data['enum'] += [
Expand Down

0 comments on commit 834bcf6

Please sign in to comment.