mirror of
https://github.com/ansible/ansible.git
synced 2026-07-28 00:24:41 +02:00
git: remove redundant error checking (#86937)
* remove redundant error checking that makes bad error message Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
This commit is contained in:
co-authored by
Sloane Hertel
parent
c1d7cf45f6
commit
5a4f60dc03
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- git - remove redundant error checks after `run_command(check_rc=True)`
|
||||
@@ -994,9 +994,6 @@ def submodules_fetch(git_path, module, remote, track_submodules, dest):
|
||||
begin = get_submodule_versions(git_path, module, dest)
|
||||
cmd = [git_path, 'submodule', 'foreach', git_path, 'fetch']
|
||||
(rc, out, err) = module.run_command(cmd, check_rc=True, cwd=dest)
|
||||
if rc != 0:
|
||||
module.fail_json(msg="Failed to fetch submodules: %s" % out + err)
|
||||
|
||||
if track_submodules:
|
||||
# Compare each submodule against its configured remote branch
|
||||
after = {}
|
||||
@@ -1017,8 +1014,6 @@ def submodules_fetch(git_path, module, remote, track_submodules, dest):
|
||||
# Compare against the superproject's expectation
|
||||
cmd = [git_path, 'submodule', 'status']
|
||||
(rc, out, err) = module.run_command(cmd, check_rc=True, cwd=dest)
|
||||
if rc != 0:
|
||||
module.fail_json(msg='Failed to retrieve submodule status: %s' % out + err)
|
||||
for line in out.splitlines():
|
||||
if line[0] != ' ':
|
||||
changed = True
|
||||
|
||||
Reference in New Issue
Block a user