support multiple -p options in disk-image-create

Bug #1641157 reported by Oliver Walsh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Fix Released
Undecided
Andreas Florath

Bug Description

If disk-image-create accepted multiple -p options it would allow users to specify additional packages when creating images using python-tripleoclient.

python-tripleoclient accepts extra DIB args to customize images
e.g openstack overcloud image build --all --overcloud-full-dib-extra-args OVERCLOUD_FULL_DIB_EXTRA_ARGS

When I set this to "-p <mypackage>" it resulted in a bad image. python-tripleoclient already passes a -p option with a list of packages, and the second -p option clobbers the first.

Oliver Walsh (owalsh)
description: updated
Oliver Walsh (owalsh)
Changed in diskimage-builder:
assignee: nobody → Oliver Walsh (owalsh)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to diskimage-builder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/396702

Changed in diskimage-builder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to diskimage-builder (master)

Reviewed: https://review.openstack.org/396702
Committed: https://git.openstack.org/cgit/openstack/diskimage-builder/commit/?id=ae66b64c34ea4209e09adf804c8cd8446d7ae5db
Submitter: Jenkins
Branch: master

commit ae66b64c34ea4209e09adf804c8cd8446d7ae5db
Author: Oliver Walsh <email address hidden>
Date: Fri Nov 11 17:03:50 2016 +0000

    In disk-image-create, append to INSTALL_PACKAGES instead of clobbering.

    This allows -p <packagelist> to be used multiple times.

    Change-Id: Iabe43982e1606c7ca963a1dd3b23ba47d148ae38
    Closes-Bug: #1641157

Changed in diskimage-builder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to diskimage-builder (feature/v2)

Fix proposed to branch: feature/v2
Review: https://review.openstack.org/399347

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to diskimage-builder (feature/v2)
Download full text (14.6 KiB)

Reviewed: https://review.openstack.org/399347
Committed: https://git.openstack.org/cgit/openstack/diskimage-builder/commit/?id=7d5afecfd9e2ea5249ea7f12eba74c77c1abd7e6
Submitter: Jenkins
Branch: feature/v2

commit 8d7362aa9b4a9d2430de7959d4ee4c78429464c0
Author: d.marlin <email address hidden>
Date: Thu Nov 17 03:36:54 2016 -0500

    Change path for dnf arch override so basearch is not overwritten.

    After writing the basearch value to /etc/dnf/vars/basearch the
    arch value was overwriting the same file. This appears to be
    incorrect, so changing it to write /etc/dnf/vars/arch, which
    matches the subsequent 'yum' code paths.

    Change-Id: I5da54f03224c11f9e286f16b68533936c4174c2a

commit fb8cf95b6fb0820867ebfd262c38d2cae5ab43fa
Author: Ben Nemec <email address hidden>
Date: Wed Nov 16 16:27:24 2016 -0600

    Disable all repos in os-refresh-config too

    This change was made for pre-install so it applies during the
    image build, but wasn't applied to the os-refresh-config script
    that would run after deployment. The same problems apply there,
    so we should do the same thing.

    Change-Id: I4b8534cc9586eeb588b5c358550e76e27d40556a
    Closes-Bug: 1629922

commit a1f57b8cad0717090eb12014d7847a35bd0563a3
Author: Markos Chandras <email address hidden>
Date: Mon Oct 31 21:43:47 2016 +0000

    lib: common-functions: Fix tmpfs umounting

    It has been observed that some chroot operations spawn additional
    processes which rely on chroot files. More specifically, zypper, uses
    gpg-agent to import and validate gpg keys for its repositories. This
    gpg-agent process may stay alive for longer which prevents unmounting of
    the tmpfs directory since the gpg-agent process still uses libraries etc
    which were present in the chroot. We try to solve this by using walking
    all the pids in /proc to find out the running processes in the chroot and
    kill them gracefully. If that fails for whatever reason, then we simply
    keep trying to umount the tmpfs directory before we give up.

    The gpg-agent process usually terminates soon after its home directory
    disappears but on fast systems we can reach the 'umount tmpfs' point
    before gpg-agent terminates by itself. The solution is generic enough so
    other 'chroot processes' can also be handled appropriately.

    Change-Id: Iccf332678c79266113e76f062884fc5ee79e515d

commit e88d6b37df5a210ad15da24403274914f737956e
Author: Noam Angel <email address hidden>
Date: Mon Oct 31 11:54:58 2016 +0200

    add support for SUSE in dhcp-all-interfaces

    This patch will add support for SUSE network scripts,
    network script in SUSE saved under "/etc/sysconfig/network/ifcfg-*"
    see: https://www.suse.com/documentation/sled11/book_sle_admin/data/sec_basicnet_manconf.html

    Change-Id: I87ac2e327cee4945c15da9f2e4adc0a8b7650712

commit d07d7ed15d54c37448d5be67c4e4707ba19edac0
Author: Noam Angel <email address hidden>
Date: Tue Nov 1 16:19:44 2016 +0200

    simplify ARCH param for rhel/centos param can be x86_64 and amd64

    for fedora/rhel/centos the main supported ARCH is x86_64. This patch allow
    to call diskima...

tags: added: in-feature-v2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to diskimage-builder (feature/v2)

Fix proposed to branch: feature/v2
Review: https://review.openstack.org/438010

Revision history for this message
Andreas Florath (ansreas) wrote :

The patch in [1] introduces a bug: only the first package specified with '-p' is picked up. There is another (proposed) patch that fixes this patch [2].

[1] https://review.openstack.org/#/c/396702/
[2] https://review.openstack.org/#/c/438010/

Changed in diskimage-builder:
assignee: Oliver Walsh (owalsh) → Andreas Florath (ansreas)
Revision history for this message
Oliver Walsh (owalsh) wrote :

The patch in [1] works. INSTALL_PACKAGES is a bash array, not a space separated list. E.g if you look at the usage the array is expanded https://github.com/openstack/diskimage-builder/blob/111cb510550ab05a0bc760e2075fc1eef9d8bb15/lib/img-functions#L151

Revision history for this message
Andreas Florath (ansreas) wrote :

Sorry for the confusion: I missed the array. Everything is fine!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on diskimage-builder (feature/v2)

Change abandoned by Andreas Florath (<email address hidden>) on branch: feature/v2
Review: https://review.openstack.org/438010
Reason: Sorry for the confusion: I misses the array - everything is fine!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.