Update the dev_path on LVs on rename
authorIustin Pop <iustin@google.com>
Fri, 2 Nov 2007 13:43:29 +0000 (13:43 +0000)
committerIustin Pop <iustin@google.com>
Fri, 2 Nov 2007 13:43:29 +0000 (13:43 +0000)
When renaming a logical volume, we should change the dev_path (and other
internal variables) in order to be consistent.

Reviewed-by: imsnah

lib/bdev.py

index c0608dc..a2d7e4f 100644 (file)
@@ -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.