Fix for flatten data for CSV reports
In case of lists or tuples we are joining data into one string. Joining of non-string types fixed. Vmware attributes added to tests for installation structure generation function. Change-Id: I46b21ae33fd4b50f0d2c5722584248beee8c4f17 Closes-Bug: #1439235
This commit is contained in:
parent
8f9dbca159
commit
0f91a26666
|
@ -53,7 +53,7 @@ def get_flatten_data(keys_paths, data):
|
|||
if d is None:
|
||||
break
|
||||
if isinstance(d, (list, tuple)):
|
||||
flatten_data.append(' '.join(d))
|
||||
flatten_data.append(' '.join(map(six.text_type, d)))
|
||||
else:
|
||||
flatten_data.append(d)
|
||||
return flatten_data
|
||||
|
|
|
@ -79,6 +79,9 @@ class InstStructureTest(BaseTest):
|
|||
'attributes': {
|
||||
'libvirt_type': random.choice(libvirt_names),
|
||||
'heat': random.choice((True, False)),
|
||||
},
|
||||
'vmware_attributes': {
|
||||
'vmware_az_cinder_enable': [True, False],
|
||||
}
|
||||
}
|
||||
network_configuration = self.generate_network_configuration()
|
||||
|
|
|
@ -223,3 +223,11 @@ class StatsToCsvExportTest(InstStructureTest, DbTest):
|
|||
flatten_cluster = list(flatten_clusters)[0]
|
||||
pos = csv_keys_paths.index(['nodes_platform_name_gt3'])
|
||||
self.assertEqual(True, flatten_cluster[pos])
|
||||
|
||||
def test_vmware_attributes(self):
|
||||
exporter = StatsToCsv()
|
||||
inst_structures = self.generate_inst_structures(
|
||||
clusters_num_range=(1, 1))
|
||||
result = exporter.export_clusters(inst_structures, [])
|
||||
for _ in result:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue