Commit be345db0 authored by Iustin Pop's avatar Iustin Pop
Browse files

Update the dev_path on LVs on rename

When renaming a logical volume, we should change the dev_path (and other
internal variables) in order to be consistent.

Reviewed-by: imsnah
parent 25a915d0
......@@ -290,7 +290,6 @@ class LogicalVolume(BlockDev):
self.dev_path = "/dev/%s/%s" % (self._vg_name, self._lv_name)
self.Attach()
@classmethod
def Create(cls, unique_id, children, size):
"""Create a new logical volume.
......@@ -380,6 +379,9 @@ class LogicalVolume(BlockDev):
if result.failed:
raise errors.BlockDeviceError("Failed to rename the logical volume: %s" %
result.output)
self._lv_name = new_name
self.dev_path = "/dev/%s/%s" % (self._vg_name, self._lv_name)
def Attach(self):
"""Attach to an existing LV.
......
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