Commit 747ee762 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Klaus Aehlig

Export VLAN nicparam to NIC configuration scripts

The vlan nicparam is used in openvswitch mode. This patch
exports it as VLAN environment variable so that NIC
configuration scripts can later use it.
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 3d97b399
......@@ -1094,6 +1094,9 @@ class KVMHypervisor(hv_base.BaseHypervisor):
if nic.nicparams[constants.NIC_LINK]:
env["LINK"] = nic.nicparams[constants.NIC_LINK]
if nic.nicparams[constants.NIC_VLAN]:
env["VLAN"] = nic.nicparams[constants.NIC_VLAN]
if nic.network:
n = objects.Network.FromDict(nic.netinfo)
env.update(n.HooksDict())
......
......@@ -495,6 +495,7 @@ class XenHypervisor(hv_base.BaseHypervisor):
data.write("INTERFACE_UUID=%s\n" % nic.uuid)
data.write("MODE=%s\n" % nic.nicparams[constants.NIC_MODE])
data.write("LINK=%s\n" % nic.nicparams[constants.NIC_LINK])
data.write("VLAN=%s\n" % nic.nicparams[constants.NIC_VLAN])
try:
utils.WriteFile(cfg_file, data=data.getvalue())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment