Revision be0636e3

b/tools/burnin
456 456
    socket.setdefaulttimeout(options.net_timeout)
457 457

  
458 458
  def GetState(self):
459
    """Read the cluster state from the config."""
459
    """Read the cluster state from the master daemon."""
460 460
    if self.opts.nodes:
461 461
      names = self.opts.nodes.split(",")
462 462
    else:
......
486 486
    if not found:
487 487
      Err("OS '%s' not found" % self.opts.os)
488 488

  
489
    cluster_info = self.cl.QueryClusterInfo()
490
    self.cluster_info = cluster_info
491
    if not self.cluster_info:
492
      Err("Can't get cluster info")
493

  
494
    default_nic_params = self.cluster_info["nicparams"][constants.PP_DEFAULT]
495
    self.cluster_default_nicparams = default_nic_params
496

  
489 497
  @_DoCheckInstances
490 498
  @_DoBatch(False)
491 499
  def BurnCreateInstances(self):
......
913 921
      if opts.do_addremove_disks:
914 922
        self.BurnAddRemoveDisks()
915 923

  
924
      default_nic_mode = self.cluster_default_nicparams[constants.NIC_MODE]
925
      # Don't add/remove nics in routed mode, as we would need an ip to add
926
      # them with
916 927
      if opts.do_addremove_nics:
917
        self.BurnAddRemoveNICs()
928
        if default_nic_mode == constants.NIC_MODE_BRIDGED:
929
          self.BurnAddRemoveNICs()
930
        else:
931
          Log("Skipping nic add/remove as the cluster is not in bridged mode")
918 932

  
919 933
      if opts.do_activate_disks:
920 934
        self.BurnActivateDisks()

Also available in: Unified diff