[blivet] Make appropriate changes to adapt for s390 libblockdev plugin.
Vratislav Podzimek
vpodzime at redhat.com
Sat May 16 07:29:00 UTC 2015
On Wed, 2015-05-13 at 14:16 -0400, Samantha N. Bueno wrote:
> This includes:
> -- removing blivet.devices.dasd
> -- moving some remaining, localized functions into blivet.devicetree
> (make_dasd_list and make_unformatted_dasd_list) or blivet.blivet
> (write_dasd_conf).
> -- getting rid of dasd/zfcp input sanitizing functions
> -- getting rid of the DASD test file (now in libblockdev)
> ---
> blivet/blivet.py | 15 ++-
> blivet/devicelibs/dasd.py | 184 -------------------------------------
> blivet/devicelibs/lvm.py | 2 +-
> blivet/devicetree.py | 38 +++++++-
> blivet/zfcp.py | 65 +------------
> tests/devicelibs_test/dasd_test.py | 32 -------
> 6 files changed, 55 insertions(+), 281 deletions(-)
> delete mode 100644 blivet/devicelibs/dasd.py
> delete mode 100644 tests/devicelibs_test/dasd_test.py
>
> diff --git a/blivet/blivet.py b/blivet/blivet.py
> index c49a380..3892580 100644
> --- a/blivet/blivet.py
> +++ b/blivet/blivet.py
> @@ -37,7 +37,6 @@ from .devices import MDRaidArrayDevice, PartitionDevice, TmpFSDevice, devicePath
> from .deviceaction import ActionCreateDevice, ActionCreateFormat, ActionDestroyDevice
> from .deviceaction import ActionDestroyFormat, ActionResizeDevice, ActionResizeFormat
> from .devicelibs.edd import get_edd_dict
> -from .devicelibs.dasd import make_dasd_list, write_dasd_conf
> from .errors import StorageError
> from .size import Size
> from .devicetree import DeviceTree
> @@ -263,7 +262,7 @@ class Blivet(object):
> self.iscsi.startup()
> self.fcoe.startup()
> self.zfcp.startup()
> - self.dasd = make_dasd_list(self.dasd, self.devices)
> + self.dasd = self.devicetree.make_dasd_list(self.dasd, self.devices)
>
> if self.dasd:
> # Reset the internal dasd list (823534)
> @@ -1399,6 +1398,18 @@ class Blivet(object):
> self.zfcp.write(getSysroot())
> write_dasd_conf(self.dasd, getSysroot())
>
> + def write_dasd_conf(self, disks, root):
> + """ Write /etc/dasd.conf to target system for all DASD devices
> + configured during installation.
> + """
> + if not (arch.isS390() or disks):
> + return
> +
> + with open(os.path.realpath(root + "/etc/dasd.conf"), "w") as f:
> + for dasd in sorted(disks, key=lambda d: d.name):
> + fields = [dasd.busid] + dasd.getOpts()
> + f.write("%s\n" % " ".join(fields),)
Extra comma above?
> diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
> index 6366703..f48743c 100644
> --- a/blivet/devicelibs/lvm.py
> +++ b/blivet/devicelibs/lvm.py
> @@ -79,7 +79,7 @@ def _set_global_config():
> if not flags.lvm_metadata_backup:
> config_string += "backup {backup=0 archive=0} "
>
> - blockdev.lvm.set_global_config(config_string)
> + blockdev.lvm_set_global_config(config_string)
Rebase artifact, I guess. (we don't want to do this change)
Looks good to me otherwise.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list