galaxy-cli tasking polling interval from environment variable (#83803)

Added configuration options, including environment variables to control the polling 
No-Issue

---------
Signed-off-by: James Tanner <tanner.jc@gmail.com>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
pull/83865/head
jctanner 3 months ago committed by GitHub
parent b5e0293645
commit bed9a9597a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,4 @@
minor_changes:
- >-
``ansible-galaxy collection publish`` - add configuration options for the initial poll interval
and the exponential when checking the import status of a collection, since the default is relatively slow.

@ -1528,6 +1528,23 @@ GALAXY_REQUIRED_VALID_SIGNATURE_COUNT:
- The number of signatures that must be successful during GPG signature verification while installing or verifying collections.
- This should be a positive integer or all to indicate all signatures must successfully validate the collection.
- Prepend + to the value to fail if no valid signatures are found for the collection.
GALAXY_COLLECTION_IMPORT_POLL_INTERVAL:
description:
- The initial interval in seconds for polling the import status of a collection.
- This interval increases exponentially based on the :ref:`galaxy_collection_import_poll_factor`, with a maximum delay of 30 seconds.
type: float
default: 2.0
env:
- name: ANSIBLE_GALAXY_COLLECTION_IMPORT_POLL_INTERVAL
version_added: '2.18'
GALAXY_COLLECTION_IMPORT_POLL_FACTOR:
description:
- The multiplier used to increase the :ref:`galaxy_collection_import_poll_interval` when checking the collection import status.
type: float
default: 1.5
env:
- name: ANSIBLE_GALAXY_COLLECTION_IMPORT_POLL_FACTOR
version_added: "2.18"
HOST_KEY_CHECKING:
# NOTE: constant not in use by ssh/paramiko plugins anymore, but they do support the same configuration sources
# TODO: check non ssh connection plugins for use/migration

@ -719,7 +719,7 @@ class GalaxyAPI:
display.display("Waiting until Galaxy import task %s has completed" % full_url)
start = time.time()
wait = 2
wait = C.GALAXY_COLLECTION_IMPORT_POLL_INTERVAL
while timeout == 0 or (time.time() - start) < timeout:
try:
@ -743,7 +743,7 @@ class GalaxyAPI:
time.sleep(wait)
# poor man's exponential backoff algo so we don't flood the Galaxy API, cap at 30 seconds.
wait = min(30, wait * 1.5)
wait = min(30, wait * C.GALAXY_COLLECTION_IMPORT_POLL_FACTOR)
if state == 'waiting':
raise AnsibleError("Timeout while waiting for the Galaxy import process to finish, check progress at '%s'"
% to_native(full_url))

Loading…
Cancel
Save