Revision 1d67656e lib/cmdlib.py

b/lib/cmdlib.py
2193 2193

  
2194 2194
    """
2195 2195
    env = _BuildInstanceHookEnvByObject(self.instance)
2196
    nl = ([self.sstore.GetMasterNode(), self.instance.primary_node] +
2197
          list(self.instance.secondary_nodes))
2196
    nl = [self.sstore.GetMasterNode()]
2198 2197
    return env, nl, nl
2199 2198

  
2200 2199
  def CheckPrereq(self):
......
2219 2218
                (instance.name, instance.primary_node))
2220 2219

  
2221 2220
    if not rpc.call_instance_shutdown(instance.primary_node, instance):
2222
      raise errors.OpExecError("Could not shutdown instance %s on node %s" %
2223
                               (instance.name, instance.primary_node))
2221
      if self.op.ignore_failures:
2222
        feedback_fn("Warning: can't shutdown instance")
2223
      else:
2224
        raise errors.OpExecError("Could not shutdown instance %s on node %s" %
2225
                                 (instance.name, instance.primary_node))
2224 2226

  
2225 2227
    logger.Info("removing block devices for instance %s" % instance.name)
2226 2228

  
2227
    _RemoveDisks(instance, self.cfg)
2229
    if not _RemoveDisks(instance, self.cfg):
2230
      if self.op.ignore_failures:
2231
        feedback_fn("Warning: can't remove instance's disks")
2232
      else:
2233
        raise errors.OpExecError("Can't remove instance's disks")
2228 2234

  
2229 2235
    logger.Info("removing instance %s out of cluster config" % instance.name)
2230 2236

  
......
2649 2655

  
2650 2656
  This abstracts away some work from `AddInstance()` and
2651 2657
  `RemoveInstance()`. Note that in case some of the devices couldn't
2652
  be remove, the removal will continue with the other ones (compare
2658
  be removed, the removal will continue with the other ones (compare
2653 2659
  with `_CreateDisks()`).
2654 2660

  
2655 2661
  Args:

Also available in: Unified diff