Merge "Prevent the migration of VM with 'optimize' False in VM metadata"
This commit is contained in:
@@ -48,7 +48,7 @@ class Instance(compute_resource.ComputeResource):
|
||||
"disk": wfields.IntegerField(),
|
||||
"disk_capacity": wfields.NonNegativeIntegerField(),
|
||||
"vcpus": wfields.NonNegativeIntegerField(),
|
||||
"metadata": wfields.DictField(),
|
||||
"metadata": wfields.JsonField(),
|
||||
}
|
||||
|
||||
def accept(self, visitor):
|
||||
|
||||
@@ -235,3 +235,10 @@ class ModelRoot(nx.DiGraph, base.Model):
|
||||
model.add_instance(instance)
|
||||
|
||||
return model
|
||||
|
||||
@classmethod
|
||||
def is_isomorphic(cls, G1, G2):
|
||||
def node_match(node1, node2):
|
||||
return node1.as_dict() == node2.as_dict()
|
||||
return nx.algorithms.isomorphism.isomorph.is_isomorphic(
|
||||
G1, G2, node_match=node_match)
|
||||
|
||||
Reference in New Issue
Block a user