From 18c58a419dd2e89b5f092baef5e4cccbbe1408dc Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 3 May 2018 16:47:55 +0200 Subject: T618: supress stderr of hvinfo in the show version script. Also convert the script to python3. --- scripts/vyos-show-version | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3