Make certs_install not fail if the extra_ca_certs dir is empty

Stupid `cp` will fail if the source dir is empty
This commit is contained in:
Joseph Schorr 2017-01-26 15:17:18 -05:00
parent d9003d1375
commit 3d09d64421

View file

@ -9,9 +9,11 @@ fi
# Add extra trusted certificates (as a directory) # Add extra trusted certificates (as a directory)
if [ -d /conf/stack/extra_ca_certs ]; then if [ -d /conf/stack/extra_ca_certs ]; then
echo "Installing extra certificates found in /conf/stack/extra_ca_certs directory" if test $(ls -A "/conf/stack/extra_ca_certs"); then
cp /conf/stack/extra_ca_certs/* /usr/local/share/ca-certificates/ echo "Installing extra certificates found in /conf/stack/extra_ca_certs directory"
cat /conf/stack/extra_ca_certs/* >> /venv/lib/python2.7/site-packages/requests/cacert.pem 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 fi
# Add extra trusted certificates (as a file) # Add extra trusted certificates (as a file)