Revision 6fc914ba lib/cmdlib.py

b/lib/cmdlib.py
13033 13033
    if root.dev_type in constants.LDS_DRBD:
13034 13034
      self.cfg.AddTcpUdpPort(root.logical_id[2])
13035 13035

  
13036
  @staticmethod
13037
  def _CreateNewNic(idx, params, private):
13036
  def _CreateNewNic(self, idx, params, private):
13038 13037
    """Creates data structure for a new network interface.
13039 13038

  
13040 13039
    """
......
13043 13042
    network = params.get(constants.INIC_NETWORK, None)
13044 13043
    nicparams = private.filled
13045 13044

  
13046
    nic = objects.NIC(idx=-1, mac=mac, ip=ip,
13045
    nic = objects.NIC(idx=self.instance.hotplugs, mac=mac, ip=ip,
13047 13046
                      network=network, nicparams=nicparams)
13047
    self.instance.hotplugs += 1
13048

  
13048 13049
    desc =  [
13049 13050
      ("nic.%d" % idx,
13050 13051
       "add:mac=%s,ip=%s,mode=%s,link=%s,network=%s" %
......
13079 13080

  
13080 13081
    """
13081 13082
    if self.op.hotplug:
13082
      nic.idx = self.instance.hotplugs
13083
      self.instance.hotplugs += 1
13084 13083
      result = self.rpc.call_hot_add_nic(self.instance.primary_node,
13085 13084
                                         self.instance,
13086 13085
                                         nic,
......
13108 13107
                                self.instance,
13109 13108
                                nic)
13110 13109

  
13111
  @staticmethod
13112
  def _CheckItemHotPlug(item):
13113
    idict = item.ToDict()
13114
    return idict.get('pci', None)
13115

  
13116

  
13117

  
13118 13110
  def Exec(self, feedback_fn):
13119 13111
    """Modifies an instance.
13120 13112

  

Also available in: Unified diff