[PATCH] Remove two methods that are never called

Vratislav Podzimek vpodzime at redhat.com
Fri Jul 18 08:15:35 UTC 2014


These two methods are never called and including them just for documentation
doesn't make much sense. They should live in the documentation if they are just
for documentation purposes.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 blivet/devices.py | 38 --------------------------------------
 1 file changed, 38 deletions(-)

diff --git a/blivet/devices.py b/blivet/devices.py
index a0f8f56..dd9236d 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -1818,21 +1818,6 @@ class PartitionDevice(StorageDevice):
                 except (errors.DMError, OSError):
                     pass
 
-    def deactivate(self):
-        """
-        This is never called. For instructional purposes only.
-
-        We do not want multipath partitions disappearing upon their teardown().
-        """
-        if self.parents[0].type == 'dm-multipath':
-            devmap = block.getMap(major=self.major, minor=self.minor)
-            if devmap:
-                try:
-                    block.removeDeviceMap(devmap)
-                except Exception as e:
-                    raise errors.DeviceTeardownError("failed to tear down device-mapper partition %s: %s" % (self.name, e))
-            udev.settle()
-
     def _getSize(self):
         """ Get the device's size. """
         size = self._size
@@ -4252,29 +4237,6 @@ class MultipathDevice(DMDevice):
         else:
             self.parents.append(parent)
 
-    def deactivate(self):
-        """
-        This is never called, included just for documentation.
-
-        If we called this during teardown(), we wouldn't be able to get parted
-        object because /dev/mapper/mpathX wouldn't exist.
-        """
-        if self.exists and os.path.exists(self.path):
-            #self.teardownPartitions()
-            #rc = util.run_program(["multipath", '-f', self.name])
-            #if rc:
-            #    raise MPathError("multipath deactivation failed for '%s'" %
-            #                    self.name)
-            bdev = block.getDevice(self.name)
-            devmap = block.getMap(major=bdev[0], minor=bdev[1])
-            if devmap.open_count:
-                return
-            try:
-                block.removeDeviceMap(devmap)
-            except Exception as e:
-                raise errors.MPathError("failed to tear down multipath device %s: %s"
-                                % (self.name, e))
-
     def _setup(self, orig=False):
         """ Open, or set up, a device. """
         log_method_call(self, self.name, orig=orig, status=self.status,
-- 
1.9.3



More information about the anaconda-patches mailing list