Determine CentOS 6 platform in cache-devstack

The centos element (which is CentOS 6.x specific) doesn't provide
DIB_RELEASE so we have to identify it another way.

Change-Id: Ibf3b25b99f03c6077538dec6c3770dc0f690e3f5
This commit is contained in:
Jeremy Stanley 2015-05-01 18:53:12 +00:00
parent 3020955e85
commit 1023e20f41
2 changed files with 9 additions and 1 deletions

View File

@ -28,7 +28,7 @@ Building an image is simple, we have a script!
::
DISTRO="ubuntu" DIB_RELEASE="trusty" bash tools/build-image.sh
DISTRO="ubuntu" bash tools/build-image.sh
See the script for environment variables to set distribution, etc.
You should be left with a .qcow2 image file of your selected

View File

@ -24,6 +24,14 @@ import sys
# devstack lib/[apt|rpm] files to pre-install them. So we have to
# swizzle things around
RELEASE=None
try:
if open('/etc/redhat-release').read().startswith('CentOS release 6'):
# not actually used in devstack, but for consistency and because this
# script will error if run on a platform where RELEASE isn't detected
# as something
RELEASE='rhel6'
except IOError:
pass
if 'DIB_RELEASE' in os.environ:
RELEASE=os.environ['DIB_RELEASE']
if 'DISTRO_NAME' in os.environ: