From 341ad6c15c797018ac72f840a5b0e383594db3a8 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 12 May 2015 17:43:35 +0200 Subject: [PATCH] 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 --- elements/rax-nova-agent/install.d/05-xen-tools | 9 +++------ elements/rax-nova-agent/install.d/10-nova-agent | 8 +++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/elements/rax-nova-agent/install.d/05-xen-tools b/elements/rax-nova-agent/install.d/05-xen-tools index 81893267..5a8c5a57 100755 --- a/elements/rax-nova-agent/install.d/05-xen-tools +++ b/elements/rax-nova-agent/install.d/05-xen-tools @@ -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 ;; diff --git a/elements/rax-nova-agent/install.d/10-nova-agent b/elements/rax-nova-agent/install.d/10-nova-agent index 918e1388..d0017802 100755 --- a/elements/rax-nova-agent/install.d/10-nova-agent +++ b/elements/rax-nova-agent/install.d/10-nova-agent @@ -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