From 3ff0c6d50d94b15e72c5217d8c862f8dbcc3eac8 Mon Sep 17 00:00:00 2001 From: Yap Sok Ann Date: Wed, 16 Oct 2013 18:51:36 +0800 Subject: [PATCH] git: Remove unnecessary return code checking. The functions either return rc=0 or call fail_json themselves. --- source_control/git | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/source_control/git b/source_control/git index cbc005f5395..64450428b7c 100644 --- a/source_control/git +++ b/source_control/git @@ -337,7 +337,7 @@ def main(): if not os.path.exists(gitconfig): if module.check_mode: module.exit_json(changed=True) - (rc, out, err) = clone(git_path, module, repo, dest, remote, depth, version) + clone(git_path, module, repo, dest, remote, depth, version) elif not update: # Just return having found a repo already in the dest path # this does no checking that the repo is the actual repo @@ -351,9 +351,7 @@ def main(): # if force, do a reset if local_mods and module.check_mode: module.exit_json(changed=True, msg='Local modifications exist') - (rc, out, err) = reset(git_path, module, dest, force) - if rc != 0: - module.fail_json(msg=err) + reset(git_path, module, dest, force) # exit if already at desired sha version if before == version: module.exit_json(changed=False) @@ -375,15 +373,11 @@ def main(): else: changed = False module.exit_json(changed=changed, before=before, after=remote_head) - (rc, out, err) = fetch(git_path, module, repo, dest, version, remote) - if rc != 0: - module.fail_json(msg=err) + fetch(git_path, module, repo, dest, version, remote) # switch to version specified regardless of whether # we cloned or pulled - (rc, out, err) = switch_version(git_path, module, dest, remote, version) - if rc != 0: - module.fail_json(msg=err) + switch_version(git_path, module, dest, remote, version) # determine if we changed anything after = get_version(git_path, dest)