diff --git a/apps_schema/features/ix_volume.py b/apps_schema/features/ix_volume.py index 5a0ceec..31ea26e 100644 --- a/apps_schema/features/ix_volume.py +++ b/apps_schema/features/ix_volume.py @@ -5,7 +5,7 @@ class IXVolumeFeature(BaseFeature): - NAME = 'normalize/ixVolume' + NAME = 'normalize/ix_volume' VALID_SCHEMAS = [DictSchema, StringSchema] def _validate(self, verrors, schema_obj, schema_str): @@ -13,13 +13,13 @@ def _validate(self, verrors, schema_obj, schema_str): return attrs = schema_obj.attrs - if 'datasetName' not in attrs: - verrors.add(f'{schema_str}.attrs', 'Variable "datasetName" must be specified.') - elif not isinstance(attrs[attrs.index('datasetName')].schema, StringSchema): - verrors.add(f'{schema_str}.attrs', 'Variable "datasetName" must be of string type.') + if 'dataset_name' not in attrs: + verrors.add(f'{schema_str}.attrs', 'Variable "dataset_name" must be specified.') + elif not isinstance(attrs[attrs.index('dataset_name')].schema, StringSchema): + verrors.add(f'{schema_str}.attrs', 'Variable "dataset_name" must be of string type.') - if 'aclEntries' in attrs and not isinstance(attrs[attrs.index('aclEntries')].schema, DictSchema): - verrors.add(f'{schema_str}.attrs', 'Variable "aclEntries" must be of dict type.') + if 'acl_entries' in attrs and not isinstance(attrs[attrs.index('acl_entries')].schema, DictSchema): + verrors.add(f'{schema_str}.attrs', 'Variable "acl_entries" must be of dict type.') if 'properties' in attrs: index = attrs.index('properties') diff --git a/catalog_reader/questions.py b/catalog_reader/questions.py index 4b47fea..3fe135e 100644 --- a/catalog_reader/questions.py +++ b/catalog_reader/questions.py @@ -82,11 +82,11 @@ def normalize_question(question: dict, version_data: dict, context: dict) -> Non ] elif ref == 'normalize/acl': data['attrs'] = ACL_QUESTION - elif ref == 'normalize/ixVolume': - if schema['type'] == 'dict' and any(i['variable'] == 'aclEntries' for i in schema['attrs']): - # get index of aclEntries from attrs - acl_index = next(i for i, v in enumerate(schema['attrs']) if v['variable'] == 'aclEntries') - # insert acl question before aclEntries + elif ref == 'normalize/ix_volume': + if schema['type'] == 'dict' and any(i['variable'] == 'acl_entries' for i in schema['attrs']): + # get index of acl_entries from attrs + acl_index = next(i for i, v in enumerate(schema['attrs']) if v['variable'] == 'acl_entries') + # insert acl question before acl_entries schema['attrs'][acl_index]['schema']['attrs'] = IX_VOLUMES_ACL_QUESTION schema.update(data) diff --git a/catalog_reader/questions_util.py b/catalog_reader/questions_util.py index 98847a4..736a5b0 100644 --- a/catalog_reader/questions_util.py +++ b/catalog_reader/questions_util.py @@ -16,7 +16,7 @@ 'schema': { 'type': 'list', 'items': [{ - 'variable': 'aclEntry', + 'variable': 'acl_entry', 'label': 'ACL Entry', 'schema': { 'type': 'dict', @@ -80,7 +80,7 @@ }, }, ] -CUSTOM_PORTALS_KEY = 'iXPortals' +CUSTOM_PORTALS_KEY = 'iX_portals' IX_VOLUMES_ACL_QUESTION = [ { 'variable': 'path',