diff options
author | wrider <lji@research.att.com> | 2019-01-03 13:53:23 -0500 |
---|---|---|
committer | Lusheng Ji <lji@research.att.com> | 2019-02-11 17:36:50 +0000 |
commit | c1a53ef03351c1577a27d082ab2e9ee1dcba653b (patch) | |
tree | 21378e5f060bc6c78416d068805e71ae33074091 /boot/dcae2_vm_init.sh | |
parent | 1b7b647d9c8b1ddc491cf3c1398a7f14b16b4fbf (diff) |
fix installation bail problem
The dcae2_install script would bail due to "set -e" when docker
network is not configured. This fix added additional clean up
checking.
Issue-ID: DCAEGEN2-1007
Change-Id: I5fa551fad498e311bfebe038416a7444b635d934
Signed-off-by: wrider <lji@research.att.com>
(cherry picked from commit d3d1abc28e5998bcdf2ed01fb1c51319e9793fd2)
Diffstat (limited to 'boot/dcae2_vm_init.sh')
-rwxr-xr-x | boot/dcae2_vm_init.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/boot/dcae2_vm_init.sh b/boot/dcae2_vm_init.sh index e4288195..17ab0034 100755 --- a/boot/dcae2_vm_init.sh +++ b/boot/dcae2_vm_init.sh @@ -48,7 +48,18 @@ then fi # clean up old network configuration in docker engine -docker network rm config_default +set +e +if [ -n "$(docker ps -q -a)" ]; then + docker stop $(docker ps -q -a) + docker update --restart=no $(docker ps -a -q) + systemctl restart docker + docker rm $(docker ps -q -a) + if [ -n "$(docker network ls | grep 'config_default')" ]; then + docker network rm config_default + fi +fi +set -e + docker login -u "$NEXUS_USER" -p "$NEXUS_PASSWORD" "$NEXUS_DOCKER_REPO" |