Commit cc0d88e9 authored by Iustin Pop's avatar Iustin Pop

Reuse backend parameters from export

Similar to the previous patches, if we're missing some parameters and
the export has them (either in the new style or old-style), we reuse
them.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 9b12ed0f
......@@ -6288,6 +6288,18 @@ class LUCreateInstance(LogicalUnit):
if name not in self.op.hvparams:
self.op.hvparams[name] = value
if einfo.has_section(constants.INISECT_BEP):
# use the parameters, without overriding
for name, value in einfo.items(constants.INISECT_BEP):
if name not in self.op.beparams:
self.op.beparams[name] = value
else:
# try to read the parameters old style, from the main section
for name in constants.BES_PARAMETERS:
if (name not in self.op.beparams and
einfo.has_option(constants.INISECT_INS, name)):
self.op.beparams[name] = einfo.get(constants.INISECT_INS, name)
def CheckPrereq(self):
"""Check prerequisites.
......
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