Message on stderr with rc==0: "ERROR: [reposync] failed to fetch file `https://repo.voidlinux.eu/current/i686-repodata': Network is unreachable" closes #1
@@ -5,10 +5,10 @@ def update_package_db(module, paths):
cmd = "%s -S" % paths['install']
rc, sout, serr = module.run_command(cmd, check_rc=False)
- if rc == 0:
- return True
- else:
+ if rc != 0 or serr:
module.fail_json(msg="could not update package db", rc=rc, stdout=sout, stderr=serr)
+ else:
+ return True