'get_volume_type_by_backendname' returns a list
Storage pool can have many volume types, 'get_volume_type_by_backendname' should return a list of types. Closes-Bug: #1733257 Change-Id: I877d5886259e482089ed0f9944d97bb99f375824
This commit is contained in:
@@ -56,7 +56,7 @@ class StorageNode(storage_resource.StorageResource):
|
||||
"zone": wfields.StringField(),
|
||||
"status": wfields.StringField(default=ServiceState.ENABLED.value),
|
||||
"state": wfields.StringField(default=ServiceState.ONLINE.value),
|
||||
"volume_type": wfields.StringField()
|
||||
"volume_type": wfields.ListOfStringsField()
|
||||
}
|
||||
|
||||
def accept(self, visitor):
|
||||
|
||||
@@ -508,7 +508,13 @@ class StorageModelRoot(nx.DiGraph, base.Model):
|
||||
|
||||
root = etree.fromstring(data)
|
||||
for cn in root.findall('.//StorageNode'):
|
||||
node = element.StorageNode(**cn.attrib)
|
||||
ndata = {}
|
||||
for attr, val in cn.items():
|
||||
ndata[attr] = val
|
||||
volume_type = ndata.get('volume_type')
|
||||
if volume_type:
|
||||
ndata['volume_type'] = [volume_type]
|
||||
node = element.StorageNode(**ndata)
|
||||
model.add_node(node)
|
||||
|
||||
for p in root.findall('.//Pool'):
|
||||
|
||||
Reference in New Issue
Block a user