diff options
author | Daniil Baturin <daniil@baturin.org> | 2018-05-03 16:47:55 +0200 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2018-05-03 16:47:55 +0200 |
commit | 18c58a419dd2e89b5f092baef5e4cccbbe1408dc (patch) | |
tree | f84b9ae5818347d4222b254be17feed47c8d2b22 /scripts | |
parent | f4d9d3d9511300b1c309826aeee9b35ec282b327 (diff) | |
download | vyatta-op-18c58a419dd2e89b5f092baef5e4cccbbe1408dc.tar.gz vyatta-op-18c58a419dd2e89b5f092baef5e4cccbbe1408dc.zip |
T618: supress stderr of hvinfo in the show version script.
Also convert the script to python3.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vyos-show-version | 6 |
1 files changed, 3 insertions, 3 deletions
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 |