Revision 2cc1da8b

b/lib/backend.py
1326 1326
  """
1327 1327
  parent_bdev = _RecursiveFindBD(parent_cdev)
1328 1328
  if parent_bdev is None:
1329
    logging.error("Can't find parent device")
1330
    return False
1329
    msg = "Can't find parent device %s" % str(parent_cdev)
1330
    logging.error("BlockdevAddchildren: %s", msg)
1331
    return (False, msg)
1331 1332
  new_bdevs = [_RecursiveFindBD(disk) for disk in new_cdevs]
1332 1333
  if new_bdevs.count(None) > 0:
1333
    logging.error("Can't find new device(s) to add: %s:%s",
1334
                  new_bdevs, new_cdevs)
1335
    return False
1334
    msg = "Can't find new device(s) to add: %s:%s" % (new_bdevs, new_cdevs)
1335
    logging.error(msg)
1336
    return (False, msg)
1336 1337
  parent_bdev.AddChildren(new_bdevs)
1337
  return True
1338
  return (True, None)
1338 1339

  
1339 1340

  
1340 1341
def BlockdevRemovechildren(parent_cdev, new_cdevs):
b/lib/cmdlib.py
5275 5275
      # now that the new lvs have the old name, we can add them to the device
5276 5276
      info("adding new mirror component on %s" % tgt_node)
5277 5277
      result = self.rpc.call_blockdev_addchildren(tgt_node, dev, new_lvs)
5278
      if result.failed or not result.data:
5278
      msg = result.RemoteFailMsg()
5279
      if msg:
5279 5280
        for new_lv in new_lvs:
5280 5281
          msg = self.rpc.call_blockdev_remove(tgt_node, new_lv).RemoteFailMsg()
5281 5282
          if msg:
5282 5283
            warning("Can't rollback device %s: %s", dev, msg,
5283 5284
                    hint="cleanup manually the unused logical volumes")
5284
        raise errors.OpExecError("Can't add local storage to drbd")
5285
        raise errors.OpExecError("Can't add local storage to drbd: %s" % msg)
5285 5286

  
5286 5287
      dev.children = new_lvs
5287 5288
      cfg.Update(instance)

Also available in: Unified diff