Revision 2a52a064 lib/backend.py

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])

Also available in: Unified diff