k8s_*: Group argument_spec accroding to usage (#199)

Partially fix #36

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde
2020-08-26 19:48:07 +05:30
committed by GitHub
parent d39fcfc2d8
commit 16059a8111
8 changed files with 34 additions and 88 deletions

View File

@@ -25,7 +25,7 @@ import sys
import traceback
from ansible.module_utils.basic import missing_required_lib
from ansible_collections.community.kubernetes.plugins.module_utils.common import AUTH_ARG_SPEC, COMMON_ARG_SPEC
from ansible_collections.community.kubernetes.plugins.module_utils.common import AUTH_ARG_SPEC, COMMON_ARG_SPEC, RESOURCE_ARG_SPEC, NAME_ARG_SPEC
from ansible.module_utils.six import string_types
from ansible.module_utils._text import to_native
from ansible_collections.community.kubernetes.plugins.module_utils.common import KubernetesAnsibleModule
@@ -78,6 +78,8 @@ class KubernetesRawModule(KubernetesAnsibleModule):
@property
def argspec(self):
argument_spec = copy.deepcopy(COMMON_ARG_SPEC)
argument_spec.update(copy.deepcopy(NAME_ARG_SPEC))
argument_spec.update(copy.deepcopy(RESOURCE_ARG_SPEC))
argument_spec.update(copy.deepcopy(AUTH_ARG_SPEC))
argument_spec['merge_type'] = dict(type='list', elements='str', choices=['json', 'merge', 'strategic-merge'])
argument_spec['wait'] = dict(type='bool', default=False)