[fix] Put conditions in install_cleanup function

This commit is contained in:
William Wernert
2020-12-08 14:03:59 -05:00
parent 4210d25fae
commit 4899ea23f8

View File

@@ -1011,18 +1011,22 @@ host_pillar() {
} }
install_cleanup() { install_cleanup() {
echo "Installer removing the following files:" if [ -f "$temp_install_dir" ]; then
ls -lR "$temp_install_dir" echo "Installer removing the following files:"
ls -lR "$temp_install_dir"
# Clean up after ourselves # Clean up after ourselves
rm -rf "$temp_install_dir" rm -rf "$temp_install_dir"
fi
# All cleanup prior to this statement must be compatible with automated testing. Cleanup # All cleanup prior to this statement must be compatible with automated testing. Cleanup
# that will disrupt automated tests should be placed beneath this statement. # that will disrupt automated tests should be placed beneath this statement.
[ -n "$TESTING" ] && return [ -n "$TESTING" ] && return
# If Mysql is running stop it # If Mysql is running stop it
/usr/sbin/so-mysql-stop if docker ps --format "{{.Names}}" 2>&1 | grep -q "so-mysql"; then
/usr/sbin/so-mysql-stop
fi
if [[ $setup_type == 'iso' ]]; then if [[ $setup_type == 'iso' ]]; then
info "Removing so-setup permission entry from sudoers file" info "Removing so-setup permission entry from sudoers file"