Revision 7d20c647
b/lib/confd/client.py | ||
---|---|---|
65 | 65 |
through asyncore or with your own handling. |
66 | 66 |
|
67 | 67 |
""" |
68 |
def __init__(self, hmac_key, peers, callback): |
|
68 |
def __init__(self, hmac_key, peers, callback, port=None):
|
|
69 | 69 |
"""Constructor for ConfdClient |
70 | 70 |
|
71 | 71 |
@type hmac_key: string |
... | ... | |
74 | 74 |
@param peers: list of peer nodes |
75 | 75 |
@type callback: f(L{ConfdUpcallPayload}) |
76 | 76 |
@param callback: function to call when getting answers |
77 |
@type port: integer |
|
78 |
@keyword port: confd port (default: use GetDaemonPort) |
|
77 | 79 |
|
78 | 80 |
""" |
79 | 81 |
if not isinstance(peers, list): |
... | ... | |
85 | 87 |
self._hmac_key = hmac_key |
86 | 88 |
self._socket = ConfdAsyncUDPClient(self) |
87 | 89 |
self._callback = callback |
90 |
self._confd_port = port |
|
88 | 91 |
self._requests = {} |
89 | 92 |
self._expire_requests = [] |
90 |
self._confd_port = utils.GetDaemonPort(constants.CONFD) |
|
93 |
|
|
94 |
if self._confd_port is None: |
|
95 |
self._confd_port = utils.GetDaemonPort(constants.CONFD) |
|
91 | 96 |
|
92 | 97 |
def _PackRequest(self, request, now=None): |
93 | 98 |
"""Prepare a request to be sent on the wire. |
Also available in: Unified diff