[master 1/3] Add a method to StorageDevice for updating its originalFormat.

dwlehman installerbot-noreply at redhat.com
Thu May 28 18:06:30 UTC 2015


From: David Lehman <dlehman at redhat.com>

Related: rhbz#1197582
---
 blivet/devices/storage.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/blivet/devices/storage.py b/blivet/devices/storage.py
index ebd0170..429f87c 100644
--- a/blivet/devices/storage.py
+++ b/blivet/devices/storage.py
@@ -123,7 +123,7 @@ def __init__(self, name, fmt=None, uuid=None,
         self.controllable = not flags.testing
 
         self.format = fmt
-        self.originalFormat = copy.copy(self.format)
+        self.updateOriginalFormat()
         self.fstabComment = ""
         self._targetSize = self._size
 
@@ -279,6 +279,10 @@ def updateSysfsPath(self):
             self.sysfsPath = udev_device.sys_path
             log.debug("%s sysfsPath set to %s", self.name, self.sysfsPath)
 
+    def updateOriginalFormat(self):
+        # pylint: disable=attribute-defined-outside-init
+        self.originalFormat = copy.copy(self.format)
+
     @property
     def formatArgs(self):
         """ Device-specific arguments to format creation program. """


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/6c8ee5f0240c20e9d925c8d7480d4c2b3fd37fe2


More information about the anaconda-patches mailing list