summaryrefslogtreecommitdiff
path: root/src/op_mode/version.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-11 20:36:39 +0200
committerGitHub <noreply@github.com>2020-04-11 20:36:39 +0200
commitda03bbf8767be74957baae68bf9ffc0e9f56ddac (patch)
treebcdfb217eb1bc75d06ce5af604836c6be999a749 /src/op_mode/version.py
parent143d292209b6ebe24f90667f2d5edd0216151163 (diff)
parent5763af8cbe7e2ad35a1eb336e77a6fe74ac2534e (diff)
downloadvyos-1x-da03bbf8767be74957baae68bf9ffc0e9f56ddac.tar.gz
vyos-1x-da03bbf8767be74957baae68bf9ffc0e9f56ddac.zip
Merge pull request #329 from thomas-mangin/T2226
util: T2226: improvement and fixes
Diffstat (limited to 'src/op_mode/version.py')
-rwxr-xr-xsrc/op_mode/version.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/op_mode/version.py b/src/op_mode/version.py
index fe6ecbae5..8599c958f 100755
--- a/src/op_mode/version.py
+++ b/src/op_mode/version.py
@@ -33,6 +33,7 @@ import vyos.limericks
from vyos.util import cmd
from vyos.util import call
from vyos.util import run
+from vyos.util import DEVNULL
parser = argparse.ArgumentParser()
@@ -82,7 +83,7 @@ if __name__ == '__main__':
# Get hypervisor name, if any
system_type = "bare metal"
try:
- hypervisor = cmd('hvinfo 2>/dev/null')
+ hypervisor = cmd('hvinfo',stderr=DEVNULL)
system_type = "{0} guest".format(hypervisor)
except OSError:
# hvinfo returns 1 if it cannot detect any hypervisor