Commit 3721d2fe authored by Guido Trotter's avatar Guido Trotter
Browse files

Fix rename for file-backed instances



Currently the code wrongly changes the disk logical/physical id
component representing the path from "$storage_dir/$iname/disk$seq" to
"$storage_dir/$iname/disk/$seq" (note the additional slash) breaking the
rename.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 2596526d
......@@ -924,10 +924,11 @@ class ConfigWriter:
if disk.dev_type == constants.LD_FILE:
# rename the file paths in logical and physical id
file_storage_dir = os.path.dirname(os.path.dirname(disk.logical_id[1]))
disk_fname = "disk%s" % disk.iv_name.split("/")[1]
disk.physical_id = disk.logical_id = (disk.logical_id[0],
utils.PathJoin(file_storage_dir,
inst.name,
disk.iv_name))
disk_fname))
self._config_data.instances[inst.name] = inst
self._WriteConfig()
......
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