Commit 4eef428e authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Jose A. Lopes

Fix a bug in InstanceSetParams concerning names

In case no name is passed in disk modifications we should
keep the old one. If name=none then set disk name to None.
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: default avatarJose A. Lopes <jabolopes@google.com>
parent b4e8599b
......@@ -3154,13 +3154,12 @@ class LUInstanceSetParams(LogicalUnit):
"""
changes = []
mode = params.get(constants.IDISK_MODE, None)
if mode:
disk.mode = mode
if constants.IDISK_MODE in params:
disk.mode = params.get(constants.IDISK_MODE)
changes.append(("disk.mode/%d" % idx, disk.mode))
name = params.get(constants.IDISK_NAME, None)
disk.name = name
if constants.IDISK_NAME in params:
disk.name = params.get(constants.IDISK_NAME)
changes.append(("disk.name/%d" % idx, disk.name))
return changes
......
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