Revision 2a52a064

b/lib/backend.py
161 161
  for consumption here or from the node daemon.
162 162

  
163 163
  @rtype: tuple
164
  @return: (master_netdev, master_ip, master_name) if we have a good
165
      configuration, otherwise (None, None, None)
164
  @return: True, (master_netdev, master_ip, master_name) in case of success
165
  @raise RPCFail: in case of errors
166 166

  
167 167
  """
168 168
  try:
......
171 171
    master_ip = cfg.GetMasterIP()
172 172
    master_node = cfg.GetMasterNode()
173 173
  except errors.ConfigurationError, err:
174
    logging.exception("Cluster configuration incomplete")
175
    return (None, None, None)
176
  return (master_netdev, master_ip, master_node)
174
    _Fail("Cluster configuration incomplete", exc=True)
175
  return True, (master_netdev, master_ip, master_node)
177 176

  
178 177

  
179 178
def StartMaster(start_daemons):
......
189 188
  @rtype: None
190 189

  
191 190
  """
192
  master_netdev, master_ip, _ = GetMasterInfo()
193
  if not master_netdev:
194
    return False, "Cluster configuration incomplete, cannot read ssconf files"
191
  # GetMasterInfo will raise an exception if not able to return data
192
  master_netdev, master_ip, _ = GetMasterInfo()[1]
195 193

  
196 194
  payload = []
197 195
  if utils.TcpPing(master_ip, constants.DEFAULT_NODED_PORT):
......
242 240
  """
243 241
  # TODO: log and report back to the caller the error failures; we
244 242
  # need to decide in which case we fail the RPC for this
245
  master_netdev, master_ip, _ = GetMasterInfo()
246
  if not master_netdev:
247
    return False, "Cluster configuration incomplete, cannot read ssconf files"
243

  
244
  # GetMasterInfo will raise an exception if not able to return data
245
  master_netdev, master_ip, _ = GetMasterInfo()[1]
248 246

  
249 247
  result = utils.RunCmd(["ip", "address", "del", "%s/32" % master_ip,
250 248
                         "dev", master_netdev])
b/lib/bootstrap.py
511 511
  votes = {}
512 512
  for node in results:
513 513
    nres = results[node]
514
    data = nres.data
515
    if nres.failed or not isinstance(data, (tuple, list)) or len(data) < 3:
516
      # here the rpc layer should have already logged errors
514
    data = nres.payload
515
    msg = nres.RemoteFailMsg()
516
    fail = False
517
    if msg:
518
      logging.warning("Error contacting node %s: %s", node, msg)
519
      fail = True
520
    elif not isinstance(data, (tuple, list)) or len(data) < 3:
521
      logging.warning("Invalid data received from node %s: %s", node, data)
522
      fail = True
523
    if fail:
517 524
      if None not in votes:
518 525
        votes[None] = 0
519 526
      votes[None] += 1

Also available in: Unified diff