"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/sanity/validate-modules/schema.py" between
ansible-2.7.6.tar.gz and ansible-2.7.7.tar.gz

About: Ansible is a platform for configuring and managing computers combining multi-node software deployment, ad hoc task execution, and configuration management.

schema.py  (ansible-2.7.6):schema.py  (ansible-2.7.7)
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2015 Matt Martz <matt@sivel.net> # Copyright: (c) 2015, Matt Martz <matt@sivel.net>
# Copyright (C) 2015 Rackspace US, Inc. # Copyright: (c) 2015, Rackspace US, Inc.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/
# This program is free software: you can redistribute it and/or modify gpl-3.0.txt)
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from voluptuous import PREVENT_EXTRA, All, Any, Length, Required, Schema, Self from voluptuous import PREVENT_EXTRA, All, Any, Length, Required, Schema, Self
from ansible.module_utils.six import string_types from ansible.module_utils.six import string_types
list_string_types = list(string_types) list_string_types = list(string_types)
def sequence_of_sequences(min=None, max=None): def sequence_of_sequences(min=None, max=None):
return All( return All(
Any( Any(
None, None,
[Length(min=min, max=max)], [Length(min=min, max=max)],
tuple([Length(min=min, max=max)]), tuple([Length(min=min, max=max)]),
), ),
Any( Any(
None, None,
[Any(list, tuple)], [Any(list, tuple)],
tuple([Any(list, tuple)]), tuple([Any(list, tuple)]),
), ),
) )
seealso_schema = Schema(
Required('module'): Any(*string_types),
'description': Any(*string_types),
Required('ref'): Any(*string_types),
Required('description'): Any(*string_types),
Required('name'): Any(*string_types),
Required('link'): Any(*string_types),
Required('description'): Any(*string_types),
ansible_module_kwargs_schema = Schema( ansible_module_kwargs_schema = Schema(
{ {
'argument_spec': dict, 'argument_spec': dict,
'bypass_checks': bool, 'bypass_checks': bool,
'no_log': bool, 'no_log': bool,
'check_invalid_arguments': Any(None, bool), 'check_invalid_arguments': Any(None, bool),
'mutually_exclusive': sequence_of_sequences(min=2), 'mutually_exclusive': sequence_of_sequences(min=2),
'required_together': sequence_of_sequences(min=2), 'required_together': sequence_of_sequences(min=2),
'required_one_of': sequence_of_sequences(min=2), 'required_one_of': sequence_of_sequences(min=2),
'add_file_common_args': bool, 'add_file_common_args': bool,
skipping to change at line 145 skipping to change at line 153
if module_name.startswith('_'): if module_name.startswith('_'):
module_name = module_name[1:] module_name = module_name[1:]
deprecated_module = True deprecated_module = True
doc_schema_dict = { doc_schema_dict = {
Required('module'): module_name, Required('module'): module_name,
Required('short_description'): Any(*string_types), Required('short_description'): Any(*string_types),
Required('description'): Any(list_string_types, *string_types), Required('description'): Any(list_string_types, *string_types),
Required('version_added'): Any(float, *string_types), Required('version_added'): Any(float, *string_types),
Required('author'): Any(None, list_string_types, *string_types), Required('author'): Any(None, list_string_types, *string_types),
'notes': Any(None, list_string_types), 'notes': Any(None, list_string_types),
'seealso': Any(None, seealso_schema),
'requirements': list_string_types, 'requirements': list_string_types,
'todo': Any(None, list_string_types, *string_types), 'todo': Any(None, list_string_types, *string_types),
'options': Any(None, *list_dict_option_schema), 'options': Any(None, *list_dict_option_schema),
'extends_documentation_fragment': Any(list_string_types, *string_types) 'extends_documentation_fragment': Any(list_string_types, *string_types)
} }
if deprecated_module: if deprecated_module:
deprecation_required_scheme = { deprecation_required_scheme = {
Required('deprecated'): Any(deprecation_schema()), Required('deprecated'): Any(deprecation_schema()),
} }
 End of changes. 3 change blocks. 
16 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)