mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
metadata 1.1
* Add network value to support_by field. * New support_by value, certified * Deprecate curated in favor of certified * Add conversion from 1.0 to 1.1 to metadata-tool * Add supported by Red Hat field to ansible-doc output
This commit is contained in:
parent
d50d65d448
commit
af2073d057
19 changed files with 175 additions and 71 deletions
|
@ -41,7 +41,7 @@ from ansible.utils.plugin_docs import BLACKLIST, get_docstring
|
|||
|
||||
from module_args import get_argument_spec
|
||||
|
||||
from schema import doc_schema, metadata_schema, return_schema
|
||||
from schema import doc_schema, metadata_1_1_schema, return_schema
|
||||
|
||||
from utils import CaptureStd, parse_yaml
|
||||
from voluptuous.humanize import humanize_error
|
||||
|
@ -892,7 +892,7 @@ class ModuleValidator(Validator):
|
|||
)
|
||||
|
||||
if metadata:
|
||||
self._validate_docs_schema(metadata, metadata_schema(deprecated),
|
||||
self._validate_docs_schema(metadata, metadata_1_1_schema(deprecated),
|
||||
'ANSIBLE_METADATA', 316)
|
||||
|
||||
return doc_info
|
||||
|
|
|
@ -104,7 +104,7 @@ def doc_schema(module_name):
|
|||
)
|
||||
|
||||
|
||||
def metadata_schema(deprecated):
|
||||
def metadata_1_0_schema(deprecated):
|
||||
valid_status = Any('stableinterface', 'preview', 'deprecated', 'removed')
|
||||
if deprecated:
|
||||
valid_status = Any('deprecated')
|
||||
|
@ -118,6 +118,20 @@ def metadata_schema(deprecated):
|
|||
)
|
||||
|
||||
|
||||
def metadata_1_1_schema(deprecated):
|
||||
valid_status = Any('stableinterface', 'preview', 'deprecated', 'removed')
|
||||
if deprecated:
|
||||
valid_status = Any('deprecated')
|
||||
|
||||
return Schema(
|
||||
{
|
||||
Required('status'): [valid_status],
|
||||
Required('metadata_version'): '1.1',
|
||||
Required('supported_by'): Any('core', 'community', 'certified', 'network')
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
# Things to add soon
|
||||
####################
|
||||
# 1) Recursively validate `type: complex` fields
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue