From 544bcfb30d74e5361c54ed23e7df50ddeec8b08b Mon Sep 17 00:00:00 2001 From: Stephen Fromm Date: Tue, 23 Jul 2013 10:16:20 -0700 Subject: [PATCH] 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. --- source_control/hg | 6 ++++-- source_control/subversion | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source_control/hg b/source_control/hg index 65cce55acb7..f5838b4bf43 100644 --- a/source_control/hg +++ b/source_control/hg @@ -41,6 +41,7 @@ options: - The repository address. required: true default: null + aliases: [ name ] dest: description: - Absolute path of where the repository should be cloned to. @@ -52,6 +53,7 @@ options: branch name or even tag. required: false default: "default" + aliases: [ version ] force: description: - Discards uncommitted changes. Runs C(hg update -C). @@ -203,9 +205,9 @@ def switch_version(module, dest, revision): def main(): module = AnsibleModule( argument_spec = dict( - repo = dict(required=True), + repo = dict(required=True, aliases=['name']), dest = dict(required=True), - revision = dict(default="default"), + revision = dict(default="default", aliases=['version']), force = dict(default='yes', type='bool'), purge = dict(default='no', type='bool') ), diff --git a/source_control/subversion b/source_control/subversion index db380d40e98..ad8bc431bdd 100644 --- a/source_control/subversion +++ b/source_control/subversion @@ -34,6 +34,7 @@ options: description: - The subversion URL to the repository. required: true + aliases: [ name, repository ] default: null dest: description: @@ -45,6 +46,7 @@ options: - Specific revision to checkout. required: false default: HEAD + aliases: [ version ] force: description: - 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( dest=dict(required=True), 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'), username=dict(required=False), password=dict(required=False),