Revision 8659b73e

b/lib/cmdlib.py
3354 3354

  
3355 3355
  """
3356 3356
  _OP_REQP = ["instance_name"]
3357
  REQ_BGL = False
3358

  
3359
  def ExpandNames(self):
3360
    self._ExpandAndLockInstance()
3357 3361

  
3358 3362
  def CheckPrereq(self):
3359 3363
    """Check prerequisites.
......
3361 3365
    This checks that the instance is in the cluster.
3362 3366

  
3363 3367
    """
3364
    instance = self.cfg.GetInstanceInfo(
3365
      self.cfg.ExpandInstanceName(self.op.instance_name))
3366
    if instance is None:
3367
      raise errors.OpPrereqError("Instance '%s' not known" %
3368
                                 self.op.instance_name)
3369
    self.instance = instance
3368
    self.instance = self.cfg.GetInstanceInfo(self.op.instance_name)
3369
    assert self.instance is not None, \
3370
      "Cannot retrieve locked instance %s" % self.op.instance_name
3370 3371

  
3371 3372
  def Exec(self, feedback_fn):
3372 3373
    """Connect to the console of an instance

Also available in: Unified diff