Revision 3844af35
b/lib/config.py | ||
---|---|---|
1545 | 1545 |
inst = self._config_data.instances[old_name].Copy() |
1546 | 1546 |
inst.name = new_name |
1547 | 1547 |
|
1548 |
for (idx, disk) in enumerate(inst.disks):
|
|
1549 |
if disk.dev_type == constants.LD_FILE:
|
|
1548 |
for (_, disk) in enumerate(inst.disks):
|
|
1549 |
if disk.dev_type in [constants.DT_FILE, constants.DT_SHARED_FILE]:
|
|
1550 | 1550 |
# rename the file paths in logical and physical id |
1551 | 1551 |
file_storage_dir = os.path.dirname(os.path.dirname(disk.logical_id[1])) |
1552 | 1552 |
disk.logical_id = (disk.logical_id[0], |
1553 | 1553 |
utils.PathJoin(file_storage_dir, inst.name, |
1554 |
"disk%s" % idx))
|
|
1554 |
os.path.basename(disk.logical_id[1])))
|
|
1555 | 1555 |
disk.physical_id = disk.logical_id |
1556 | 1556 |
|
1557 | 1557 |
# Actually replace instance object |
Also available in: Unified diff