Revision cc6484c4 lib/confd/client.py

b/lib/confd/client.py
194 194
                                          )
195 195
        self._callback(client_reply)
196 196

  
197
  def SendRequest(self, request, args=None, coverage=None, async=True):
197
  def SendRequest(self, request, args=None, coverage=0, async=True):
198 198
    """Send a confd request to some MCs
199 199

  
200 200
    @type request: L{objects.ConfdRequest}
......
202 202
    @type args: tuple
203 203
    @param args: additional callback arguments
204 204
    @type coverage: integer
205
    @param coverage: number of remote nodes to contact
205
    @param coverage: number of remote nodes to contact; if default
206
        (0), it will use a reasonable default
207
        (L{ganeti.constants.CONFD_DEFAULT_REQ_COVERAGE}), if -1 is
208
        passed, it will use the maximum number of peers, otherwise the
209
        number passed in will be used
206 210
    @type async: boolean
207 211
    @param async: handle the write asynchronously
208 212

  
209 213
    """
210
    if coverage is None:
214
    if coverage == 0:
211 215
      coverage = min(len(self._peers), constants.CONFD_DEFAULT_REQ_COVERAGE)
216
    elif coverage == -1:
217
      coverage = len(self._peers)
212 218

  
213 219
    if coverage > len(self._peers):
214 220
      raise errors.ConfdClientError("Not enough MCs known to provide the"

Also available in: Unified diff