summaryrefslogtreecommitdiff
path: root/ironic_python_agent/config.py
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2020-04-23 19:23:53 +0200
committerDmitry Tantsur <dtantsur@protonmail.com>2020-04-24 10:34:40 +0200
commit8adb7e1a045c667dd97456d06bd74d74a4da2787 (patch)
treedf4f6b1b7495f1f0a5245e7f4e430e4a1f8989f0 /ironic_python_agent/config.py
parent8a9df0b48511e01921d36d7abade2c4d3e729f5c (diff)
downloadironic-python-agent-6.1.0.tar.gz
Add timeout and retries when connection to an image server6.1.0
If the server is stuck for any reason, the download will hang for a potentially long time. Provide a timeout (defaults to 60 seconds) and 2 retries on failure. Change-Id: Ie53519266edd914fdbfa82fe52b4a55151e5ec5f
Diffstat (limited to 'ironic_python_agent/config.py')
-rw-r--r--ironic_python_agent/config.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/ironic_python_agent/config.py b/ironic_python_agent/config.py
index 5724a675..c73e6fc9 100644
--- a/ironic_python_agent/config.py
+++ b/ironic_python_agent/config.py
@@ -239,6 +239,21 @@ cli_opts = [
'enforce token validation. The configuration provided '
'by the conductor MAY override this and force this '
'setting to be changed to True in memory.'),
+ cfg.IntOpt('image_download_connection_timeout', min=1,
+ default=APARAMS.get(
+ 'ipa-image-download-connection-timeout', 60),
+ help='The connection timeout (in seconds) when downloading '
+ 'an image. Does not affect the whole download.'),
+ cfg.IntOpt('image_download_connection_retries', min=0,
+ default=APARAMS.get('ipa-image-download-connection-retries', 2),
+ help='How many times to retry the connection when downloading '
+ 'an image. Also retries on failure HTTP statuses.'),
+ cfg.IntOpt('image_download_connection_retry_interval', min=0,
+ default=APARAMS.get(
+ 'ipa-image-download-connection-retry-interval', 5),
+ help='Interval (in seconds) between two attempts to establish '
+ 'connection when downloading an image.'),
+
]
CONF.register_cli_opts(cli_opts)