This is not going to work the way you want it to.

As presently constituted, it will return the value of the "elected" master, not any "eligible" master node.  If you have 3 master eligible nodes, and the one you're normally pointing at is no longer the elected master, this will *always* fail.  You'd have to always find the elected master, and reconfigure the client to connect to only it.  Even in a split-brain scenario, you would be hitting the "elected" master of one side of the split.

Here's an example from my 2 node cluster (2 master nodes, 2 minimum masters so 2 are always required for quorum) and both nodes are up and the cluster is green:

```
>>> my_node_id = client.nodes.info('_local')['nodes'].keys()[0]
>>> my_node_id
u'LsfriHYWSTuP4xG00HpiKw'
>>> master_node_id = client.cluster.state(metric='master_node')['master_node']
>>> master_node_id
u'Je-JVV_LRMCeM4I6dr0Suw'
>>> client.cluster.state(metric='master_node')
{u'cluster_name': u'untergeek', u'master_node': u'Je-JVV_LRMCeM4I6dr0Suw'}
```

As you can see, the node ids differ, even though the cluster is completely valid to do operations from `my_node_id`