Hello community, here is the log from the commit of package python-kiwi for openSUSE:Factory checked in at 2020-12-12 20:27:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-kiwi (Old) and /work/SRC/openSUSE:Factory/.python-kiwi.new.2328 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-kiwi" Sat Dec 12 20:27:08 2020 rev:71 rq:854171 version:9.22.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-kiwi/python-kiwi.changes 2020-11-26 23:11:15.352926821 +0100 +++ /work/SRC/openSUSE:Factory/.python-kiwi.new.2328/python-kiwi.changes 2020-12-12 20:27:10.385527810 +0100 @@ -1,0 +2,128 @@ +Tue Dec 08 12:37:47 CET 2020 - Marcus Schäfer <[email protected]> + +- Bump version: 9.22.0 → 9.22.1 + +------------------------------------------------------------------- +Tue Dec 08 12:21:11 CET 2020 - Marcus Schäfer <[email protected]> + +- Fixed validation of bool value in dracut module + + The oem-multipath-scan setup results in a bool variable inside + of the initrd code. The variable kiwi_oemmultipath_scan is + therefore either set to "true" or "false". A check in code + of the form [ -n ... ] is stupid since the variable always + contains text. This commit fixes the validation to make use + of the bool() method provided for these type of variables + +------------------------------------------------------------------- +Thu Dec 03 15:37:30 CET 2020 - Marcus Schäfer <[email protected]> + +- Bump version: 9.21.26 → 9.22.0 + +------------------------------------------------------------------- +Thu Dec 03 10:35:34 CET 2020 - Marcus Schäfer <[email protected]> + +- Omit multipath module by default + + The plain installation of the multipath toolkit activates the + dracut multipath code. The setup if the target image runs in a + multipath environment or not should however be decided explicitly + in the image description via <oem-multipath-scan> and not + implicitly by the presence of tools + +------------------------------------------------------------------- +Wed Dec 02 16:15:00 CET 2020 - Marcus Schäfer <[email protected]> + +- Fixed multipath disk device assignment in kiwi lib + + The former lookup of the multipath mapped disk device contained + a race condition. If the lookup of the device mapper files happened + before multipathd has finished the initialization, kiwi continues + with the unix node name and fails when the device mapper keeps + a busy state on it. This commit changes the code such that in case + of an explicit request to use multipath the lookup of the mapped + device becomes a mandatory process that runs until the + DEVICE_TIMEOUT is reached. Default timeout is set to 60 sec. + This references Issue SUSE-Enceladus/azure-li-services#255 + +------------------------------------------------------------------- +Wed Nov 25 17:09:10 CET 2020 - Marcus Schäfer <[email protected]> + +- Fixed PackageManager decorator in unit test + + Implement patch decorators for factories consistently + +------------------------------------------------------------------- +Wed Nov 25 13:11:31 CET 2020 - Marcus Schäfer <[email protected]> + +- Refactor Repository + + This commit refactors the Repository class and turns it into a + proper factory class and also includes type hints to facilitate + it's use from an API POV. Related to #1498 + +------------------------------------------------------------------- +Tue Nov 24 18:09:41 CET 2020 - Neal Gompa <[email protected]> + +- Add DNF as a proper dependency for openSUSE + + This is required so that OBS can build openSUSE containers and appliances + using DNF as the package manager. + +------------------------------------------------------------------- +Tue Nov 24 18:05:29 CET 2020 - Marcus Schäfer <[email protected]> + +- Fixed spec file microdnf requirement + + SUSE/SLES doesn't provide microdnf within the official channels yet + +------------------------------------------------------------------- +Tue Nov 24 12:59:53 CET 2020 - Marcus Schäfer <[email protected]> + +- Refactor Partitioner + + This commit refactors the Partitioner class and turns it into a + proper factory class and also includes type hints to facilitate + it's use from an API POV. Related to #1498 + +------------------------------------------------------------------- +Tue Nov 24 12:58:20 CET 2020 - David Cassany <[email protected]> + +- Avoid using generators in pre-mount hooks + + This commit deletes the generator that was creating the sysroot.mount + unit for ramdisk deployments. Generators, specially the sysroot.mount is + expected to be created on very early stages of the boot procedure as + this has impact on relevant targets such as initrd-root-fs.target, which + does not depend on sysroot.mount if the unit is not there. + + In ramdisk deployments some data is known on pre-mount stage as + as it is downloaded from the PXE server. At this stage it is not safe to + generate a sysroot.mount unit that depends on initrd-root-fs.target as + the target is close to finalize or even finalized already and could + potentially skip sysroot.mount exection. + + Instead we include a mount hook which is only executed on ramdisk + deployments that simply runs the mount command to mount /sysroot. + + This fixes bsc#1178670 + +------------------------------------------------------------------- +Mon Nov 23 15:35:03 CET 2020 - Marcus Schäfer <[email protected]> + +- Refactor PackageManager + + This commit refactors the PackageManager class and turns it into + a proper factory class which also include type hints to facilitate + it's use from an API POV. Related to #1498 + +------------------------------------------------------------------- +Mon Nov 23 13:02:44 CET 2020 - Marcus Schäfer <[email protected]> + +- Refactor Markup + + This commit refactors the Markup class and turns it into a proper + factory class which also include type hints to facilitate it's + use from an API POV. Related to #1498 + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-kiwi.spec ++++++ --- /var/tmp/diff_new_pack.hbicJE/_old 2020-12-12 20:27:10.977528425 +0100 +++ /var/tmp/diff_new_pack.hbicJE/_new 2020-12-12 20:27:10.981528428 +0100 @@ -43,7 +43,7 @@ %endif Name: python-kiwi -Version: 9.21.26 +Version: 9.22.1 Provides: kiwi-schema = 7.2 Release: 0 Url: https://github.com/OSInside/kiwi @@ -124,9 +124,6 @@ Requires: qemu-img Requires: squashfs-tools Requires: gdisk -Requires: dnf -Provides: kiwi-packagemanager:dnf -Provides: kiwi-packagemanager:yum %if 0%{?fedora} || 0%{?rhel} >= 8 Recommends: gnupg2 %endif @@ -136,10 +133,15 @@ Recommends: dnf Recommends: gpg2 %endif -%if 0%{?fedora} || 0%{?rhel} >= 8 || 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150200 +%if 0%{?fedora} || 0%{?rhel} >= 8 || 0%{?suse_version} >= 1550 Provides: kiwi-packagemanager:microdnf Requires: microdnf %endif +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} >= 1550 +Requires: dnf +Provides: kiwi-packagemanager:dnf +Provides: kiwi-packagemanager:yum +%endif %if 0%{?fedora} >= 26 || 0%{?suse_version} Requires: zypper Provides: kiwi-packagemanager:zypper ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.hbicJE/_old 2020-12-12 20:27:11.013528462 +0100 +++ /var/tmp/diff_new_pack.hbicJE/_new 2020-12-12 20:27:11.013528462 +0100 @@ -3,7 +3,7 @@ pkgname=('python-kiwi' 'kiwi-man-pages' 'dracut-kiwi-lib' 'dracut-kiwi-oem-repart' 'dracut-kiwi-oem-dump' 'dracut-kiwi-live' 'dracut-kiwi-overlay') arch=(x86_64) -pkgver=9.21.26 +pkgver=9.22.1 pkgrel=0 pkgdesc="KIWI - Appliance Builder Next Generation" url="https://github.com/SUSE/kiwi/tarball/master" @@ -12,7 +12,7 @@ provides=(kiwi-ng kiwi) source=("${pkgname}.tar.gz") changelog="${pkgname}.changes" -md5sums=('8735e00d2760a850d5000d189b632c97') +md5sums=('d4b1b56e307ddb1f3488e4cbfa730659') build() { ++++++ python-kiwi.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/.bumpversion.cfg new/kiwi-9.22.1/.bumpversion.cfg --- old/kiwi-9.21.26/.bumpversion.cfg 2020-11-20 10:37:31.000000000 +0100 +++ new/kiwi-9.22.1/.bumpversion.cfg 2020-12-08 12:37:47.000000000 +0100 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 9.21.26 +current_version = 9.22.1 commit = True tag = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/PKG-INFO new/kiwi-9.22.1/PKG-INFO --- old/kiwi-9.21.26/PKG-INFO 2020-11-20 15:40:23.000000000 +0100 +++ new/kiwi-9.22.1/PKG-INFO 2020-12-08 12:39:40.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: kiwi -Version: 9.21.26 +Version: 9.22.1 Summary: KIWI - Appliance Builder (next generation) Home-page: https://osinside.github.io/kiwi Author: Marcus Schaefer Binary files old/kiwi-9.21.26/doc/build/latex/kiwi.pdf and new/kiwi-9.22.1/doc/build/latex/kiwi.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/doc/build/man/kiwi.8 new/kiwi-9.22.1/doc/build/man/kiwi.8 --- old/kiwi-9.21.26/doc/build/man/kiwi.8 2020-11-20 15:40:21.000000000 +0100 +++ new/kiwi-9.22.1/doc/build/man/kiwi.8 2020-12-08 12:39:38.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI" "8" "Nov 20, 2020" "9.21.26" "KIWI NG" +.TH "KIWI" "8" "Dec 08, 2020" "9.22.1" "KIWI NG" .SH NAME kiwi \- Creating Operating System Images . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/doc/build/man/kiwi::image::info.8 new/kiwi-9.22.1/doc/build/man/kiwi::image::info.8 --- old/kiwi-9.21.26/doc/build/man/kiwi::image::info.8 2020-11-20 15:40:21.000000000 +0100 +++ new/kiwi-9.22.1/doc/build/man/kiwi::image::info.8 2020-12-08 12:39:38.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::IMAGE::INFO" "8" "Nov 20, 2020" "9.21.26" "KIWI NG" +.TH "KIWI::IMAGE::INFO" "8" "Dec 08, 2020" "9.22.1" "KIWI NG" .SH NAME kiwi::image::info \- Provide detailed information about an image description . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/doc/build/man/kiwi::image::resize.8 new/kiwi-9.22.1/doc/build/man/kiwi::image::resize.8 --- old/kiwi-9.21.26/doc/build/man/kiwi::image::resize.8 2020-11-20 15:40:21.000000000 +0100 +++ new/kiwi-9.22.1/doc/build/man/kiwi::image::resize.8 2020-12-08 12:39:38.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::IMAGE::RESIZE" "8" "Nov 20, 2020" "9.21.26" "KIWI NG" +.TH "KIWI::IMAGE::RESIZE" "8" "Dec 08, 2020" "9.22.1" "KIWI NG" .SH NAME kiwi::image::resize \- Resize disk images to new geometry . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/doc/build/man/kiwi::result::bundle.8 new/kiwi-9.22.1/doc/build/man/kiwi::result::bundle.8 --- old/kiwi-9.21.26/doc/build/man/kiwi::result::bundle.8 2020-11-20 15:40:21.000000000 +0100 +++ new/kiwi-9.22.1/doc/build/man/kiwi::result::bundle.8 2020-12-08 12:39:38.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::RESULT::BUNDLE" "8" "Nov 20, 2020" "9.21.26" "KIWI NG" +.TH "KIWI::RESULT::BUNDLE" "8" "Dec 08, 2020" "9.22.1" "KIWI NG" .SH NAME kiwi::result::bundle \- Bundle build results . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/doc/build/man/kiwi::result::list.8 new/kiwi-9.22.1/doc/build/man/kiwi::result::list.8 --- old/kiwi-9.21.26/doc/build/man/kiwi::result::list.8 2020-11-20 15:40:21.000000000 +0100 +++ new/kiwi-9.22.1/doc/build/man/kiwi::result::list.8 2020-12-08 12:39:38.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::RESULT::LIST" "8" "Nov 20, 2020" "9.21.26" "KIWI NG" +.TH "KIWI::RESULT::LIST" "8" "Dec 08, 2020" "9.22.1" "KIWI NG" .SH NAME kiwi::result::list \- List build results . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/doc/build/man/kiwi::system::build.8 new/kiwi-9.22.1/doc/build/man/kiwi::system::build.8 --- old/kiwi-9.21.26/doc/build/man/kiwi::system::build.8 2020-11-20 15:40:21.000000000 +0100 +++ new/kiwi-9.22.1/doc/build/man/kiwi::system::build.8 2020-12-08 12:39:38.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::SYSTEM::BUILD" "8" "Nov 20, 2020" "9.21.26" "KIWI NG" +.TH "KIWI::SYSTEM::BUILD" "8" "Dec 08, 2020" "9.22.1" "KIWI NG" .SH NAME kiwi::system::build \- Build image in combined prepare and create step . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/doc/build/man/kiwi::system::create.8 new/kiwi-9.22.1/doc/build/man/kiwi::system::create.8 --- old/kiwi-9.21.26/doc/build/man/kiwi::system::create.8 2020-11-20 15:40:21.000000000 +0100 +++ new/kiwi-9.22.1/doc/build/man/kiwi::system::create.8 2020-12-08 12:39:38.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::SYSTEM::CREATE" "8" "Nov 20, 2020" "9.21.26" "KIWI NG" +.TH "KIWI::SYSTEM::CREATE" "8" "Dec 08, 2020" "9.22.1" "KIWI NG" .SH NAME kiwi::system::create \- Create image from prepared root system . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/doc/build/man/kiwi::system::prepare.8 new/kiwi-9.22.1/doc/build/man/kiwi::system::prepare.8 --- old/kiwi-9.21.26/doc/build/man/kiwi::system::prepare.8 2020-11-20 15:40:21.000000000 +0100 +++ new/kiwi-9.22.1/doc/build/man/kiwi::system::prepare.8 2020-12-08 12:39:38.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::SYSTEM::PREPARE" "8" "Nov 20, 2020" "9.21.26" "KIWI NG" +.TH "KIWI::SYSTEM::PREPARE" "8" "Dec 08, 2020" "9.22.1" "KIWI NG" .SH NAME kiwi::system::prepare \- Prepare image root system . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/doc/build/man/kiwi::system::update.8 new/kiwi-9.22.1/doc/build/man/kiwi::system::update.8 --- old/kiwi-9.21.26/doc/build/man/kiwi::system::update.8 2020-11-20 15:40:21.000000000 +0100 +++ new/kiwi-9.22.1/doc/build/man/kiwi::system::update.8 2020-12-08 12:39:38.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::SYSTEM::UPDATE" "8" "Nov 20, 2020" "9.21.26" "KIWI NG" +.TH "KIWI::SYSTEM::UPDATE" "8" "Dec 08, 2020" "9.22.1" "KIWI NG" .SH NAME kiwi::system::update \- Update/Upgrade image root system . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/dracut/modules.d/90kiwi-dump/kiwi-dump-image.sh new/kiwi-9.22.1/dracut/modules.d/90kiwi-dump/kiwi-dump-image.sh --- old/kiwi-9.21.26/dracut/modules.d/90kiwi-dump/kiwi-dump-image.sh 2020-10-27 10:16:17.000000000 +0100 +++ new/kiwi-9.22.1/dracut/modules.d/90kiwi-dump/kiwi-dump-image.sh 2020-12-08 12:37:37.000000000 +0100 @@ -53,6 +53,7 @@ disk_id=${kiwi_devicepersistency} fi max_disk=0 + kiwi_oemmultipath_scan=$(bool "${kiwi_oemmultipath_scan}") kiwi_oem_maxdisk=$(getarg rd.kiwi.oem.maxdisk=) if [ -n "${kiwi_oem_maxdisk}" ]; then max_disk=$(binsize_to_bytesize "${kiwi_oem_maxdisk}") || max_disk=0 @@ -71,7 +72,7 @@ # target should be a ramdisk on request. Thus instruct # lsblk to list only ramdisk devices (Major=1) blk_opts="-I 1 ${blk_opts}" - elif [ -n "${kiwi_oemmultipath_scan}" ];then + elif [ "${kiwi_oemmultipath_scan}" = "true" ];then scan_multipath_devices fi for disk_meta in $( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/dracut/modules.d/90kiwi-dump/kiwi-mount-ramdisk.sh new/kiwi-9.22.1/dracut/modules.d/90kiwi-dump/kiwi-mount-ramdisk.sh --- old/kiwi-9.21.26/dracut/modules.d/90kiwi-dump/kiwi-mount-ramdisk.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/kiwi-9.22.1/dracut/modules.d/90kiwi-dump/kiwi-mount-ramdisk.sh 2020-12-03 15:28:00.000000000 +0100 @@ -0,0 +1,38 @@ +#!/bin/bash +type setup_debug >/dev/null 2>&1 || . /lib/kiwi-lib.sh +type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh + +#====================================== +# Functions +#-------------------------------------- +function mount_ramdisk { + local root_dev + local boot_options + + boot_options="/config.bootoptions" + + if [ ! -e "${boot_options}" ]; then + die "Missing ${boot_options} file" + fi + + root_dev=$( + while read -r -d ' ' opt; do echo "${opt}";done < "${boot_options}" |\ + grep root= | cut -f2- -d= + ) + + if [ -z "${root_dev}" ]; then + die "'root=' argument not found in ${boot_options}" + fi + + mount --options defaults "${root_dev}" /sysroot +} + +#====================================== +# Mount ramdisk root in /sysroot +#-------------------------------------- + +setup_debug + +if getargbool 0 rd.kiwi.ramdisk; then + mount_ramdisk +fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/dracut/modules.d/90kiwi-dump/kiwi-ramdisk-deployment-generator.sh new/kiwi-9.22.1/dracut/modules.d/90kiwi-dump/kiwi-ramdisk-deployment-generator.sh --- old/kiwi-9.21.26/dracut/modules.d/90kiwi-dump/kiwi-ramdisk-deployment-generator.sh 2020-02-28 15:13:35.000000000 +0100 +++ new/kiwi-9.22.1/dracut/modules.d/90kiwi-dump/kiwi-ramdisk-deployment-generator.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,37 +0,0 @@ -#!/bin/bash - -type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh - -GENERATOR_DIR="$1" -[ -z "${GENERATOR_DIR}" ] && exit 1 -[ -d "${GENERATOR_DIR}" ] || mkdir -p "${GENERATOR_DIR}" - -[ -e /config.bootoptions ] || exit 1 - -root_uuid=$( - while read -r -d ' ' opt; do echo "${opt}";done < /config.bootoptions |\ - grep root= | cut -f2- -d= -) - -[ -z "${root_uuid}" ] && exit 1 - -{ - echo "[Unit]" - echo "Before=initrd-root-fs.target" - echo "[Mount]" - echo "Where=/sysroot" - echo "What=${root_uuid}" - _dev=RamDisk_rootfs -} > "$GENERATOR_DIR"/sysroot.mount - -if [ ! -e "$GENERATOR_DIR/initrd-root-fs.target.requires/sysroot.mount" ]; then - mkdir -p "$GENERATOR_DIR"/initrd-root-fs.target.requires - ln -s "$GENERATOR_DIR"/sysroot.mount \ - "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount -fi - -mkdir -p "$GENERATOR_DIR/$_dev.device.d" -{ - echo "[Unit]" - echo "JobTimeoutSec=60" -} > "$GENERATOR_DIR/$_dev.device.d/timeout.conf" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/dracut/modules.d/90kiwi-dump/module-setup.sh new/kiwi-9.22.1/dracut/modules.d/90kiwi-dump/module-setup.sh --- old/kiwi-9.21.26/dracut/modules.d/90kiwi-dump/module-setup.sh 2020-02-28 15:13:35.000000000 +0100 +++ new/kiwi-9.22.1/dracut/modules.d/90kiwi-dump/module-setup.sh 2020-12-03 15:28:00.000000000 +0100 @@ -30,9 +30,7 @@ inst_hook cmdline 30 "${moddir}/parse-kiwi-install.sh" inst_hook pre-mount 30 "${moddir}/kiwi-dump-image.sh" - - inst_script "${moddir}/kiwi-ramdisk-deployment-generator.sh" \ - "${systemdutildir}/system-generators/dracut-kiwi-ramdisk-generator" + inst_hook mount 30 "${moddir}/kiwi-mount-ramdisk.sh" inst_rules 60-cdrom_id.rules dracut_need_initqueue diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/dracut/modules.d/99kiwi-dump-reboot/kiwi-dump-reboot-system.sh new/kiwi-9.22.1/dracut/modules.d/99kiwi-dump-reboot/kiwi-dump-reboot-system.sh --- old/kiwi-9.21.26/dracut/modules.d/99kiwi-dump-reboot/kiwi-dump-reboot-system.sh 2020-09-08 10:00:40.000000000 +0200 +++ new/kiwi-9.22.1/dracut/modules.d/99kiwi-dump-reboot/kiwi-dump-reboot-system.sh 2020-12-03 15:28:00.000000000 +0100 @@ -40,8 +40,8 @@ if getargbool 0 rd.kiwi.ramdisk; then # For ramdisk deployment a kexec boot is not possible as it # will wipe the contents of the ramdisk. Therefore we prepare - # the switch_root from this deployment initrd. Also see the - # unit generator: dracut-kiwi-ramdisk-generator + # the switch_root from this deployment initrd. See + # kiwi-mount-ramdisk.sh mount hook for further details. image_target=$(get_selected_disk) kpartx -s -a "${image_target}" else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/dracut/modules.d/99kiwi-lib/kiwi-lib.sh new/kiwi-9.22.1/dracut/modules.d/99kiwi-lib/kiwi-lib.sh --- old/kiwi-9.21.26/dracut/modules.d/99kiwi-lib/kiwi-lib.sh 2020-03-25 17:28:28.000000000 +0100 +++ new/kiwi-9.22.1/dracut/modules.d/99kiwi-lib/kiwi-lib.sh 2020-12-08 12:37:37.000000000 +0100 @@ -19,12 +19,38 @@ echo "${root_map}" } +function get_mapped_multipath_disk { + declare DEVICE_TIMEOUT=${DEVICE_TIMEOUT} + local disk_device=$1 + local check=0 + local limit=30 + if [[ "${DEVICE_TIMEOUT}" =~ ^[0-9]+$ ]]; then + limit=$(((DEVICE_TIMEOUT + 1)/ 2)) + fi + udev_pending &>/dev/null + while true;do + for wwn in $(multipath -l -v1 "${disk_device}");do + if [ -e "/dev/mapper/${wwn}" ];then + echo "/dev/mapper/${wwn}" + return + fi + done + if [ "${check}" -eq "${limit}" ]; then + die "Multipath map for ${disk_device} did not show up" + fi + check=$((check + 1)) + sleep 2 + done +} + function lookup_disk_device_from_root { declare root=${root} declare kiwi_RaidDev=${kiwi_RaidDev} + declare kiwi_oemmultipath_scan=${kiwi_oemmultipath_scan} local root_device=${root#block:} local disk_device local wwn + kiwi_oemmultipath_scan=$(bool "${kiwi_oemmultipath_scan}") if [ -z "${root_device}" ];then die "No root device found" fi @@ -35,18 +61,10 @@ lsblk -p -n -r -s -o NAME,TYPE "${root_device}" |\ grep -E "disk|raid" | cut -f1 -d ' ' ); do - # Check if root_device is managed by multipath. If this - # is the case prefer the multipath mapped device because - # directly accessing the mapped devices is no longer - # possible - if type multipath &> /dev/null; then - for wwn in $(multipath -l -v1 "${disk_device}");do - if [ -e "/dev/mapper/${wwn}" ];then - disk_device="/dev/mapper/${wwn}" - echo "${disk_device}" - return - fi - done + # If multipath is requested, set the disk_device to the + # multipath mapped device + if [ "${kiwi_oemmultipath_scan}" = "true" ];then + disk_device=$(get_mapped_multipath_disk "${disk_device}") fi # Check if root_device is managed by mdadm and that the md raid # is not created as part of the kiwi image building process. If diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi/builder/disk.py new/kiwi-9.22.1/kiwi/builder/disk.py --- old/kiwi-9.21.26/kiwi/builder/disk.py 2020-11-09 15:33:59.000000000 +0100 +++ new/kiwi-9.22.1/kiwi/builder/disk.py 2020-12-03 15:28:00.000000000 +0100 @@ -573,7 +573,7 @@ firmware = FirmWare(self.xml_state) loop_provider = LoopDevice(disk_format.diskname) loop_provider.create(overwrite=False) - partitioner = Partitioner( + partitioner = Partitioner.new( firmware.get_partition_table_type(), loop_provider ) partitioner.resize_table() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi/markup/__init__.py new/kiwi-9.22.1/kiwi/markup/__init__.py --- old/kiwi-9.21.26/kiwi/markup/__init__.py 2020-09-08 10:00:40.000000000 +0200 +++ new/kiwi-9.22.1/kiwi/markup/__init__.py 2020-11-25 17:16:40.000000000 +0100 @@ -15,29 +15,47 @@ # You should have received a copy of the GNU General Public License # along with kiwi. If not, see <http://www.gnu.org/licenses/> # +import importlib +from abc import ( + ABCMeta, + abstractmethod +) import logging # project -from kiwi.markup.any import MarkupAny -from kiwi.markup.xml import MarkupXML - from kiwi.exceptions import KiwiAnyMarkupPluginError log = logging.getLogger('kiwi') -class Markup: +class Markup(metaclass=ABCMeta): """ **Markup factory** :param string description: path to description file :param string xml_content: description data as content string """ - def __new__(self, description): + @abstractmethod + def __init__(self) -> None: + return None # pragma: no cover + + @staticmethod + def new(description: str, name: str='any'): # noqa: E252 try: - markup = MarkupAny(description) + markup = Markup._load_markup_by_name(name, description) log.info('Support for multiple markup descriptions available') except KiwiAnyMarkupPluginError: - markup = MarkupXML(description) + markup = Markup._load_markup_by_name('xml', description) log.info('Support for XML markup available') return markup + + @staticmethod + def _load_markup_by_name(name, description): + name_map = { + 'any': 'Any', + 'xml': 'XML' + } + markup = importlib.import_module('kiwi.markup.{0}'.format(name)) + return markup.__dict__['Markup{0}'.format(name_map[name])]( + description + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi/package_manager/__init__.py new/kiwi-9.22.1/kiwi/package_manager/__init__.py --- old/kiwi-9.21.26/kiwi/package_manager/__init__.py 2020-11-16 16:19:06.000000000 +0100 +++ new/kiwi-9.22.1/kiwi/package_manager/__init__.py 2020-11-25 17:16:40.000000000 +0100 @@ -15,23 +15,21 @@ # You should have received a copy of the GNU General Public License # along with kiwi. If not, see <http://www.gnu.org/licenses/> # +import importlib +from typing import List +from abc import ( + ABCMeta, + abstractmethod +) import logging # project -from kiwi.package_manager.zypper import PackageManagerZypper -from kiwi.package_manager.apt import PackageManagerApt -from kiwi.package_manager.dnf import PackageManagerDnf -from kiwi.package_manager.microdnf import PackageManagerMicroDnf -from kiwi.package_manager.pacman import PackageManagerPacman - -from kiwi.exceptions import ( - KiwiPackageManagerSetupError -) +from kiwi.exceptions import KiwiPackageManagerSetupError log = logging.getLogger('kiwi') -class PackageManager: +class PackageManager(metaclass=ABCMeta): """ **Package manager factory** @@ -45,24 +43,39 @@ :rtype: PackageManagerBase subclass """ - def __new__(self, repository, package_manager, custom_args=None): - if package_manager == 'zypper': - manager = PackageManagerZypper(repository, custom_args) - elif package_manager == 'dnf' or package_manager == 'yum': - manager = PackageManagerDnf(repository, custom_args) - elif package_manager == 'microdnf': - manager = PackageManagerMicroDnf(repository, custom_args) - elif package_manager == 'apt-get': - manager = PackageManagerApt(repository, custom_args) - elif package_manager == 'pacman': - manager = PackageManagerPacman(repository, custom_args) - else: + @abstractmethod + def __init__(self) -> None: + return None # pragma: no cover + + @staticmethod + def new( + repository: object, package_manager_name: str, + custom_args: List=None # noqa: E252 + ): + name_map = { + 'zypper': ['zypper', 'Zypper'], + 'dnf': ['dnf', 'Dnf'], + 'yum': ['dnf', 'Dnf'], + 'microdnf': ['microdnf', 'MicroDnf'], + 'pacman': ['pacman', 'Pacman'], + 'apt-get': ['apt', 'Apt'] + } + try: + (module_namespace, module_name) = name_map[package_manager_name] + package_manager = importlib.import_module( + 'kiwi.package_manager.{0}'.format(module_namespace) + ) + module_name = 'PackageManager{0}'.format(module_name) + manager = package_manager.__dict__[module_name]( + repository, custom_args + ) + except Exception as issue: raise KiwiPackageManagerSetupError( - 'Support for package manager %s not implemented' % - package_manager + 'Support for package manager {0} not implemented {1}'.format( + package_manager_name, issue + ) ) - log.info( - 'Using package manager backend: %s', package_manager + 'Using package manager backend: {0}'.format(package_manager_name) ) return manager diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi/partitioner/__init__.py new/kiwi-9.22.1/kiwi/partitioner/__init__.py --- old/kiwi-9.21.26/kiwi/partitioner/__init__.py 2020-11-09 15:33:59.000000000 +0100 +++ new/kiwi-9.22.1/kiwi/partitioner/__init__.py 2020-12-03 15:28:00.000000000 +0100 @@ -15,22 +15,20 @@ # You should have received a copy of the GNU General Public License # along with kiwi. If not, see <http://www.gnu.org/licenses/> # +import importlib +from abc import ( + ABCMeta, + abstractmethod +) import logging # project -from kiwi.defaults import Defaults -from kiwi.partitioner.gpt import PartitionerGpt -from kiwi.partitioner.msdos import PartitionerMsDos -from kiwi.partitioner.dasd import PartitionerDasd - -from kiwi.exceptions import ( - KiwiPartitionerSetupError -) +from kiwi.exceptions import KiwiPartitionerSetupError log = logging.getLogger('kiwi') -class Partitioner: +class Partitioner(metaclass=ABCMeta): """ **Partitioner factory** @@ -38,42 +36,36 @@ :param object storage_provider: Instance of class based on DeviceProvider :param int start_sector: sector number """ - def __new__(self, table_type, storage_provider, start_sector=None): - host_architecture = Defaults.get_platform_name() - if host_architecture == 'x86_64': - if table_type == 'gpt': - return PartitionerGpt(storage_provider, start_sector) - elif table_type == 'msdos': - return PartitionerMsDos(storage_provider, start_sector) - - elif host_architecture == 'ix86': - if table_type == 'msdos': - return PartitionerMsDos(storage_provider, start_sector) - - elif 'ppc64' in host_architecture: - if table_type == 'gpt': - return PartitionerGpt(storage_provider, start_sector) - elif table_type == 'msdos': - return PartitionerMsDos(storage_provider, start_sector) - - elif 's390' in host_architecture: - if table_type == 'dasd': - if start_sector: - log.warning( - 'disk_start_sector value is ignored ' - 'for dasd partitions' - ) - return PartitionerDasd(storage_provider) - elif table_type == 'msdos': - return PartitionerMsDos(storage_provider, start_sector) - - elif 'arm' in host_architecture or host_architecture == 'aarch64': - if table_type == 'gpt': - return PartitionerGpt(storage_provider, start_sector) - elif table_type == 'msdos': - return PartitionerMsDos(storage_provider, start_sector) - - raise KiwiPartitionerSetupError( - 'Support for partitioner on %s architecture not implemented' % - host_architecture - ) + @abstractmethod + def __init__(self) -> None: + return None # pragma: no cover + + @staticmethod + def new( + table_type: str, storage_provider: object, + start_sector: int=None # noqa: E252 + ): + name_map = { + 'msdos': 'MsDos', + 'gpt': 'Gpt', + 'dasd': 'Dasd' + } + try: + partitioner = importlib.import_module( + 'kiwi.partitioner.{0}'.format(table_type) + ) + module_name = 'Partitioner{0}'.format(name_map[table_type]) + if table_type == 'dasd' and start_sector: + log.warning( + 'disk start_sector value is ignored for dasd partitions' + ) + start_sector = None + return partitioner.__dict__[module_name]( + storage_provider, start_sector + ) + except Exception as issue: + raise KiwiPartitionerSetupError( + 'Support for {0} partitioner not implemented: {1}'.format( + table_type, issue + ) + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi/repository/__init__.py new/kiwi-9.22.1/kiwi/repository/__init__.py --- old/kiwi-9.21.26/kiwi/repository/__init__.py 2020-11-16 16:19:06.000000000 +0100 +++ new/kiwi-9.22.1/kiwi/repository/__init__.py 2020-12-03 15:28:00.000000000 +0100 @@ -15,18 +15,18 @@ # You should have received a copy of the GNU General Public License # along with kiwi. If not, see <http://www.gnu.org/licenses/> # -# project -from kiwi.repository.zypper import RepositoryZypper -from kiwi.repository.apt import RepositoryApt -from kiwi.repository.dnf import RepositoryDnf -from kiwi.repository.pacman import RepositoryPacman - -from kiwi.exceptions import ( - KiwiRepositorySetupError +import importlib +from typing import List +from abc import ( + ABCMeta, + abstractmethod ) +# project +from kiwi.exceptions import KiwiRepositorySetupError + -class Repository: +class Repository(metaclass=ABCMeta): """ **Repository factory** @@ -37,17 +37,34 @@ :raises KiwiRepositorySetupError: if package_manager is not supported """ - def __new__(self, root_bind, package_manager, custom_args=None): - if package_manager == 'zypper': - return RepositoryZypper(root_bind, custom_args) - elif package_manager == 'dnf' or package_manager == 'yum' or package_manager == 'microdnf': - return RepositoryDnf(root_bind, custom_args) - elif package_manager == 'apt-get': - return RepositoryApt(root_bind, custom_args) - elif package_manager == 'pacman': - return RepositoryPacman(root_bind, custom_args) - else: + @abstractmethod + def __init__(self) -> None: + return None # pragma: no cover + + @staticmethod + def new( + root_bind: object, package_manager: str, + custom_args: List=None # noqa: E252 + ): + name_map = { + 'zypper': ['zypper', 'Zypper'], + 'dnf': ['dnf', 'Dnf'], + 'yum': ['dnf', 'Dnf'], + 'microdnf': ['dnf', 'Dnf'], + 'apt-get': ['apt', 'Apt'], + 'pacman': ['pacman', 'Pacman'] + } + try: + repository = importlib.import_module( + 'kiwi.repository.{0}'.format(name_map[package_manager][0]) + ) + module_name = 'Repository{0}'.format(name_map[package_manager][1]) + return repository.__dict__[module_name]( + root_bind, custom_args + ) + except Exception as issue: raise KiwiRepositorySetupError( - 'Support for %s repository manager not implemented' % - package_manager + 'Support for {0} repository not implemented: {1}'.format( + package_manager, issue + ) ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi/storage/disk.py new/kiwi-9.22.1/kiwi/storage/disk.py --- old/kiwi-9.21.26/kiwi/storage/disk.py 2020-10-28 12:44:07.000000000 +0100 +++ new/kiwi-9.22.1/kiwi/storage/disk.py 2020-12-03 15:28:00.000000000 +0100 @@ -48,7 +48,7 @@ self.partition_id_map = {} self.is_mapped = False - self.partitioner = Partitioner( + self.partitioner = Partitioner.new( table_type, storage_provider, start_sector ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi/system/prepare.py new/kiwi-9.22.1/kiwi/system/prepare.py --- old/kiwi-9.21.26/kiwi/system/prepare.py 2020-11-03 15:22:45.000000000 +0100 +++ new/kiwi-9.22.1/kiwi/system/prepare.py 2020-12-03 15:28:00.000000000 +0100 @@ -122,7 +122,7 @@ repository_options.append( '_install_langs%{0}'.format(':'.join(rpm_locale_list)) ) - repo = Repository( + repo = Repository.new( self.root_bind, package_manager, repository_options ) repo.setup_package_database_configuration() @@ -177,7 +177,7 @@ repo.delete_repo_cache(repo_alias) self.uri_list.append(uri) repo.cleanup_unused_repos() - return PackageManager( + return PackageManager.new( repo, package_manager ) @@ -340,8 +340,8 @@ try: if manager is None: package_manager = self.xml_state.get_package_manager() - manager = PackageManager( - Repository(self.root_bind, package_manager), + manager = PackageManager.new( + Repository.new(self.root_bind, package_manager), package_manager ) self.delete_packages( @@ -459,8 +459,8 @@ at run time such as macros """ package_manager = self.xml_state.get_package_manager() - manager = PackageManager( - Repository(self.root_bind, package_manager), + manager = PackageManager.new( + Repository.new(self.root_bind, package_manager), package_manager ) manager.clean_leftovers() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi/system/setup.py new/kiwi-9.22.1/kiwi/system/setup.py --- old/kiwi-9.21.26/kiwi/system/setup.py 2020-10-22 16:15:59.000000000 +0200 +++ new/kiwi-9.22.1/kiwi/system/setup.py 2020-12-03 15:28:00.000000000 +0100 @@ -137,7 +137,7 @@ root = RootInit( root_dir=self.root_dir, allow_existing=True ) - repo = Repository( + repo = Repository.new( RootBind(root), self.xml_state.get_package_manager() ) repo.use_default_location() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi/tasks/image_resize.py new/kiwi-9.22.1/kiwi/tasks/image_resize.py --- old/kiwi-9.21.26/kiwi/tasks/image_resize.py 2020-11-02 16:15:41.000000000 +0100 +++ new/kiwi-9.22.1/kiwi/tasks/image_resize.py 2020-12-03 15:28:00.000000000 +0100 @@ -122,7 +122,7 @@ firmware = FirmWare(self.xml_state) loop_provider = LoopDevice(image_format.diskname) loop_provider.create(overwrite=False) - partitioner = Partitioner( + partitioner = Partitioner.new( firmware.get_partition_table_type(), loop_provider ) partitioner.resize_table() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi/version.py new/kiwi-9.22.1/kiwi/version.py --- old/kiwi-9.21.26/kiwi/version.py 2020-11-20 10:37:31.000000000 +0100 +++ new/kiwi-9.22.1/kiwi/version.py 2020-12-08 12:37:47.000000000 +0100 @@ -18,5 +18,5 @@ """ Global version information used in kiwi and the package """ -__version__ = '9.21.26' -__githash__ = 'c71e0ce944318df9df895de63e7bfaf24251f471' +__version__ = '9.22.1' +__githash__ = '4aa07502a0c74789e2137b60fe57c1d1230d3eb0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi/xml_description.py new/kiwi-9.22.1/kiwi/xml_description.py --- old/kiwi-9.21.26/kiwi/xml_description.py 2020-11-18 11:52:21.000000000 +0100 +++ new/kiwi-9.22.1/kiwi/xml_description.py 2020-11-25 17:16:40.000000000 +0100 @@ -67,7 +67,7 @@ raise KiwiDescriptionConflict( 'description and xml_content are mutually exclusive' ) - self.markup = Markup(description or xml_content) + self.markup = Markup.new(description or xml_content) self.description = self.markup.get_xml_description() self.derived_from = derived_from self.description_origin = description diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi/xml_state.py new/kiwi-9.22.1/kiwi/xml_state.py --- old/kiwi-9.21.26/kiwi/xml_state.py 2020-11-09 15:33:59.000000000 +0100 +++ new/kiwi-9.22.1/kiwi/xml_state.py 2020-12-03 15:37:03.000000000 +0100 @@ -881,7 +881,7 @@ def get_oemconfig_oem_multipath_scan(self): """ State value to activate multipath maps. Returns a boolean - value if specified or None + value if specified or False :return: Content of <oem-multipath-scan> section value @@ -890,6 +890,7 @@ oemconfig = self.get_build_type_oemconfig_section() if oemconfig and oemconfig.get_oem_multipath_scan(): return oemconfig.get_oem_multipath_scan()[0] + return False def get_oemconfig_swap_mbytes(self): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi.egg-info/PKG-INFO new/kiwi-9.22.1/kiwi.egg-info/PKG-INFO --- old/kiwi-9.21.26/kiwi.egg-info/PKG-INFO 2020-11-20 15:40:22.000000000 +0100 +++ new/kiwi-9.22.1/kiwi.egg-info/PKG-INFO 2020-12-08 12:39:39.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: kiwi -Version: 9.21.26 +Version: 9.22.1 Summary: KIWI - Appliance Builder (next generation) Home-page: https://osinside.github.io/kiwi Author: Marcus Schaefer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/kiwi.egg-info/SOURCES.txt new/kiwi-9.22.1/kiwi.egg-info/SOURCES.txt --- old/kiwi-9.21.26/kiwi.egg-info/SOURCES.txt 2020-11-20 15:40:22.000000000 +0100 +++ new/kiwi-9.22.1/kiwi.egg-info/SOURCES.txt 2020-12-08 12:39:39.000000000 +0100 @@ -22,7 +22,7 @@ dracut/modules.d/90kiwi-dump/kiwi-dump-image.sh dracut/modules.d/90kiwi-dump/kiwi-installer-device.sh dracut/modules.d/90kiwi-dump/kiwi-installer-genrules.sh -dracut/modules.d/90kiwi-dump/kiwi-ramdisk-deployment-generator.sh +dracut/modules.d/90kiwi-dump/kiwi-mount-ramdisk.sh dracut/modules.d/90kiwi-dump/module-setup.sh dracut/modules.d/90kiwi-dump/parse-kiwi-install.sh dracut/modules.d/90kiwi-live/kiwi-generator.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/package/python-kiwi-spec-template new/kiwi-9.22.1/package/python-kiwi-spec-template --- old/kiwi-9.21.26/package/python-kiwi-spec-template 2020-11-16 16:19:06.000000000 +0100 +++ new/kiwi-9.22.1/package/python-kiwi-spec-template 2020-12-03 15:28:00.000000000 +0100 @@ -124,9 +124,6 @@ Requires: qemu-img Requires: squashfs-tools Requires: gdisk -Requires: dnf -Provides: kiwi-packagemanager:dnf -Provides: kiwi-packagemanager:yum %if 0%{?fedora} || 0%{?rhel} >= 8 Recommends: gnupg2 %endif @@ -136,10 +133,15 @@ Recommends: dnf Recommends: gpg2 %endif -%if 0%{?fedora} || 0%{?rhel} >= 8 || 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150200 +%if 0%{?fedora} || 0%{?rhel} >= 8 || 0%{?suse_version} >= 1550 Provides: kiwi-packagemanager:microdnf Requires: microdnf %endif +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} >= 1550 +Requires: dnf +Provides: kiwi-packagemanager:dnf +Provides: kiwi-packagemanager:yum +%endif %if 0%{?fedora} >= 26 || 0%{?suse_version} Requires: zypper Provides: kiwi-packagemanager:zypper diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/test/unit/builder/disk_test.py new/kiwi-9.22.1/test/unit/builder/disk_test.py --- old/kiwi-9.21.26/test/unit/builder/disk_test.py 2020-11-03 15:22:45.000000000 +0100 +++ new/kiwi-9.22.1/test/unit/builder/disk_test.py 2020-12-03 15:28:00.000000000 +0100 @@ -870,7 +870,7 @@ ) @patch('kiwi.builder.disk.LoopDevice') - @patch('kiwi.builder.disk.Partitioner') + @patch('kiwi.builder.disk.Partitioner.new') @patch('kiwi.builder.disk.DiskFormat.new') def test_append_unpartitioned_space( self, mock_diskformat, mock_partitioner, mock_loopdevice diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/test/unit/markup/markup_test.py new/kiwi-9.22.1/test/unit/markup/markup_test.py --- old/kiwi-9.21.26/test/unit/markup/markup_test.py 2020-09-08 10:00:40.000000000 +0200 +++ new/kiwi-9.22.1/test/unit/markup/markup_test.py 2020-11-25 17:16:40.000000000 +0100 @@ -6,14 +6,14 @@ class TestMarkup: - @patch('kiwi.markup.MarkupAny') + @patch('kiwi.markup.any.MarkupAny') def test_MarkupAny(self, mock_MarkupAny): - Markup('description') + Markup.new('description') mock_MarkupAny.assert_called_once_with('description') - @patch('kiwi.markup.MarkupXML') - @patch('kiwi.markup.MarkupAny') + @patch('kiwi.markup.xml.MarkupXML') + @patch('kiwi.markup.any.MarkupAny') def test_MarkupXML(self, mock_MarkupAny, mock_MarkupXML): mock_MarkupAny.side_effect = KiwiAnyMarkupPluginError('load-error') - Markup('description') + Markup.new('description') mock_MarkupXML.assert_called_once_with('description') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/test/unit/package_manager/init_test.py new/kiwi-9.22.1/test/unit/package_manager/init_test.py --- old/kiwi-9.21.26/test/unit/package_manager/init_test.py 2020-11-16 16:19:06.000000000 +0100 +++ new/kiwi-9.22.1/test/unit/package_manager/init_test.py 2020-11-25 17:16:40.000000000 +0100 @@ -11,40 +11,40 @@ class TestPackageManager: def test_package_manager_not_implemented(self): with raises(KiwiPackageManagerSetupError): - PackageManager('repository', 'ms-manager') + PackageManager.new('repository', 'ms-manager') - @patch('kiwi.package_manager.PackageManagerZypper') + @patch('kiwi.package_manager.zypper.PackageManagerZypper') def test_manager_zypper(self, mock_manager): repository = Mock() - PackageManager(repository, 'zypper') + PackageManager.new(repository, 'zypper') mock_manager.assert_called_once_with(repository, None) - @patch('kiwi.package_manager.PackageManagerDnf') + @patch('kiwi.package_manager.dnf.PackageManagerDnf') def test_manager_dnf(self, mock_manager): repository = Mock() - PackageManager(repository, 'dnf') + PackageManager.new(repository, 'dnf') mock_manager.assert_called_once_with(repository, None) - @patch('kiwi.package_manager.PackageManagerDnf') + @patch('kiwi.package_manager.dnf.PackageManagerDnf') def test_manager_yum(self, mock_manager): repository = Mock() - PackageManager(repository, 'yum') + PackageManager.new(repository, 'yum') mock_manager.assert_called_once_with(repository, None) - @patch('kiwi.package_manager.PackageManagerMicroDnf') + @patch('kiwi.package_manager.microdnf.PackageManagerMicroDnf') def test_manager_microdnf(self, mock_manager): repository = Mock() - PackageManager(repository, 'microdnf') + PackageManager.new(repository, 'microdnf') mock_manager.assert_called_once_with(repository, None) - @patch('kiwi.package_manager.PackageManagerApt') + @patch('kiwi.package_manager.apt.PackageManagerApt') def test_manager_apt(self, mock_manager): repository = Mock() - PackageManager(repository, 'apt-get') + PackageManager.new(repository, 'apt-get') mock_manager.assert_called_once_with(repository, None) - @patch('kiwi.package_manager.PackageManagerPacman') + @patch('kiwi.package_manager.pacman.PackageManagerPacman') def test_manager_pacman(self, mock_manager): repository = Mock() - PackageManager(repository, 'pacman') + PackageManager.new(repository, 'pacman') mock_manager.assert_called_once_with(repository, None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/test/unit/partitioner/init_test.py new/kiwi-9.22.1/test/unit/partitioner/init_test.py --- old/kiwi-9.21.26/test/unit/partitioner/init_test.py 2020-02-28 15:13:35.000000000 +0100 +++ new/kiwi-9.22.1/test/unit/partitioner/init_test.py 2020-12-03 15:28:00.000000000 +0100 @@ -16,105 +16,35 @@ def inject_fixtures(self, caplog): self._caplog = caplog - @patch('platform.machine') - def test_partitioner_not_implemented(self, mock_machine): - mock_machine.return_value = 'x86_64' + def test_partitioner_not_implemented(self): with raises(KiwiPartitionerSetupError): - Partitioner('foo', Mock()) + Partitioner.new('foo', Mock()) - @patch('platform.machine') - def test_partitioner_for_arch_not_implemented(self, mock_machine): - mock_machine.return_value = 'some-arch' + def test_partitioner_for_arch_not_implemented(self): with raises(KiwiPartitionerSetupError): - Partitioner('foo', Mock()) + Partitioner.new('foo', Mock()) - @patch('kiwi.partitioner.PartitionerGpt') - @patch('platform.machine') - def test_partitioner_x86_64_gpt(self, mock_machine, mock_gpt): - mock_machine.return_value = 'x86_64' + @patch('kiwi.partitioner.gpt.PartitionerGpt') + def test_partitioner_gpt(self, mock_gpt): storage_provider = Mock() - Partitioner('gpt', storage_provider) + Partitioner.new('gpt', storage_provider) mock_gpt.assert_called_once_with(storage_provider, None) - @patch('kiwi.partitioner.PartitionerMsDos') - @patch('platform.machine') - def test_partitioner_x86_64_msdos(self, mock_machine, mock_dos): - mock_machine.return_value = 'x86_64' + @patch('kiwi.partitioner.msdos.PartitionerMsDos') + def test_partitioner_msdos(self, mock_dos): storage_provider = Mock() - Partitioner('msdos', storage_provider) + Partitioner.new('msdos', storage_provider) mock_dos.assert_called_once_with(storage_provider, None) - @patch('kiwi.partitioner.PartitionerMsDos') - @patch('platform.machine') - def test_partitioner_i686_msdos(self, mock_machine, mock_dos): - mock_machine.return_value = 'i686' + @patch('kiwi.partitioner.dasd.PartitionerDasd') + def test_partitioner_dasd(self, mock_dasd): storage_provider = Mock() - Partitioner('msdos', storage_provider) - mock_dos.assert_called_once_with(storage_provider, None) - - @patch('kiwi.partitioner.PartitionerMsDos') - @patch('platform.machine') - def test_partitioner_i586_msdos(self, mock_machine, mock_dos): - mock_machine.return_value = 'i586' - storage_provider = Mock() - Partitioner('msdos', storage_provider) - mock_dos.assert_called_once_with(storage_provider, None) - - @patch('kiwi.partitioner.PartitionerDasd') - @patch('platform.machine') - def test_partitioner_s390_dasd(self, mock_machine, mock_dasd): - mock_machine.return_value = 's390' - storage_provider = Mock() - Partitioner('dasd', storage_provider) - mock_dasd.assert_called_once_with(storage_provider) + Partitioner.new('dasd', storage_provider) + mock_dasd.assert_called_once_with(storage_provider, None) - @patch('kiwi.partitioner.PartitionerDasd') - @patch('platform.machine') - def test_partitioner_s390_dasd_with_custom_start_sector( - self, mock_machine, mock_dasd - ): - mock_machine.return_value = 's390' + @patch('kiwi.partitioner.dasd.PartitionerDasd') + def test_partitioner_dasd_with_custom_start_sector(self, mock_dasd): storage_provider = Mock() with self._caplog.at_level(logging.WARNING): - Partitioner('dasd', storage_provider, 4096) - mock_dasd.assert_called_once_with(storage_provider) - - @patch('kiwi.partitioner.PartitionerMsDos') - @patch('platform.machine') - def test_partitioner_s390_msdos(self, mock_machine, mock_dos): - mock_machine.return_value = 's390' - storage_provider = Mock() - Partitioner('msdos', storage_provider) - mock_dos.assert_called_once_with(storage_provider, None) - - @patch('kiwi.partitioner.PartitionerMsDos') - @patch('platform.machine') - def test_partitioner_ppc_msdos(self, mock_machine, mock_dos): - mock_machine.return_value = 'ppc64' - storage_provider = Mock() - Partitioner('msdos', storage_provider) - mock_dos.assert_called_once_with(storage_provider, None) - - @patch('kiwi.partitioner.PartitionerGpt') - @patch('platform.machine') - def test_partitioner_ppc_gpt(self, mock_machine, mock_gpt): - mock_machine.return_value = 'ppc64' - storage_provider = Mock() - Partitioner('gpt', storage_provider) - mock_gpt.assert_called_once_with(storage_provider, None) - - @patch('kiwi.partitioner.PartitionerGpt') - @patch('platform.machine') - def test_partitioner_arm_gpt(self, mock_machine, mock_gpt): - mock_machine.return_value = 'aarch64' - storage_provider = Mock() - Partitioner('gpt', storage_provider) - mock_gpt.assert_called_once_with(storage_provider, None) - - @patch('kiwi.partitioner.PartitionerMsDos') - @patch('platform.machine') - def test_partitioner_arm_msdos(self, mock_machine, mock_dos): - mock_machine.return_value = 'armv7l' - storage_provider = Mock() - Partitioner('msdos', storage_provider) - mock_dos.assert_called_once_with(storage_provider, None) + Partitioner.new('dasd', storage_provider, 4096) + mock_dasd.assert_called_once_with(storage_provider, None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/test/unit/repository/init_test.py new/kiwi-9.22.1/test/unit/repository/init_test.py --- old/kiwi-9.21.26/test/unit/repository/init_test.py 2020-05-08 16:46:48.000000000 +0200 +++ new/kiwi-9.22.1/test/unit/repository/init_test.py 2020-12-03 15:28:00.000000000 +0100 @@ -9,34 +9,40 @@ class TestRepository: def test_repository_manager_not_implemented(self): with raises(KiwiRepositorySetupError): - Repository('root_bind', 'ms-manager') + Repository.new('root_bind', 'ms-manager') - @patch('kiwi.repository.RepositoryZypper') + @patch('kiwi.repository.zypper.RepositoryZypper') def test_repository_zypper(self, mock_manager): root_bind = mock.Mock() - Repository(root_bind, 'zypper') + Repository.new(root_bind, 'zypper') mock_manager.assert_called_once_with(root_bind, None) - @patch('kiwi.repository.RepositoryDnf') + @patch('kiwi.repository.dnf.RepositoryDnf') def test_repository_dnf(self, mock_manager): root_bind = mock.Mock() - Repository(root_bind, 'dnf') + Repository.new(root_bind, 'dnf') mock_manager.assert_called_once_with(root_bind, None) - @patch('kiwi.repository.RepositoryDnf') + @patch('kiwi.repository.dnf.RepositoryDnf') + def test_repository_microdnf(self, mock_manager): + root_bind = mock.Mock() + Repository.new(root_bind, 'microdnf') + mock_manager.assert_called_once_with(root_bind, None) + + @patch('kiwi.repository.dnf.RepositoryDnf') def test_repository_yum(self, mock_manager): root_bind = mock.Mock() - Repository(root_bind, 'yum') + Repository.new(root_bind, 'yum') mock_manager.assert_called_once_with(root_bind, None) - @patch('kiwi.repository.RepositoryApt') + @patch('kiwi.repository.apt.RepositoryApt') def test_repository_apt(self, mock_manager): root_bind = mock.Mock() - Repository(root_bind, 'apt-get') + Repository.new(root_bind, 'apt-get') mock_manager.assert_called_once_with(root_bind, None) - @patch('kiwi.repository.RepositoryPacman') + @patch('kiwi.repository.pacman.RepositoryPacman') def test_repository_pacman(self, mock_manager): root_bind = mock.Mock() - Repository(root_bind, 'pacman') + Repository.new(root_bind, 'pacman') mock_manager.assert_called_once_with(root_bind, None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/test/unit/storage/disk_test.py new/kiwi-9.22.1/test/unit/storage/disk_test.py --- old/kiwi-9.21.26/test/unit/storage/disk_test.py 2020-10-28 12:44:07.000000000 +0100 +++ new/kiwi-9.22.1/test/unit/storage/disk_test.py 2020-12-03 15:28:00.000000000 +0100 @@ -14,7 +14,7 @@ def inject_fixtures(self, caplog): self._caplog = caplog - @patch('kiwi.storage.disk.Partitioner') + @patch('kiwi.storage.disk.Partitioner.new') def setup(self, mock_partitioner): self.tempfile = mock.Mock() self.tempfile.name = 'tempfile' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/test/unit/system/prepare_test.py new/kiwi-9.22.1/test/unit/system/prepare_test.py --- old/kiwi-9.21.26/test/unit/system/prepare_test.py 2020-11-03 15:22:45.000000000 +0100 +++ new/kiwi-9.22.1/test/unit/system/prepare_test.py 2020-12-03 15:28:00.000000000 +0100 @@ -4,9 +4,8 @@ raises, fixture ) from mock import ( - patch, call + patch, call, Mock, MagicMock, ANY ) -import mock from kiwi.exceptions import ( KiwiBootStrapPhaseFailed, @@ -39,16 +38,16 @@ self.description_dir = os.path.dirname(description.description_origin) self.xml = description.load() - self.manager = mock.MagicMock( - return_value=mock.MagicMock() + self.manager = MagicMock( + return_value=MagicMock() ) self.manager.package_requests = ['foo'] self.manager.collection_requests = ['foo'] self.manager.product_requests = ['foo'] - root_init = mock.MagicMock() + root_init = MagicMock() mock_root_init.return_value = root_init - root_bind = mock.MagicMock() + root_bind = MagicMock() root_bind.root_dir = 'root_dir' mock_root_bind.return_value = root_bind self.state = XMLState( @@ -82,19 +81,19 @@ ) xml = description.load() - root_init = mock.MagicMock() + root_init = MagicMock() mock_root_init.return_value = root_init - root_import = mock.Mock() - root_import.sync_data = mock.Mock() + root_import = Mock() + root_import.sync_data = Mock() mock_root_import.return_value = root_import - root_bind = mock.MagicMock() + root_bind = MagicMock() root_bind.root_dir = 'root_dir' mock_root_bind.return_value = root_bind state = XMLState( xml, profiles=['containerFlavour'], build_type='docker' ) - uri = mock.Mock() - get_derived_from_image_uri = mock.Mock( + uri = Mock() + get_derived_from_image_uri = Mock( return_value=uri ) state.get_derived_from_image_uri = get_derived_from_image_uri @@ -165,7 +164,7 @@ with raises(KiwiSystemDeletePackagesFailed): self.system.delete_packages(self.manager, ['package']) - @patch('kiwi.system.prepare.Repository') + @patch('kiwi.system.prepare.Repository.new') @patch('kiwi.system.prepare.Uri') @patch('kiwi.system.prepare.PackageManager') @patch('kiwi.xml_state.XMLState.get_package_manager') @@ -176,22 +175,22 @@ ): mock_exists.return_value = True mock_package_manager.return_value = 'package-manager-name' - uri = mock.Mock() + uri = Mock() mock_uri.return_value = uri - self.system.root_bind = mock.Mock() - uri.is_remote = mock.Mock( + self.system.root_bind = Mock() + uri.is_remote = Mock( return_value=False ) - uri.translate = mock.Mock( + uri.translate = Mock( return_value='uri' ) - uri.alias = mock.Mock( + uri.alias = Mock( return_value='uri-alias' ) - uri.credentials_file_name = mock.Mock( + uri.credentials_file_name = Mock( return_value='credentials-file' ) - repo = mock.Mock() + repo = Mock() mock_repo.return_value = repo self.system.setup_repositories( @@ -236,7 +235,7 @@ ['key-file-a.asc', 'key-file-b.asc'] ) - @patch('kiwi.system.prepare.Repository') + @patch('kiwi.system.prepare.Repository.new') @patch('kiwi.system.prepare.Uri') @patch('kiwi.system.prepare.PackageManager') @patch('kiwi.xml_state.XMLState.get_package_manager') @@ -247,19 +246,19 @@ ): mock_exists.return_value = False mock_package_manager.return_value = 'package-manager-name' - uri = mock.Mock() + uri = Mock() mock_uri.return_value = uri - self.system.root_bind = mock.Mock() - uri.is_remote = mock.Mock( + self.system.root_bind = Mock() + uri.is_remote = Mock( return_value=False ) - uri.translate = mock.Mock( + uri.translate = Mock( return_value='uri' ) - uri.alias = mock.Mock( + uri.alias = Mock( return_value='uri-alias' ) - repo = mock.Mock() + repo = Mock() mock_repo.return_value = repo with self._caplog.at_level(logging.WARNING): self.system.setup_repositories() @@ -272,8 +271,8 @@ self, mock_exists, mock_tar, mock_poll, mock_collection_type ): mock_exists.return_value = True - tar = mock.Mock() - tar.extract = mock.Mock() + tar = Mock() + tar.extract = Mock() mock_tar.return_value = tar mock_collection_type.return_value = 'onlyRequired' self.system.install_bootstrap(self.manager) @@ -329,8 +328,8 @@ self, mock_exists, mock_tar, mock_poll, mock_collection_type ): mock_exists.return_value = True - tar = mock.Mock() - tar.extract = mock.Mock() + tar = Mock() + tar.extract = Mock() mock_tar.return_value = tar mock_collection_type.return_value = 'onlyRequired' self.system.install_system(self.manager) @@ -376,14 +375,14 @@ self.system.pinch_system(self.manager) self.manager.process_delete_requests.assert_called_once_with(False) - @patch('kiwi.package_manager.PackageManagerZypper.process_delete_requests') - @patch('kiwi.system.prepare.Repository') + @patch('kiwi.package_manager.zypper.PackageManagerZypper.process_delete_requests') + @patch('kiwi.system.prepare.Repository.new') @patch('kiwi.system.prepare.CommandProcess.poll_show_progress') def test_pinch_system_without_manager( self, mock_poll, mock_repo, mock_requests ): self.system.pinch_system() - mock_repo.assert_called_once_with(mock.ANY, 'zypper') + mock_repo.assert_called_once_with(ANY, 'zypper') mock_requests.assert_called_once_with(False) @patch('kiwi.system.prepare.CommandProcess.poll') @@ -395,15 +394,16 @@ self.system.__del__() self.system.root_bind.cleanup.assert_called_once_with() - @patch('kiwi.system.prepare.Repository') - @patch('kiwi.system.prepare.PackageManager') + @patch('kiwi.system.prepare.Repository.new') + @patch('kiwi.system.prepare.PackageManager.new') def test_clean_package_manager_leftovers(self, mock_manager, mock_repo): + manager = Mock() + mock_manager.return_value = manager self.system.clean_package_manager_leftovers() - assert mock_repo.called - assert mock_manager.called + manager.clean_leftovers.assert_called_once_with() def test_destructor_raising(self): - self.system.root_bind = mock.Mock() + self.system.root_bind = Mock() self.system.root_bind.cleanup.side_effect = ValueError("nothing") with self._caplog.at_level(logging.INFO): del self.system diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/test/unit/system/setup_test.py new/kiwi-9.22.1/test/unit/system/setup_test.py --- old/kiwi-9.21.26/test/unit/system/setup_test.py 2020-10-22 16:15:59.000000000 +0200 +++ new/kiwi-9.22.1/test/unit/system/setup_test.py 2020-12-03 15:28:00.000000000 +0100 @@ -1231,7 +1231,7 @@ ] ) - @patch('kiwi.system.setup.Repository') + @patch('kiwi.system.setup.Repository.new') @patch('kiwi.system.setup.Uri') def test_import_repositories_marked_as_imageinclude( self, mock_uri, mock_repo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/test/unit/tasks/image_resize_test.py new/kiwi-9.22.1/test/unit/tasks/image_resize_test.py --- old/kiwi-9.21.26/test/unit/tasks/image_resize_test.py 2020-11-02 16:15:41.000000000 +0100 +++ new/kiwi-9.22.1/test/unit/tasks/image_resize_test.py 2020-12-03 15:28:00.000000000 +0100 @@ -41,7 +41,6 @@ self.firmware.get_partition_table_type = Mock( return_value='gpt' ) - self.partitioner = Mock() self.loop_provider = Mock() kiwi.tasks.image_resize.FirmWare = Mock( return_value=self.firmware @@ -49,9 +48,6 @@ kiwi.tasks.image_resize.LoopDevice = Mock( return_value=self.loop_provider ) - kiwi.tasks.image_resize.Partitioner = Mock( - return_value=self.partitioner - ) self.task = ImageResizeTask() @@ -93,7 +89,10 @@ self.task.process() @patch('kiwi.tasks.image_resize.DiskFormat.new') - def test_process_image_resize_gb(self, mock_DiskFormat): + @patch('kiwi.tasks.image_resize.Partitioner.new') + def test_process_image_resize_gb(self, mock_Partitioner, mock_DiskFormat): + partitioner = Mock() + mock_Partitioner.return_value = partitioner image_format = Mock() image_format.resize_raw_disk.return_value = True mock_DiskFormat.return_value = image_format @@ -101,14 +100,17 @@ self.task.command_args['resize'] = True self.task.process() self.loop_provider.create.assert_called_once_with(overwrite=False) - self.partitioner.resize_table.assert_called_once_with() + partitioner.resize_table.assert_called_once_with() image_format.resize_raw_disk.assert_called_once_with( 42 * 1024 * 1024 * 1024 ) image_format.create_image_format.assert_called_once_with() @patch('kiwi.tasks.image_resize.DiskFormat.new') - def test_process_image_resize_mb(self, mock_DiskFormat): + @patch('kiwi.tasks.image_resize.Partitioner.new') + def test_process_image_resize_mb(self, mock_Partitioner, mock_DiskFormat): + partitioner = Mock() + mock_Partitioner.return_value = partitioner image_format = Mock() image_format.resize_raw_disk.return_value = True mock_DiskFormat.return_value = image_format @@ -117,14 +119,19 @@ self.task.command_args['--size'] = '42m' self.task.process() self.loop_provider.create.assert_called_once_with(overwrite=False) - self.partitioner.resize_table.assert_called_once_with() + partitioner.resize_table.assert_called_once_with() image_format.resize_raw_disk.assert_called_once_with( 42 * 1024 * 1024 ) image_format.create_image_format.assert_called_once_with() @patch('kiwi.tasks.image_resize.DiskFormat.new') - def test_process_image_resize_bytes(self, mock_DiskFormat): + @patch('kiwi.tasks.image_resize.Partitioner.new') + def test_process_image_resize_bytes( + self, mock_Partitioner, mock_DiskFormat + ): + partitioner = Mock() + mock_Partitioner.return_value = partitioner image_format = Mock() image_format.resize_raw_disk.return_value = True mock_DiskFormat.return_value = image_format @@ -133,14 +140,19 @@ self.task.command_args['--size'] = '42' self.task.process() self.loop_provider.create.assert_called_once_with(overwrite=False) - self.partitioner.resize_table.assert_called_once_with() + partitioner.resize_table.assert_called_once_with() image_format.resize_raw_disk.assert_called_once_with( 42 ) image_format.create_image_format.assert_called_once_with() @patch('kiwi.tasks.image_resize.DiskFormat.new') - def test_process_image_resize_not_needed(self, mock_DiskFormat): + @patch('kiwi.tasks.image_resize.Partitioner.new') + def test_process_image_resize_not_needed( + self, mock_Partitioner, mock_DiskFormat + ): + partitioner = Mock() + mock_Partitioner.return_value = partitioner image_format = Mock() image_format.resize_raw_disk.return_value = False mock_DiskFormat.return_value = image_format @@ -150,7 +162,7 @@ with self._caplog.at_level(logging.INFO): self.task.process() self.loop_provider.create.assert_called_once_with(overwrite=False) - self.partitioner.resize_table.assert_called_once_with() + partitioner.resize_table.assert_called_once_with() image_format.resize_raw_disk.assert_called_once_with( 42 ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.21.26/test/unit/xml_state_test.py new/kiwi-9.22.1/test/unit/xml_state_test.py --- old/kiwi-9.21.26/test/unit/xml_state_test.py 2020-10-28 12:44:07.000000000 +0100 +++ new/kiwi-9.22.1/test/unit/xml_state_test.py 2020-12-03 15:37:03.000000000 +0100 @@ -498,6 +498,17 @@ state = XMLState(xml_data) assert state.get_oemconfig_oem_resize() is False + def test_get_oemconfig_oem_multipath_scan(self): + xml_data = self.description.load() + state = XMLState(xml_data, ['vmxFlavour'], 'oem') + assert state.get_oemconfig_oem_multipath_scan() is False + description = XMLDescription( + '../data/example_disk_config.xml' + ) + xml_data = description.load() + state = XMLState(xml_data) + assert state.get_oemconfig_oem_multipath_scan() is False + def test_get_oemconfig_swap_mbytes(self): xml_data = self.description.load() state = XMLState(xml_data, ['containerFlavour'], 'docker') _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
