Remove os-detection script

The os-detection script has been removed because it will cause
issues on a base system that does not have python pre-installed
Example: Ubuntu Xenial.

Change-Id: I9770d51c97ba3f1657976aee4bda5d7db9c13b2e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2016-07-13 08:43:08 -05:00
parent 63012f0c40
commit 68d68c27dd
No known key found for this signature in database
GPG Key ID: 69FEFFC5E2D9273F
3 changed files with 3 additions and 34 deletions

View File

@ -46,11 +46,11 @@ ANSIBLE_ROLE_FILE="$(readlink -f ${ANSIBLE_ROLE_FILE})"
ssh_key_create
# Install the base packages
if [[ $HOST_DISTRO =~ ^(Ubuntu|Debian) ]]; then
if [[ -f "/etc/os-release" ]]; then
apt-get update && apt-get -y install git python-all python-dev curl python2.7-dev build-essential libssl-dev libffi-dev python-requests < /dev/null
elif [[ $HOST_DISTRO =~ ^(CentOS|Red Hat) ]]; then
elif [[ -f "/etc/redhat-release" ]]; then
yum check-update && yum -y install git python2 curl autoconf gcc-c++ python2-devel gcc libffi-devel openssl-devel python-requests
elif [[ $HOST_DISTRO =~ ^Fedora ]]; then
elif [[ -f "/etc/fedora-release" ]]; then
dnf -y install git python curl autoconf gcc-c++ python-devel gcc libffi-devel openssl-devel python-requests
fi

View File

@ -1,25 +0,0 @@
#!/usr/bin/env python
# Copyright 2015, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Determines the operating system of a host and returns bash variables."""
import platform
template = """
HOST_DISTRO="{0}"
HOST_VERSION="{1}"
HOST_CODENAME="{2}"
""".format(*platform.linux_distribution())
print(template)

View File

@ -262,12 +262,6 @@ function get_pip {
trap "exit_fail ${LINENO} $? 'Received STOP Signal'" SIGHUP SIGINT SIGTERM
trap "exit_fail ${LINENO} $?" ERR
## Determine OS --------------------------------------------------------------
# Determine the operating system of the base host
# Adds the $HOST_DISTRO, $HOST_VERSION, and $HOST_CODENAME bash variables.
eval "$(python $(dirname ${BASH_SOURCE})/os-detection.py)"
echo "Detected ${HOST_DISTRO} ${HOST_VERSION} (codename: ${HOST_CODENAME})"
## Pre-flight check ----------------------------------------------------------
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then