Commit 0973f9ed authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Michele Tartara
Browse files

Fix backup import in case NIC is inside a network

Network UUID is written in .ini file during backup export
but is not used by _ReadExportParams(). This patch fixes it.

Please note that in case a network is given, link and mode should
not be included in NIC options.

This fixes issue 716.
Signed-off-by: default avatarDimitris Aragiorgis <>
Signed-off-by: default avatarMichele Tartara <>
Reviewed-by: default avatarMichele Tartara <>
parent 523170de
......@@ -757,7 +757,17 @@ class LUInstanceCreate(LogicalUnit):
for idx in range(constants.MAX_NICS):
if einfo.has_option(constants.INISECT_INS, "nic%d_mac" % idx):
ndict = {}
for name in list(constants.NICS_PARAMETERS) + ["ip", "mac"]:
for name in [constants.INIC_IP, constants.INIC_MAC]:
v = einfo.get(constants.INISECT_INS, "nic%d_%s" % (idx, name))
ndict[name] = v
network = einfo.get(constants.INISECT_INS,
"nic%d_%s" % (idx, constants.INIC_NETWORK))
# in case network is given link and mode are inherited
# from nodegroup's netparams and thus should not be passed here
if network:
ndict[constants.INIC_NETWORK] = network
for name in list(constants.NICS_PARAMETERS):
v = einfo.get(constants.INISECT_INS, "nic%d_%s" % (idx, name))
ndict[name] = v
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