Revision 43dc8496
b/lib/confd/querylib.py | ||
---|---|---|
94 | 94 |
It accepts no arguments, and returns the current cluster master. |
95 | 95 |
|
96 | 96 |
""" |
97 |
def _GetMasterNode(self): |
|
98 |
return self.reader.GetMasterNode() |
|
99 |
|
|
97 | 100 |
def Exec(self, query): |
98 | 101 |
"""ClusterMasterQuery main execution |
99 | 102 |
|
... | ... | |
109 | 112 |
answer = [] |
110 | 113 |
for field in req_fields: |
111 | 114 |
if field == constants.CONFD_REQFIELD_NAME: |
112 |
answer.append(self.reader.GetMasterNode())
|
|
115 |
answer.append(self._GetMasterNode())
|
|
113 | 116 |
elif field == constants.CONFD_REQFIELD_IP: |
114 | 117 |
answer.append(self.reader.GetMasterIP()) |
118 |
elif field == constants.CONFD_REQFIELD_MNODE_PIP: |
|
119 |
answer.append(self.reader.GetNodePrimaryIp(self._GetMasterNode())) |
|
115 | 120 |
else: |
116 | 121 |
logging.debug("missing FIELDS in query dict") |
117 | 122 |
return QUERY_ARGUMENT_ERROR |
b/lib/constants.py | ||
---|---|---|
691 | 691 |
|
692 | 692 |
CONFD_REQFIELD_NAME = "0" |
693 | 693 |
CONFD_REQFIELD_IP = "1" |
694 |
CONFD_REQFIELD_MNODE_PIP = "2" |
|
694 | 695 |
|
695 | 696 |
CONFD_REQS = frozenset([ |
696 | 697 |
CONFD_REQ_PING, |
Also available in: Unified diff