Lines 1-4
Link Here
|
1 |
# Copyright 2013 Gentoo Foundation |
1 |
# Copyright 2013-2019 Gentoo Authors |
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
3 |
|
4 |
import os |
4 |
import os |
Lines 11-20
def get_vm_info():
Link Here
|
11 |
|
11 |
|
12 |
vm_info = {} |
12 |
vm_info = {} |
13 |
|
13 |
|
|
|
14 |
env = os.environ.copy() |
15 |
env["LC_ALL"] = "C" |
16 |
|
14 |
if platform.system() == 'Linux': |
17 |
if platform.system() == 'Linux': |
15 |
try: |
18 |
try: |
16 |
proc = subprocess.Popen(["free"], |
19 |
proc = subprocess.Popen(["free"], |
17 |
stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
20 |
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env) |
18 |
except OSError: |
21 |
except OSError: |
19 |
pass |
22 |
pass |
20 |
else: |
23 |
else: |
Lines 49-55
def get_vm_info():
Link Here
|
49 |
|
52 |
|
50 |
try: |
53 |
try: |
51 |
proc = subprocess.Popen(["sysctl", "-a"], |
54 |
proc = subprocess.Popen(["sysctl", "-a"], |
52 |
stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
55 |
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env) |
53 |
except OSError: |
56 |
except OSError: |
54 |
pass |
57 |
pass |
55 |
else: |
58 |
else: |
56 |
- |
|
|