summaryrefslogtreecommitdiff
path: root/tools/run-centos
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2017-10-23 14:46:12 -0600
committerChad Smith <chad.smith@canonical.com>2017-10-23 14:46:12 -0600
commita7f478aafa570abde940037014fabcb0eab16502 (patch)
treed838e40b26684f33b3b05c24ead267e28bb1b5a3 /tools/run-centos
parent5443ede5e90c0be56f25ac729c5f341cdb4ad31c (diff)
parent17a15f9e0ae78e4fc4e24fab0caebdf78f06ef66 (diff)
downloadvyos-cloud-init-a7f478aafa570abde940037014fabcb0eab16502.tar.gz
vyos-cloud-init-a7f478aafa570abde940037014fabcb0eab16502.zip
merge from master at 17.1-25-g17a15f9e
Diffstat (limited to 'tools/run-centos')
-rwxr-xr-xtools/run-centos18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/run-centos b/tools/run-centos
index d44d5145..d58ef3e8 100755
--- a/tools/run-centos
+++ b/tools/run-centos
@@ -123,7 +123,22 @@ prep() {
return 0
fi
error "Installing prep packages: ${needed}"
- yum install --assumeyes ${needed}
+ set -- $needed
+ local n max r
+ n=0; max=10;
+ bcmd="yum install --downloadonly --assumeyes --setopt=keepcache=1"
+ while n=$(($n+1)); do
+ error ":: running $bcmd $* [$n/$max]"
+ $bcmd "$@"
+ r=$?
+ [ $r -eq 0 ] && break
+ [ $n -ge $max ] && { error "gave up on $bcmd"; exit $r; }
+ nap=$(($n*5))
+ error ":: failed [$r] ($n/$max). sleeping $nap."
+ sleep $nap
+ done
+ error ":: running yum install --cacheonly --assumeyes $*"
+ yum install --cacheonly --assumeyes "$@"
}
start_container() {
@@ -153,6 +168,7 @@ start_container() {
if [ ! -z "${http_proxy-}" ]; then
debug 1 "configuring proxy ${http_proxy}"
inside "$name" sh -c "echo proxy=$http_proxy >> /etc/yum.conf"
+ inside "$name" sed -i s/enabled=1/enabled=0/ /etc/yum/pluginconf.d/fastestmirror.conf
fi
}