diff options
| author | Soren Hansen <soren@linux2go.dk> | 2011-03-17 17:14:34 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-03-17 17:14:34 +0000 |
| commit | 0a08d4728b8d209fd62f994539c982d8fbac3ce5 (patch) | |
| tree | f7b37c708748bce10ce057f960e68248d9dc3f8e /nova | |
| parent | e1e9a2eb38dc58c73eae8ae1b6dab69bf2baa868 (diff) | |
| parent | 41619f49ce72d8e85f013c5a5dd248faa8490555 (diff) | |
| download | nova-0a08d4728b8d209fd62f994539c982d8fbac3ce5.tar.gz nova-0a08d4728b8d209fd62f994539c982d8fbac3ce5.tar.xz nova-0a08d4728b8d209fd62f994539c982d8fbac3ce5.zip | |
Comparisons to None should not use == or !=.
Stop converting sets to lists before comparing them. They might be in different order after being list()ified.
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/virt/libvirt_conn.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py index 2559c2b81..0a85da541 100644 --- a/nova/virt/libvirt_conn.py +++ b/nova/virt/libvirt_conn.py @@ -998,14 +998,14 @@ class LibvirtConnection(object): topology_node = xml.xpathEval('//host/cpu/topology')[0]\ .get_properties() topology = dict() - while topology_node != None: + while topology_node: name = topology_node.get_name() topology[name] = topology_node.getContent() topology_node = topology_node.get_next() keys = ['cores', 'sockets', 'threads'] tkeys = topology.keys() - if list(set(tkeys)) != list(set(keys)): + if set(tkeys) != set(keys): ks = ', '.join(keys) raise exception.Invalid(_("Invalid xml: topology(%(topology)s) " "must have %(ks)s") % locals()) |
