loci/scripts/cleanup.sh
Sam Yaple 2fa935d8cd
Remove /etc/machine-id
This file will cause problems with running distros that are based on
systemd on distros that do not have systemd (ie runnign 16.04 on 14.04).
This file need not exist in the container anyway as it is empty

Change-Id: I4487e160077c64ed4b5d9561483f25c3a37bd455
2017-12-17 03:39:27 -05:00

36 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
set -ex
case ${distro} in
debian|ubuntu)
apt-get purge -y --auto-remove \
git \
patch \
python3-virtualenv \
virtualenv
rm -rf /var/lib/apt/lists/*
;;
centos)
# NOTE(SamYaple): We should be removing 'patch' here, but that breaks
# centos as it tries to rip out systemd for some reason
yum -y autoremove \
git \
python-virtualenv \
python3-virtualenv
yum clean all
;;
*)
echo "Unknown distro: ${distro}"
exit 1
;;
esac
# NOTE(SamYaple): Removing this file allows python to use libraries outside of
# the virtualenv if they do not exist inside the venv. This is a requirement
# for using python-rbd which is not pip installable and is only available in
# packaged form.
rm /var/lib/openstack/lib/python*/no-global-site-packages.txt
rm -rf /tmp/* /root/.cache /etc/machine-id
find /usr/ /var/ \( -name "*.pyc" -o -name "__pycache__" \) -delete