From: CNlukai Date: Sat, 30 Jan 2016 03:34:27 +0000 (+0800) Subject: Update the method to get external nic mac address X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=d79338373f2706485e5e8f14d80af08bfad9f208;p=compass4nfv.git Update the method to get external nic mac address JIRA: COMPASS-295 Change-Id: Ifc72424d2627f444ec52d2875a5252f9fd898c8a Signed-off-by: CNlukai Signed-off-by: Justin-chi (cherry picked from commit ab495546af8ba0fe9ea1234e4f25a7e62ed92191) --- diff --git a/deploy/adapters/ansible/roles/onos_cluster/tasks/openvswitch.yml b/deploy/adapters/ansible/roles/onos_cluster/tasks/openvswitch.yml index 9761af71..47f0f6e8 100755 --- a/deploy/adapters/ansible/roles/onos_cluster/tasks/openvswitch.yml +++ b/deploy/adapters/ansible/roles/onos_cluster/tasks/openvswitch.yml @@ -48,7 +48,7 @@ - name: set veth to ovs shell: > - export externamMac=`ifconfig eth1 | grep "HWaddr" | awk '{print $5}'`; + export externamMac=`ifconfig eth1 | grep -Eo '\<[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'`; ifconfig onos_port2 hw ether $externamMac; ovs-vsctl add-port br-prv onos_port1; ignore_errors: True