[3.0-devel 1/1] Quickfix of merge bugs
by dashea
From: Jan Pokorny <japokorn(a)redhat.com>
- fixed bugs from manual merging
- updated test
- bugs originated in: e5e2483441beb59749a9e3c4fa320deb90ad45fd,
2daaaab4edcc32f740a139fca87eb176eaa5a981
---
blivet/blivet.py | 1 -
blivet/devicetree.py | 2 +-
blivet/osinstall.py | 9 ++++++++-
tests/blivet_test.py | 9 +++++----
4 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/blivet/blivet.py b/blivet/blivet.py
index 8faea58..978014a 100644
--- a/blivet/blivet.py
+++ b/blivet/blivet.py
@@ -69,7 +69,6 @@ def __init__(self, ksdata=None):
self.clear_part_choice = None
self.encrypted_autopart = False
self.encryption_passphrase = None
- self.autopart_type = AUTOPART_TYPE_LVM
self.encryption_cipher = None
self.escrow_certificates = {}
self.autopart_escrow_cert = None
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index dd6fd92..4f603ea 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -904,7 +904,7 @@ def __init__(self, passphrase=None, luks_dict=None, ignored_disks=None, exclusiv
self.luks_dict_passed = luks_dict
DeviceTreeBase.__init__(self, ignored_disks=ignored_disks, exclusive_disks=exclusive_disks)
- PopulatorMixin.__init__(self, passphrase=passphrase, luks_dict=luks_dict_passed, disk_images=disk_images)
+ PopulatorMixin.__init__(self, passphrase=passphrase, luks_dict=self.luks_dict_passed, disk_images=disk_images)
EventHandlerMixin.__init__(self)
# pylint: disable=arguments-differ
diff --git a/blivet/osinstall.py b/blivet/osinstall.py
index e49b7a4..23ec622 100644
--- a/blivet/osinstall.py
+++ b/blivet/osinstall.py
@@ -1622,8 +1622,14 @@ def _update_custom_storage_ksdata(self):
MDRaidArrayDevice: ("RaidData", "raid"),
BTRFSDevice: ("BTRFSData", "btrfs")}
+ # list comprehension that builds device ancestors should not get None as a member
+ # when searching for bootloader devices
+ bootloader_devices = []
+ if self.bootloader_device is not None:
+ bootloader_devices.append(self.bootloader_device)
+
# make a list of ancestors of all used devices
- devices = list(set(a for d in list(self.mountpoints.values()) + self.swaps
+ devices = list(set(a for d in list(self.mountpoints.values()) + self.swaps + bootloader_devices
for a in d.ancestors))
# devices which share information with their distinct raw device
@@ -1631,6 +1637,7 @@ def _update_custom_storage_ksdata(self):
devices.sort(key=lambda d: len(d.ancestors))
for device in devices:
+
cls = next((c for c in ks_map if isinstance(device, c)), None)
if cls is None:
log.info("omitting ksdata: %s", device)
diff --git a/tests/blivet_test.py b/tests/blivet_test.py
index 597b42b..6d11be4 100644
--- a/tests/blivet_test.py
+++ b/tests/blivet_test.py
@@ -2,7 +2,7 @@
from unittest.mock import PropertyMock
from unittest.mock import patch
from pykickstart.version import returnClassForVersion
-from blivet import Blivet
+from blivet.osinstall import InstallerStorage
from blivet.devices import PartitionDevice
from blivet import formats
from blivet.size import Size
@@ -18,14 +18,14 @@ def test_bootloader_in_kickstart(self):
in the kickstart data
'''
- with patch('blivet.blivet.Blivet.bootloader_device', new_callable=PropertyMock) as mock_bootloader_device:
- with patch('blivet.blivet.Blivet.mountpoints', new_callable=PropertyMock) as mock_mountpoints:
+ with patch('blivet.osinstall.InstallerStorage.bootloader_device', new_callable=PropertyMock) as mock_bootloader_device:
+ with patch('blivet.osinstall.InstallerStorage.mountpoints', new_callable=PropertyMock) as mock_mountpoints:
# set up prepboot partition
bootloader_device_obj = PartitionDevice("test_partition_device")
bootloader_device_obj.size = Size('5 MiB')
bootloader_device_obj.format = formats.get_format("prepboot")
- blivet_obj = Blivet()
+ blivet_obj = InstallerStorage()
# mountpoints must exist for update_ksdata to run
mock_bootloader_device.return_value = bootloader_device_obj
@@ -33,6 +33,7 @@ def test_bootloader_in_kickstart(self):
# initialize ksdata
test_ksdata = returnClassForVersion()()
+
blivet_obj.ksdata = test_ksdata
blivet_obj.update_ksdata()
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/142d69e61f3e4526d8edf2443085...
7 years, 11 months
[3.0-devel 1/1] Quickfix of merge bugs
by dashea
From: Jan Pokorny <japokorn(a)redhat.com>
- fixed bugs from manual merging
- updated test
- bugs originated in: e5e2483441beb59749a9e3c4fa320deb90ad45fd,
2daaaab4edcc32f740a139fca87eb176eaa5a981
---
blivet/blivet.py | 1 -
blivet/devicetree.py | 2 +-
blivet/osinstall.py | 9 ++++++++-
tests/blivet_test.py | 8 +++++---
4 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/blivet/blivet.py b/blivet/blivet.py
index 8faea58..978014a 100644
--- a/blivet/blivet.py
+++ b/blivet/blivet.py
@@ -69,7 +69,6 @@ def __init__(self, ksdata=None):
self.clear_part_choice = None
self.encrypted_autopart = False
self.encryption_passphrase = None
- self.autopart_type = AUTOPART_TYPE_LVM
self.encryption_cipher = None
self.escrow_certificates = {}
self.autopart_escrow_cert = None
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index dd6fd92..4f603ea 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -904,7 +904,7 @@ def __init__(self, passphrase=None, luks_dict=None, ignored_disks=None, exclusiv
self.luks_dict_passed = luks_dict
DeviceTreeBase.__init__(self, ignored_disks=ignored_disks, exclusive_disks=exclusive_disks)
- PopulatorMixin.__init__(self, passphrase=passphrase, luks_dict=luks_dict_passed, disk_images=disk_images)
+ PopulatorMixin.__init__(self, passphrase=passphrase, luks_dict=self.luks_dict_passed, disk_images=disk_images)
EventHandlerMixin.__init__(self)
# pylint: disable=arguments-differ
diff --git a/blivet/osinstall.py b/blivet/osinstall.py
index e49b7a4..23ec622 100644
--- a/blivet/osinstall.py
+++ b/blivet/osinstall.py
@@ -1622,8 +1622,14 @@ def _update_custom_storage_ksdata(self):
MDRaidArrayDevice: ("RaidData", "raid"),
BTRFSDevice: ("BTRFSData", "btrfs")}
+ # list comprehension that builds device ancestors should not get None as a member
+ # when searching for bootloader devices
+ bootloader_devices = []
+ if self.bootloader_device is not None:
+ bootloader_devices.append(self.bootloader_device)
+
# make a list of ancestors of all used devices
- devices = list(set(a for d in list(self.mountpoints.values()) + self.swaps
+ devices = list(set(a for d in list(self.mountpoints.values()) + self.swaps + bootloader_devices
for a in d.ancestors))
# devices which share information with their distinct raw device
@@ -1631,6 +1637,7 @@ def _update_custom_storage_ksdata(self):
devices.sort(key=lambda d: len(d.ancestors))
for device in devices:
+
cls = next((c for c in ks_map if isinstance(device, c)), None)
if cls is None:
log.info("omitting ksdata: %s", device)
diff --git a/tests/blivet_test.py b/tests/blivet_test.py
index 597b42b..a829383 100644
--- a/tests/blivet_test.py
+++ b/tests/blivet_test.py
@@ -3,6 +3,7 @@
from unittest.mock import patch
from pykickstart.version import returnClassForVersion
from blivet import Blivet
+from blivet.osinstall import InstallerStorage
from blivet.devices import PartitionDevice
from blivet import formats
from blivet.size import Size
@@ -18,14 +19,14 @@ def test_bootloader_in_kickstart(self):
in the kickstart data
'''
- with patch('blivet.blivet.Blivet.bootloader_device', new_callable=PropertyMock) as mock_bootloader_device:
- with patch('blivet.blivet.Blivet.mountpoints', new_callable=PropertyMock) as mock_mountpoints:
+ with patch('blivet.osinstall.InstallerStorage.bootloader_device', new_callable=PropertyMock) as mock_bootloader_device:
+ with patch('blivet.osinstall.InstallerStorage.mountpoints', new_callable=PropertyMock) as mock_mountpoints:
# set up prepboot partition
bootloader_device_obj = PartitionDevice("test_partition_device")
bootloader_device_obj.size = Size('5 MiB')
bootloader_device_obj.format = formats.get_format("prepboot")
- blivet_obj = Blivet()
+ blivet_obj = InstallerStorage()
# mountpoints must exist for update_ksdata to run
mock_bootloader_device.return_value = bootloader_device_obj
@@ -33,6 +34,7 @@ def test_bootloader_in_kickstart(self):
# initialize ksdata
test_ksdata = returnClassForVersion()()
+
blivet_obj.ksdata = test_ksdata
blivet_obj.update_ksdata()
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/8da772658514420622ddae944acf...
7 years, 11 months
[3.0-devel 1/1] Quickfix of merge bugs
by dashea
From: Jan Pokorny <japokorn(a)redhat.com>
- fixed bugs from manual merging
- updated test
---
blivet/blivet.py | 1 -
blivet/devicetree.py | 2 +-
blivet/osinstall.py | 9 ++++++++-
tests/blivet_test.py | 8 +++++---
4 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/blivet/blivet.py b/blivet/blivet.py
index 8faea58..978014a 100644
--- a/blivet/blivet.py
+++ b/blivet/blivet.py
@@ -69,7 +69,6 @@ def __init__(self, ksdata=None):
self.clear_part_choice = None
self.encrypted_autopart = False
self.encryption_passphrase = None
- self.autopart_type = AUTOPART_TYPE_LVM
self.encryption_cipher = None
self.escrow_certificates = {}
self.autopart_escrow_cert = None
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index dd6fd92..4f603ea 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -904,7 +904,7 @@ def __init__(self, passphrase=None, luks_dict=None, ignored_disks=None, exclusiv
self.luks_dict_passed = luks_dict
DeviceTreeBase.__init__(self, ignored_disks=ignored_disks, exclusive_disks=exclusive_disks)
- PopulatorMixin.__init__(self, passphrase=passphrase, luks_dict=luks_dict_passed, disk_images=disk_images)
+ PopulatorMixin.__init__(self, passphrase=passphrase, luks_dict=self.luks_dict_passed, disk_images=disk_images)
EventHandlerMixin.__init__(self)
# pylint: disable=arguments-differ
diff --git a/blivet/osinstall.py b/blivet/osinstall.py
index e49b7a4..908d7f8 100644
--- a/blivet/osinstall.py
+++ b/blivet/osinstall.py
@@ -1622,8 +1622,14 @@ def _update_custom_storage_ksdata(self):
MDRaidArrayDevice: ("RaidData", "raid"),
BTRFSDevice: ("BTRFSData", "btrfs")}
+ # list comprehension that builds device ancestors should not get None as a member
+ # when searching for bootloader devices
+ bootloader_devices = []
+ if self.bootloader_device is not None:
+ bootloader_devices.append(self.bootloader_device)
+
# make a list of ancestors of all used devices
- devices = list(set(a for d in list(self.mountpoints.values()) + self.swaps
+ devices = list(set(a for d in list(self.mountpoints.values()) + self.swaps + bootloader_devices
for a in d.ancestors))
# devices which share information with their distinct raw device
@@ -1631,6 +1637,7 @@ def _update_custom_storage_ksdata(self):
devices.sort(key=lambda d: len(d.ancestors))
for device in devices:
+
cls = next((c for c in ks_map if isinstance(device, c)), None)
if cls is None:
log.info("omitting ksdata: %s", device)
diff --git a/tests/blivet_test.py b/tests/blivet_test.py
index 597b42b..a829383 100644
--- a/tests/blivet_test.py
+++ b/tests/blivet_test.py
@@ -3,6 +3,7 @@
from unittest.mock import patch
from pykickstart.version import returnClassForVersion
from blivet import Blivet
+from blivet.osinstall import InstallerStorage
from blivet.devices import PartitionDevice
from blivet import formats
from blivet.size import Size
@@ -18,14 +19,14 @@ def test_bootloader_in_kickstart(self):
in the kickstart data
'''
- with patch('blivet.blivet.Blivet.bootloader_device', new_callable=PropertyMock) as mock_bootloader_device:
- with patch('blivet.blivet.Blivet.mountpoints', new_callable=PropertyMock) as mock_mountpoints:
+ with patch('blivet.osinstall.InstallerStorage.bootloader_device', new_callable=PropertyMock) as mock_bootloader_device:
+ with patch('blivet.osinstall.InstallerStorage.mountpoints', new_callable=PropertyMock) as mock_mountpoints:
# set up prepboot partition
bootloader_device_obj = PartitionDevice("test_partition_device")
bootloader_device_obj.size = Size('5 MiB')
bootloader_device_obj.format = formats.get_format("prepboot")
- blivet_obj = Blivet()
+ blivet_obj = InstallerStorage()
# mountpoints must exist for update_ksdata to run
mock_bootloader_device.return_value = bootloader_device_obj
@@ -33,6 +34,7 @@ def test_bootloader_in_kickstart(self):
# initialize ksdata
test_ksdata = returnClassForVersion()()
+
blivet_obj.ksdata = test_ksdata
blivet_obj.update_ksdata()
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/e74080c87815951b155cdf04d01d...
7 years, 11 months