我有一个功能:
node = self.conn.NodeDriver.create_node(name = utils.VM_NAME %
(course_id, names[i], idx),
image = images[i],
size = sizes[i],
networks = network[i],
ex_keyname = key_pair.name)
self.nodes.append(node)
使用networks参数,我分配了一个这样的列表:
<OpenStackNetwork id="d271340d-a55c-4470-af22-42640072917f" name="n-89-net2" cidr="None">
编译时出现错误:
networks = network[i],
TypeError: 'OpenStackNetwork' object does not support indexing
请教我如何解决这个问题。谢谢你。