1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/plugins
patchback[bot] f14e566cc7
Pkgng many packages one command (#3393) (#3529)
* pkgng: join package list into one command

Change the pkgng module so all packages being
installed (or upgraded) are acted on in one
command (per action). This will make installs
and upgrades a bit faster, because pkg will be
invoked fewer times per module run. More important,
module actions will be more atomic, making it less
likely that some packages are acted on because they
appear earlier in the argument list.

This change also improves the status reporting of
packages acted on, specifying the number of packages
for each action (install or upgrade).

* pkgng: make upgrade check lazily evaluated

Make upgrade_available an inner function so that the
if statement that checks whether installed packages
are up-to-date only runs the upgrade check on packages
that are already installed. This gets lazily evaluated
because of boolean operator short-circuiting:
https://docs.python.org/3.8/library/stdtypes.html#boolean-operations-and-or-not

Previously, the module would always check for upgrades,
even for not-installed packages, when running with
`state=latest`.

* pkgng: add changelog fragment

* pkgng: Apply changelog suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* pkgng: resolve pep8 style issue

Remove inline function. It's purpose would be confusing for
future maintainers, and someone refactoring it to a variable,
with good intentions, would introduce a performance regression.

Including the `query_update()` call in the if expression makes
the intent more legible and still ensures lazy evaluation of the
function call if the first `and` is `False`.

* pkgng: Fix changelog fragment syntax issue

Need to escape quotes so YAML doesn't eat them

Co-authored-by: Felix Fontein <felix@fontein.de>

* pkgng: Improve output message English grammar

Make word "package" plural only if reporting on more than one package

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 293c7a9fb3)

Co-authored-by: Ross Williams <ross@ross-williams.net>
2021-10-08 07:57:27 +02:00
..
action fixed the utf-8 marker (#3162) (#3165) 2021-08-07 15:59:29 +02:00
become Update BOTMETA, fix some plugin authors, improve BOTMETA extra sanity test (#3069) (#3087) 2021-07-26 14:13:28 +02:00
cache [PR #3194/1fec1d0c backport][stable-3] Fix sanity failures (#3195) 2021-08-12 13:46:55 +02:00
callback [opentelemetry][callback] add option to support enabling plugin in the CI (#3498) (#3524) 2021-10-07 22:16:28 +02:00
connection [PR #3194/1fec1d0c backport][stable-3] Fix sanity failures (#3195) 2021-08-12 13:46:55 +02:00
doc_fragments Adds redis_data_info module (#3227) (#3346) 2021-09-08 13:37:11 +02:00
filter New filter plugin - unicode_normalization (#3359) (#3362) 2021-09-12 14:40:02 +02:00
inventory Added OpenNebula inventory plugin (#810) (#3460) 2021-09-28 17:41:54 +02:00
lookup tss: add option for token authorization (#3327) (#3372) 2021-09-14 19:49:51 +02:00
module_utils Add keycloak_user_federation module (#3340) (#3408) 2021-09-20 19:50:03 +02:00
modules Pkgng many packages one command (#3393) (#3529) 2021-10-08 07:57:27 +02:00