diff options
author | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-04-11 00:52:07 +0100 |
---|---|---|
committer | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-04-11 14:55:15 +0100 |
commit | 79ca3eba0f4667f1dd532e21d41d9b90eeddeed9 (patch) | |
tree | 4173590db56c0e4c25c1f48716c5939c28e5f93a /src/op_mode/version.py | |
parent | 52d120cfa137887a856025229421b1e01e4a7ecd (diff) | |
download | vyos-1x-79ca3eba0f4667f1dd532e21d41d9b90eeddeed9.tar.gz vyos-1x-79ca3eba0f4667f1dd532e21d41d9b90eeddeed9.zip |
util: T2226: do not use 2> but DEVNULL
Diffstat (limited to 'src/op_mode/version.py')
-rwxr-xr-x | src/op_mode/version.py | 3 |
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 |