Apply consistent parameter alises to hg and subversion

For issue #3372, apply consistent parameter aliases to source_control
modules.  For hg, add name and version and add to documentation string.
For subversion, add version and document version and name aliases in
documentation string.
This commit is contained in:
Stephen Fromm 2013-07-23 10:16:20 -07:00 committed by James Cammarata
parent 49b0ff18a7
commit cc58403e48
2 changed files with 7 additions and 3 deletions

View file

@ -41,6 +41,7 @@ options:
- The repository address. - The repository address.
required: true required: true
default: null default: null
aliases: [ name ]
dest: dest:
description: description:
- Absolute path of where the repository should be cloned to. - Absolute path of where the repository should be cloned to.
@ -52,6 +53,7 @@ options:
branch name or even tag. branch name or even tag.
required: false required: false
default: "default" default: "default"
aliases: [ version ]
force: force:
description: description:
- Discards uncommitted changes. Runs C(hg update -C). - Discards uncommitted changes. Runs C(hg update -C).
@ -203,9 +205,9 @@ def switch_version(module, dest, revision):
def main(): def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec = dict( argument_spec = dict(
repo = dict(required=True), repo = dict(required=True, aliases=['name']),
dest = dict(required=True), dest = dict(required=True),
revision = dict(default="default"), revision = dict(default="default", aliases=['version']),
force = dict(default='yes', type='bool'), force = dict(default='yes', type='bool'),
purge = dict(default='no', type='bool') purge = dict(default='no', type='bool')
), ),

View file

@ -34,6 +34,7 @@ options:
description: description:
- The subversion URL to the repository. - The subversion URL to the repository.
required: true required: true
aliases: [ name, repository ]
default: null default: null
dest: dest:
description: description:
@ -45,6 +46,7 @@ options:
- Specific revision to checkout. - Specific revision to checkout.
required: false required: false
default: HEAD default: HEAD
aliases: [ version ]
force: force:
description: description:
- If C(yes), modified files will be discarded. If C(no), module will fail if it encounters modified files. - If C(yes), modified files will be discarded. If C(no), module will fail if it encounters modified files.
@ -141,7 +143,7 @@ def main():
argument_spec=dict( argument_spec=dict(
dest=dict(required=True), dest=dict(required=True),
repo=dict(required=True, aliases=['name', 'repository']), repo=dict(required=True, aliases=['name', 'repository']),
revision=dict(default='HEAD', aliases=['rev']), revision=dict(default='HEAD', aliases=['rev', 'version']),
force=dict(default='yes', type='bool'), force=dict(default='yes', type='bool'),
username=dict(required=False), username=dict(required=False),
password=dict(required=False), password=dict(required=False),