Fixed the 'local_gb' disk size
This patch fixed the 'local_gb' disk size so as to return logical size rather than physical size. Change-Id: I87ab41e89ad26a67c3cfcaa864a41577fece001f
This commit is contained in:
@@ -474,8 +474,8 @@ def get_essential_properties(report, prop_keys):
|
||||
v = {}
|
||||
v['memory_mb'] = int(report.find('./System/Memory/Installed').text)
|
||||
v['local_gb'] = sum(
|
||||
[int(int(size.text) / 1000)
|
||||
for size in report.findall('.//PhysicalDrive/PhysicalSize')])
|
||||
[int(int(size.text) / 1024)
|
||||
for size in report.findall('.//PhysicalDrive/ConfigurableSize')])
|
||||
v['cpus'] = sum([int(cpu.find('./CoreNumber').text)
|
||||
for cpu in report.find('./System/Processor')
|
||||
if cpu.find('./CoreNumber') is not None])
|
||||
|
@@ -664,7 +664,7 @@ class SCCITestCase(testtools.TestCase):
|
||||
ESSENTIAL_PROPERTIES_KEYS = {
|
||||
'memory_mb', 'local_gb', 'cpus', 'cpu_arch'}
|
||||
expected = {'memory_mb': 8192,
|
||||
'local_gb': 190,
|
||||
'local_gb': 185,
|
||||
'cpus': 16,
|
||||
'cpu_arch': 'x86_64'}
|
||||
|
||||
@@ -677,7 +677,7 @@ class SCCITestCase(testtools.TestCase):
|
||||
ESSENTIAL_PROPERTIES_KEYS = {
|
||||
'memory_mb', 'local_gb', 'cpus', 'cpu_arch'}
|
||||
expected = {'memory_mb': 8192,
|
||||
'local_gb': 190,
|
||||
'local_gb': 185,
|
||||
'cpus': 16,
|
||||
'cpu_arch': 'x86_64'}
|
||||
|
||||
|
Reference in New Issue
Block a user