Revision da4a52a3 lib/cmdlib/backup.py

b/lib/cmdlib/backup.py
136 136
    """Check prerequisites.
137 137

  
138 138
    """
139
    self.instance = self.cfg.GetInstanceInfo(self.op.instance_name)
139
    self.instance = self.cfg.GetInstanceInfoByName(self.op.instance_name)
140 140
    assert self.instance is not None, \
141 141
          "Cannot retrieve locked instance %s" % self.op.instance_name
142 142
    CheckNodeOnline(self, self.instance.primary_node)
......
259 259
    This checks that the instance and node names are valid.
260 260

  
261 261
    """
262
    self.instance = self.cfg.GetInstanceInfo(self.op.instance_name)
262
    self.instance = self.cfg.GetInstanceInfoByName(self.op.instance_name)
263 263
    assert self.instance is not None, \
264 264
          "Cannot retrieve locked instance %s" % self.op.instance_name
265 265
    CheckNodeOnline(self, self.instance.primary_node)
......
504 504
    """Remove any export.
505 505

  
506 506
    """
507
    instance_name = self.cfg.ExpandInstanceName(self.op.instance_name)
507
    (_, inst_name) = self.cfg.ExpandInstanceName(self.op.instance_name)
508 508
    # If the instance was not found we'll try with the name that was passed in.
509 509
    # This will only work if it was an FQDN, though.
510 510
    fqdn_warn = False
511
    if not instance_name:
511
    if not inst_name:
512 512
      fqdn_warn = True
513
      instance_name = self.op.instance_name
513
      inst_name = self.op.instance_name
514 514

  
515 515
    locked_nodes = self.owned_locks(locking.LEVEL_NODE)
516 516
    exportlist = self.rpc.call_export_list(locked_nodes)
......
521 521
        self.LogWarning("Failed to query node %s (continuing): %s",
522 522
                        self.cfg.GetNodeName(node_uuid), msg)
523 523
        continue
524
      if instance_name in exportlist[node_uuid].payload:
524
      if inst_name in exportlist[node_uuid].payload:
525 525
        found = True
526
        result = self.rpc.call_export_remove(node_uuid, instance_name)
526
        result = self.rpc.call_export_remove(node_uuid, inst_name)
527 527
        msg = result.fail_msg
528 528
        if msg:
529 529
          logging.error("Could not remove export for instance %s"
530
                        " on node %s: %s", instance_name,
530
                        " on node %s: %s", inst_name,
531 531
                        self.cfg.GetNodeName(node_uuid), msg)
532 532

  
533 533
    if fqdn_warn and not found:

Also available in: Unified diff