Fix preventing error message output
When docker swarm is not configured, calling
salt-call pillar.data >/dev/null on any node gives
Error: No such node:
and
docker node inspect self
[]
Error: No such node:
Change-Id: I3356a9e0ff3441eadb7a03fadc29538d8f8d94c2
diff --git a/_grains/docker_swarm.py b/_grains/docker_swarm.py
index 321697d..8dd6dc7 100644
--- a/_grains/docker_swarm.py
+++ b/_grains/docker_swarm.py
@@ -11,7 +11,7 @@
if os.path.exists('/var/lib/docker/swarm'):
try:
- inspect = json.loads(subprocess.check_output(["docker", "node", "inspect", "self"]).strip())[0]
+ inspect = json.loads(subprocess.check_output(["docker", "node", "inspect", "self"], stderr=subprocess.STDOUT).strip())[0]
except subprocess.CalledProcessError:
return None