[libvirt] [jenkins-ci PATCH v4 3/5] lcitool: avoid intermediate list of packages

Andrea Bolognani abologna at redhat.com
Mon Feb 25 17:06:25 UTC 2019

On Thu, 2019-02-21 at 16:33 +0000, Daniel P. Berrangé wrote:
> We can purge any packages which expand to None straight away, and
> simply convert to a set to get rid of duplicates.
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
>  guests/lcitool | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)

This doesn't work:

  $ ./lcitool dockerfile libvirt-centos-7 libvirt
  Traceback (most recent call last):
    File "./lcitool", line 601, in <module>
    File "./lcitool", line 596, in run
    File "./lcitool", line 560, in _action_dockerfile
      if pkgs[package] is None:
  KeyError: 'apparmor'

That's because...

> @@ -557,21 +556,15 @@ class Application:
>              for package in self._projects.get_packages(project):
>                  for key in keys:
>                      if key in mappings[package]:
> -                        temp[package] = mappings[package][key]
> +                        pkgs[package] = mappings[package][key]

... the hunk

  if package not in pkgs:

from the following patch should have been included right about here.

It would be nice if the Ansible part would be converted to a similar
logic, which should be possible using the appropriate Jinja2 filters,
but that can wait until later.

If you include the hunk mentioned above,

  Reviewed-by: Andrea Bolognani <abologna at redhat.com>

Andrea Bolognani / Red Hat / Virtualization

More information about the libvir-list mailing list