From fb04a2a9680f47455c675303afcb8f8a81da8152 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Jul 17 2017 09:35:35 +0000 Subject: inventory: Don't send 'yum' output to stdout The 'yum' command writes some output to stdout. This interferes with the inventory script's output of JSON on its stdout. So force all yum output to stderr. This is helpful for those invoking the scripts as well. --- diff --git a/inventory/standard-inventory-rpm b/inventory/standard-inventory-rpm index 791d169..af350e6 100755 --- a/inventory/standard-inventory-rpm +++ b/inventory/standard-inventory-rpm @@ -58,7 +58,7 @@ def host(rpms): install = [ "/usr/bin/yum", "-y", "install" ] + rpms try: - subprocess.check_call(install) + subprocess.check_call(install, stdout=sys.stderr.fileno()) except subprocess.CalledProcessError: raise RuntimeError("could not install rpms: {0}".format(rpms))