query: fix detection of master in _GetNodeRole()
authorApollon Oikonomopoulos <apoikos@gmail.com>
Fri, 17 Jan 2014 15:32:38 +0000 (17:32 +0200)
committerKlaus Aehlig <aehlig@google.com>
Mon, 20 Jan 2014 12:08:15 +0000 (13:08 +0100)
commit1ec34e2636440202e89707cb896545a9e62f63e0
treeef41e18250e0eca570b273520d8ae498a5735783
parent47387ccb5b333102e8a36f52a20870d2dca0b71a
query: fix detection of master in _GetNodeRole()

Commit 1c3231aa changed the invocation of _GetNodeRole() to pass the
master node by UUID and not by name, but didn't change the
implementation to compare the nodes by name. As a result, the master
node (which is also a master candidate) would always fall through to the
second option and be marked as 'C' instead as 'M'.

We fix this by modifying the implementation of _GetNodeRole() to perform
the comparison by UUID and also change the respective tests to test the
new API.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
lib/query.py
test/py/ganeti.query_unittest.py