Hello Team,

Method '_GenericCheck' of 'TestInstance' test class inside
'test/py/ganeti.objects_unittest.py' has the following assertion:

self.assertEqual(inst.all_nodes[0], inst.primary_node,
                 msg="Primary node not first node in list")

i.e. it tests that the first node in 'all_nodes' is always the primary
node.

Inspecting the code shows that this is not the case.
'_ComputeAllNodes' uses sets which is an unordered type. Thus we can
not assume that primary node will always be the first node.

I wonder if only the test here is buggy (and should be fixed) or if
the assumption that primary node is the first node has been made
anywhere else in the code.

What do you think?
Ilias

-- 
Ilias Tsitsimpis
OpenPGP public key ID:
pub  4096R/25F3E3EE 2012-11-02 Ilias Tsitsimpis <[email protected]>
  Key fingerprint = 1986 21F5 7024 9B25 F4E2  4EF7 6FB8 90BA 25F3 E3EE

Attachment: signature.asc
Description: Digital signature

Reply via email to