From 3d09d64421d1d2a99ac2660293d37b5db15ea8b6 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 26 Jan 2017 15:17:18 -0500 Subject: [PATCH] Make certs_install not fail if the extra_ca_certs dir is empty Stupid `cp` will fail if the source dir is empty --- conf/init/certs_install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/conf/init/certs_install.sh b/conf/init/certs_install.sh index 438d9c669..2ae929ac0 100755 --- a/conf/init/certs_install.sh +++ b/conf/init/certs_install.sh @@ -9,9 +9,11 @@ fi # Add extra trusted certificates (as a directory) if [ -d /conf/stack/extra_ca_certs ]; then - echo "Installing extra certificates found in /conf/stack/extra_ca_certs directory" - cp /conf/stack/extra_ca_certs/* /usr/local/share/ca-certificates/ - cat /conf/stack/extra_ca_certs/* >> /venv/lib/python2.7/site-packages/requests/cacert.pem + if test $(ls -A "/conf/stack/extra_ca_certs"); then + echo "Installing extra certificates found in /conf/stack/extra_ca_certs directory" + cp /conf/stack/extra_ca_certs/* /usr/local/share/ca-certificates/ + cat /conf/stack/extra_ca_certs/* >> /venv/lib/python2.7/site-packages/requests/cacert.pem + fi fi # Add extra trusted certificates (as a file)