Fixes for git module when it fails.
* module.fail_json *must* have msg argument Using http://github.com/ rather than git://github.com/ as it gets through more firewalls
This commit is contained in:
parent
2105418b73
commit
f0931b5960
1 changed files with 4 additions and 4 deletions
8
git
8
git
|
@ -165,24 +165,24 @@ def main():
|
|||
if not os.path.exists(gitconfig):
|
||||
(rc, out, err) = clone(repo, dest)
|
||||
if rc != 0:
|
||||
module.fail_json(out=out, err=err, rc=rc)
|
||||
module.fail_json(msg=err)
|
||||
else:
|
||||
# else do a pull
|
||||
before = get_version(dest)
|
||||
(rc, out, err) = reset(dest)
|
||||
if rc != 0:
|
||||
module.fail_json(out=out, err=err, rc=rc)
|
||||
module.fail_json(msg=err)
|
||||
(rc, out, err) = pull(module, repo, dest, version)
|
||||
|
||||
# handle errors from clone or pull
|
||||
if out.find('error') != -1 or err.find('ERROR') != -1:
|
||||
module.fail_json(out=out, err=err)
|
||||
module.fail_json(msg=err)
|
||||
|
||||
# switch to version specified regardless of whether
|
||||
# we cloned or pulled
|
||||
(rc, out, err) = switch_version(module, dest, remote, version)
|
||||
if err.find('error') != -1:
|
||||
module.fail_json(out=out, err=err)
|
||||
module.fail_json(msg=err)
|
||||
|
||||
# determine if we changed anything
|
||||
after = get_version(dest)
|
||||
|
|
Loading…
Reference in a new issue