set default value to 0 instead of ''
hypervisor_version of z/VM driver returned '' but in fact it is defined as fields.IntegerField() which means it should be int value by default. Closes-Bug: 1862750 Change-Id: Ib4f2ecbbb731943eda996d525ddaafd2260fd1a3
This commit is contained in:
parent
1fcd74730d
commit
560987f920
|
@ -136,6 +136,7 @@ class TestZVMDriver(test.NoDBTestCase):
|
|||
self.assertEqual(0, results['vcpus'])
|
||||
self.assertEqual(0, results['memory_mb_used'])
|
||||
self.assertEqual(0, results['disk_available_least'])
|
||||
self.assertEqual(0, results['hypervisor_version'])
|
||||
self.assertEqual('TESTHOST', results['hypervisor_hostname'])
|
||||
|
||||
def test_driver_template_validation(self):
|
||||
|
|
|
@ -119,7 +119,7 @@ class ZVMDriver(driver.ComputeDriver):
|
|||
'local_gb_used': host_stats.get('disk_used', 0),
|
||||
'hypervisor_type': host_stats.get('hypervisor_type',
|
||||
obj_fields.HVType.ZVM),
|
||||
'hypervisor_version': host_stats.get('hypervisor_version', ''),
|
||||
'hypervisor_version': host_stats.get('hypervisor_version', 0),
|
||||
'hypervisor_hostname': host_stats.get('hypervisor_hostname',
|
||||
hypervisor_hostname),
|
||||
'cpu_info': jsonutils.dumps(host_stats.get('cpu_info', {})),
|
||||
|
|
Loading…
Reference in New Issue