summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-03-13 16:49:44 +0000
committerGerrit Code Review <review@openstack.org>2019-03-13 16:49:44 +0000
commite55ced2404b561e012fca2b59baceb13ee9e4db8 (patch)
tree7af466db8ad82cf2e4d8297fa3d66f96c34edac3
parent6ae17f4a76a9e76237a06cdc9290100d5aee203a (diff)
parentcf435e6c2a8f8b0be479fbe16a1cc3fa1f752d69 (diff)
Merge "download_mirror.sh fails with 404 errors"
-rw-r--r--Dockerfile2
-rwxr-xr-xcentos-mirror-tools/dl_rpms.sh19
-rw-r--r--centos-mirror-tools/yum.conf.sample1
3 files changed, 21 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile
index 6462ca7..74ed724 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,6 +21,8 @@ FROM centos:7.4.1708
21# echo -e "export http_proxy=$http_proxy\nexport https_proxy=$https_proxy\n\ 21# echo -e "export http_proxy=$http_proxy\nexport https_proxy=$https_proxy\n\
22#export ftp_proxy=$ftp_proxy" >> /root/.bashrc 22#export ftp_proxy=$ftp_proxy" >> /root/.bashrc
23 23
24RUN echo "http_caching=packages" >> /etc/yum.conf
25
24# username you will docker exec into the container as. 26# username you will docker exec into the container as.
25# It should NOT be your host username so you can easily tell 27# It should NOT be your host username so you can easily tell
26# if you are in our out of the container. 28# if you are in our out of the container.
diff --git a/centos-mirror-tools/dl_rpms.sh b/centos-mirror-tools/dl_rpms.sh
index 54ff628..15f1f71 100755
--- a/centos-mirror-tools/dl_rpms.sh
+++ b/centos-mirror-tools/dl_rpms.sh
@@ -251,7 +251,24 @@ download () {
251 251
252 252
253# Prime the cache 253# Prime the cache
254${SUDOCMD} yum ${YUMCONFOPT} ${RELEASEVER} makecache 254loop_count=0
255max_loop_count=5
256echo "${SUDOCMD} yum ${YUMCONFOPT} ${RELEASEVER} makecache"
257while ! ${SUDOCMD} yum ${YUMCONFOPT} ${RELEASEVER} makecache ; do
258 # To protect against intermittent 404 errors, we'll retry
259 # a few times. The suspected issue is pulling repodata
260 # from multiple source that are temporarily inconsistent.
261 loop_count=$((loop_count + 1))
262 if [ $loop_count -gt $max_loop_count ]; then
263 break
264 fi
265 echo "makecache retry: $loop_count"
266
267 # Wipe the inconsistent data from the last try
268 echo "yum ${YUMCONFOPT} ${RELEASEVER} clean all"
269 yum ${YUMCONFOPT} ${RELEASEVER} clean all
270done
271
255 272
256# Download files 273# Download files
257if [ -s "$rpms_list" ];then 274if [ -s "$rpms_list" ];then
diff --git a/centos-mirror-tools/yum.conf.sample b/centos-mirror-tools/yum.conf.sample
index 11a6ce7..b968a8a 100644
--- a/centos-mirror-tools/yum.conf.sample
+++ b/centos-mirror-tools/yum.conf.sample
@@ -13,6 +13,7 @@ bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://b
13distroverpkg=centos-release 13distroverpkg=centos-release
14override_install_langs=en_US.utf8 14override_install_langs=en_US.utf8
15tsflags=nodocs 15tsflags=nodocs
16http_caching=packages
16reposdir=yum.repos.d 17reposdir=yum.repos.d
17 18
18 19