From ca722e669ab16b932f614dbf3b5ce5421b82dcfa Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 20 Mar 2015 09:47:40 +0000 Subject: openstack-net-config: Use tr for tokenising ip link output --- .../openstack-neutron-network-configuration-for-one-node | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openstack/usr/share/openstack/openstack-neutron-network-configuration-for-one-node b/openstack/usr/share/openstack/openstack-neutron-network-configuration-for-one-node index f2c98a13..abf1113e 100644 --- a/openstack/usr/share/openstack/openstack-neutron-network-configuration-for-one-node +++ b/openstack/usr/share/openstack/openstack-neutron-network-configuration-for-one-node @@ -17,15 +17,15 @@ set -xe -# Get the first ethernet driver and its ip -eth_dev="$(ip addr | perl -pe 'if (/^\d+: ([^:]+)/) { $iface=$1; } if (m@^\s*inet ([^/]+)/@) { print "$iface $1\n"; } $_=undef;' | grep "^e" | head -1 | awk '{ print $1 } ')" -eth_ip="$(ip addr | perl -pe 'if (/^\d+: ([^:]+)/) { $iface=$1; } if (m@^\s*inet ([^/]+)/@) { print "$iface $1\n"; } $_=undef;' | grep "^e" | head -1 | awk '{ print $2 } ')" -eth_mac="$(ip link show $eth_dev | sed -r 's/\s+/\n/g' | sed -n '/link\/ether/{n;p}')" - if [ -f /var/openstack/openvswitch-one-node-setup ]; then exit 0 fi +# Get the first ethernet driver and its ip +eth_dev="$(ip addr | perl -pe 'if (/^\d+: ([^:]+)/) { $iface=$1; } if (m@^\s*inet ([^/]+)/@) { print "$iface $1\n"; } $_=undef;' | grep "^e" | head -1 | awk '{ print $1 } ')" +eth_ip="$(ip addr | perl -pe 'if (/^\d+: ([^:]+)/) { $iface=$1; } if (m@^\s*inet ([^/]+)/@) { print "$iface $1\n"; } $_=undef;' | grep "^e" | head -1 | awk '{ print $2 } ')" +eth_mac="$(ip link show $eth_dev | tr -s '[:space:]' '\n' | sed -n '/link\/ether/{n;p}')" + # Create the bridges to use the External network mapped # This configuration is for 1 node and it was taken from: # https://fosskb.wordpress.com/2014/10/18/openstack-juno-on-ubuntu-14-10/ -- cgit v1.2.1