summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-05-03 16:47:55 +0200
committerDaniil Baturin <daniil@baturin.org>2018-05-03 16:47:55 +0200
commit18c58a419dd2e89b5f092baef5e4cccbbe1408dc (patch)
treef84b9ae5818347d4222b254be17feed47c8d2b22
parentf4d9d3d9511300b1c309826aeee9b35ec282b327 (diff)
downloadvyatta-op-18c58a419dd2e89b5f092baef5e4cccbbe1408dc.tar.gz
vyatta-op-18c58a419dd2e89b5f092baef5e4cccbbe1408dc.zip
T618: supress stderr of hvinfo in the show version script.
Also convert the script to python3.
-rw-r--r--debian/control2
-rw-r--r--scripts/vyos-show-version6
2 files changed, 4 insertions, 4 deletions
diff --git a/debian/control b/debian/control
index 733e9eb..bd17cf4 100644
--- a/debian/control
+++ b/debian/control
@@ -33,7 +33,7 @@ Depends: sed (>= 4.1.5),
usbutils,
lsscsi,
hvinfo,
- python-pystache
+ python3-pystache
Suggests: util-linux (>= 2.13-5),
ncurses-bin (>= 5.5-5),
dialog
diff --git a/scripts/vyos-show-version b/scripts/vyos-show-version
index 438f365..be86b73 100644
--- a/scripts/vyos-show-version
+++ b/scripts/vyos-show-version
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Copyright (C) 2016 VyOS maintainers and contributors
#
@@ -74,9 +74,9 @@ version_data['system_arch'] = subprocess.check_output('uname -m', shell=True).st
# Get hypervisor name, if any
-system_type = "physical"
+system_type = "bare metal"
try:
- hypervisor = subprocess.check_output('hvinfo', shell=True).strip()
+ hypervisor = subprocess.check_output('hvinfo 2>/dev/null', shell=True).decode().strip()
system_type = "{0} guest".format(hypervisor)
except subprocess.CalledProcessError:
# hvinfo returns 1 if it cannot detect any hypervisor