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 -eu
set -o pipefail set -o pipefail
DIST=$(lsb_release -is)
[ -n "$DIST" ]
XS_TOOLS_DIR=$(mktemp -d) XS_TOOLS_DIR=$(mktemp -d)
mount -o loop /tmp/xs-tools.iso $XS_TOOLS_DIR mount -o loop /tmp/xs-tools.iso $XS_TOOLS_DIR
pushd $XS_TOOLS_DIR/Linux pushd $XS_TOOLS_DIR/Linux
case $DIST in case "$DISTRO_NAME" in
'Ubuntu'|'Debian') 'ubuntu'|'debian')
# Seriously # Seriously
source versions.deb source versions.deb
dpkg -i $XE_GUEST_UTILITIES_PKG_FILE_amd64 dpkg -i $XE_GUEST_UTILITIES_PKG_FILE_amd64
;; ;;
'Fedora'|'CentOS' | 'openSUSE project') 'fedora'|'centos'|'centos7'|'opensuse')
source versions.rpm source versions.rpm
rpm -Uvh $XE_GUEST_UTILITIES_PKG_FILE_x86_64 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 ) - ip addr show eth0 | grep inet || ( ifdown -a ; ifup -a )
EOF EOF
DIST=$(lsb_release -is) case "$DISTRO_NAME" in
[ -n "$DIST" ] 'ubuntu'|'debian')
case $DIST in
'Ubuntu'|'Debian')
# cloud-init / nova-agent sad panda hacks # cloud-init / nova-agent sad panda hacks
cat > /etc/init/nova-agent.conf <<'EOF' cat > /etc/init/nova-agent.conf <<'EOF'
@ -87,7 +85,7 @@ respawn
exec /sbin/getty -L 115200 hvc0 vt102 exec /sbin/getty -L 115200 hvc0 vt102
EOF EOF
;; ;;
'Fedora'|'CentOS' | 'openSUSE project') 'fedora'|'centos'|'centos7'|'opensuse')
cat > /usr/local/bin/run-nova-agent.sh <<'EOF' cat > /usr/local/bin/run-nova-agent.sh <<'EOF'
#!/bin/bash #!/bin/bash