rax-nova-agent: switch to $DISTRO_NAME

Check for the current distribution using $DISTRO_NAME instead of
`lsb_release`.
Also, remove the existency check, as $DISTRO_NAME is supposed to be
provided by distribution elements.

Change-Id: I2276c63e9ac43576da528a70235129800c093b3e
This commit is contained in:
Pino Toscano 2015-05-12 17:43:35 +02:00
parent 97954ccd4e
commit 341ad6c15c
2 changed files with 6 additions and 11 deletions

View File

@ -21,19 +21,16 @@ fi
set -eu
set -o pipefail
DIST=$(lsb_release -is)
[ -n "$DIST" ]
XS_TOOLS_DIR=$(mktemp -d)
mount -o loop /tmp/xs-tools.iso $XS_TOOLS_DIR
pushd $XS_TOOLS_DIR/Linux
case $DIST in
'Ubuntu'|'Debian')
case "$DISTRO_NAME" in
'ubuntu'|'debian')
# Seriously
source versions.deb
dpkg -i $XE_GUEST_UTILITIES_PKG_FILE_amd64
;;
'Fedora'|'CentOS' | 'openSUSE project')
'fedora'|'centos'|'centos7'|'opensuse')
source versions.rpm
rpm -Uvh $XE_GUEST_UTILITIES_PKG_FILE_x86_64
;;

View File

@ -32,10 +32,8 @@ runcmd:
- ip addr show eth0 | grep inet || ( ifdown -a ; ifup -a )
EOF
DIST=$(lsb_release -is)
[ -n "$DIST" ]
case $DIST in
'Ubuntu'|'Debian')
case "$DISTRO_NAME" in
'ubuntu'|'debian')
# cloud-init / nova-agent sad panda hacks
cat > /etc/init/nova-agent.conf <<'EOF'
@ -87,7 +85,7 @@ respawn
exec /sbin/getty -L 115200 hvc0 vt102
EOF
;;
'Fedora'|'CentOS' | 'openSUSE project')
'fedora'|'centos'|'centos7'|'opensuse')
cat > /usr/local/bin/run-nova-agent.sh <<'EOF'
#!/bin/bash