From 2cb9d9da140dfd0107b0ee969f22a7a92f4c86be Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Tue, 19 Feb 2019 21:50:11 +0100 Subject: [PATCH] return_common: Clean up parameter types (#52524) This PR includes: - Parameter types added - Copyright format fixes - Short license statement --- .../plugins/doc_fragments/return_common.py | 71 ++++++++----------- 1 file changed, 29 insertions(+), 42 deletions(-) diff --git a/lib/ansible/plugins/doc_fragments/return_common.py b/lib/ansible/plugins/doc_fragments/return_common.py index 998e1a05580..6f3866ba5c1 100644 --- a/lib/ansible/plugins/doc_fragments/return_common.py +++ b/lib/ansible/plugins/doc_fragments/return_common.py @@ -1,53 +1,40 @@ -# Copyright (c) 2016 Ansible, Inc -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# 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. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . +# -*- coding: utf-8 -*- +# Copyright: (c) 2016, Ansible, Inc +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -class ModuleDocFragment(object): +class ModuleDocFragment(object): # Standard documentation fragment - RETURN = ''' + RETURN = r''' changed: - description: Whether the module affected changes on the target. - returned: always - type: bool - sample: False + description: Whether the module affected changes on the target. + returned: always + type: bool + sample: false failed: - description: Whether the module failed to execute. - returned: always - type: bool - sample: True + description: Whether the module failed to execute. + returned: always + type: bool + sample: true msg: - description: Human-readable message. - returned: as needed - type: string - sample: "all ok" + description: Human-readable message. + returned: as needed + type: str + sample: all ok skipped: - description: Whether the module was skipped. - returned: always - type: bool - sample: False + description: Whether the module was skipped. + returned: always + type: bool + sample: false results: - description: List of module results, - returned: when using a loop. - type: list - sample: [{changed: True, msg: 'first item changed'}, {changed: False, msg: 'second item ok'}] + description: List of module results, + returned: when using a loop. + type: list + sample: [{changed: True, msg: 'first item changed'}, {changed: False, msg: 'second item ok'}] exception: - description: Optional information from a handled error. - returned: on some errors - type: string - sample: 'Unknown error' + description: Optional information from a handled error. + returned: on some errors + type: str + sample: Unknown error '''