aboutsummaryrefslogtreecommitdiff
path: root/src/facter.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-09-11 17:59:23 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-09-11 17:59:23 +0200
commit84374b4b4e41c4bb7896092c10098b5e6b5f68c1 (patch)
treee406322fb73570d5e1fbf5104326a8a8be2d2b0f /src/facter.py
parentc36a2b00e6a487f988a7286ccb9c8968a937f30c (diff)
downloadallocbench-84374b4b4e41c4bb7896092c10098b5e6b5f68c1.tar.gz
allocbench-84374b4b4e41c4bb7896092c10098b5e6b5f68c1.zip
explicitly collect binary versions
There is no generic way to retrieve the version of a binary. Not everyone followes GNU cli guidelines and supports "--version". The larson benchmark for example reads input from stdin when started with "larson --version" blocking the Benchmark.prepare() call.
Diffstat (limited to 'src/facter.py')
-rw-r--r--src/facter.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/facter.py b/src/facter.py
index 387c75c..a1ee952 100644
--- a/src/facter.py
+++ b/src/facter.py
@@ -110,13 +110,13 @@ def libc_ver(executable=None):
return ("glibc", glibc_version)
-def exec_ver(executable):
+def exe_version(executable, version_flag="--version"):
"""Return version of executable"""
- proc = subprocess.run([executable, "--version"],
+ proc = subprocess.run([executable, version_flag],
universal_newlines=True, stdout=subprocess.PIPE)
if proc.returncode != 0:
- print_error(f"failed to get version of {executable}")
+ print_warning(f"failed to get version of {executable}")
return ""
return proc.stdout[:-1]