Revision 2a3bbbaa

b/lib/hypervisor/hv_kvm.py
1000 1000
    @type tap: str
1001 1001

  
1002 1002
    """
1003
    if instance.tags:
1004
      tags = " ".join(instance.tags)
1005
    else:
1006
      tags = ""
1007

  
1008 1003
    env = {
1009 1004
      "PATH": "%s:/sbin:/usr/sbin" % os.environ["PATH"],
1010 1005
      "INSTANCE": instance.name,
......
1012 1007
      "MODE": nic.nicparams[constants.NIC_MODE],
1013 1008
      "INTERFACE": tap,
1014 1009
      "INTERFACE_INDEX": str(seq),
1015
      "TAGS": tags,
1010
      "TAGS": " ".join(instance.GetTags()),
1016 1011
    }
1017 1012

  
1018 1013
    if nic.ip:
b/lib/hypervisor/hv_xen.py
411 411
    return utils.PathJoin(self._cfgdir, instance_name)
412 412

  
413 413
  @classmethod
414
  def _WriteNICInfoFile(cls, instance_name, idx, nic):
414
  def _WriteNICInfoFile(cls, instance, idx, nic):
415 415
    """Write the Xen config file for the instance.
416 416

  
417 417
    This version of the function just writes the config file from static data.
418 418

  
419 419
    """
420
    instance_name = instance.name
420 421
    dirs = [(dname, constants.RUN_DIRS_MODE)
421 422
            for dname in cls._DIRS + [cls._InstanceNICDir(instance_name)]]
422 423
    utils.EnsureDirs(dirs)
......
424 425
    cfg_file = cls._InstanceNICFile(instance_name, idx)
425 426
    data = StringIO()
426 427

  
428
    data.write("TAGS=%s\n" % "\ ".join(instance.GetTags()))
427 429
    if nic.netinfo:
428 430
      netinfo = objects.Network.FromDict(nic.netinfo)
429 431
      data.write("NETWORK_NAME=%s\n" % netinfo.name)
......
1051 1053
      if hvp[constants.HV_VIF_SCRIPT]:
1052 1054
        nic_str += ", script=%s" % hvp[constants.HV_VIF_SCRIPT]
1053 1055
      vif_data.append("'%s'" % nic_str)
1054
      self._WriteNICInfoFile(instance.name, idx, nic)
1056
      self._WriteNICInfoFile(instance, idx, nic)
1055 1057

  
1056 1058
    disk_data = \
1057 1059
      _GetConfigFileDiskData(block_devices, hvp[constants.HV_BLOCKDEV_PREFIX])
......
1231 1233
      if hvp[constants.HV_VIF_SCRIPT]:
1232 1234
        nic_str += ", script=%s" % hvp[constants.HV_VIF_SCRIPT]
1233 1235
      vif_data.append("'%s'" % nic_str)
1234
      self._WriteNICInfoFile(instance.name, idx, nic)
1236
      self._WriteNICInfoFile(instance, idx, nic)
1235 1237

  
1236 1238
    config.write("vif = [%s]\n" % ",".join(vif_data))
1237 1239

  

Also available in: Unified diff