summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_chef.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2014-10-11 18:23:20 -0700
committerJoshua Harlow <harlowja@gmail.com>2014-10-11 18:23:20 -0700
commit4994f7cb475713be523f96e077a76f801e6d1db5 (patch)
tree99a40dd26ed295f500ec85cd68f28f4bd91edf34 /cloudinit/config/cc_chef.py
parentc5341fe07b767735e9ed74e45cee9629c6434892 (diff)
downloadvyos-cloud-init-4994f7cb475713be523f96e077a76f801e6d1db5.tar.gz
vyos-cloud-init-4994f7cb475713be523f96e077a76f801e6d1db5.zip
Allow the omnibus url fetching retries to be configurable
Diffstat (limited to 'cloudinit/config/cc_chef.py')
-rw-r--r--cloudinit/config/cc_chef.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py
index e503371d..205f4b49 100644
--- a/cloudinit/config/cc_chef.py
+++ b/cloudinit/config/cc_chef.py
@@ -37,6 +37,7 @@ CHEF_DIRS = [
]
OMNIBUS_URL = "https://www.opscode.com/chef/install.sh"
+OMNIBUS_URL_RETRIES = 5
CHEF_RB_TPL_DEFAULTS = {
# These are ruby symbols...
@@ -199,7 +200,10 @@ def install_chef(cloud, chef_cfg, log):
elif install_type == 'omnibus':
# This will install as a omnibus unified package
url = util.get_cfg_option_str(chef_cfg, "omnibus_url", OMNIBUS_URL)
- content = url_helper.readurl(url=url, retries=5)
+ retries = max(0, util.get_cfg_option_int(chef_cfg,
+ "omnibus_url_retries",
+ default=OMNIBUS_URL_RETRIES))
+ content = url_helper.readurl(url=url, retries=retries)
with util.tempdir() as tmpd:
# Use tmpdir over tmpfile to avoid 'text file busy' on execute
tmpf = "%s/chef-omnibus-install" % tmpd