浏览代码

Fail if update_cache gets a message on stderr

Message on stderr with rc==0:
"ERROR: [reposync] failed to fetch file
`https://repo.voidlinux.eu/current/i686-repodata': Network is
unreachable"

closes #1
Sven Velt 8 年之前
父节点
当前提交
4a73cb826c
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      xbps.py

+ 3 - 3
xbps.py

@@ -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