Since the "s1" interface and "s1" is hard-coded, this is a safer approach.
On Fedora, I found that the mac addr wasnt being extracted(but worked for Ubuntu).
This command will work for both platforms, and others as it uses
regular expression.
Change-Id: I008b1a3681eabdace6fbe26346750fb3b1169f7d
Signed-off-by: Kailash Khalasi <kkhalasi@iix.net>
-Provision 3800 Object Definition
+Open vSwitch Object Definition
Authors: james.luhrsen@hp.com
Created: 2014-10-02
"""
Authors: james.luhrsen@hp.com
Created: 2014-10-02
"""
@property
def datapath_id_output_command(self):
@property
def datapath_id_output_command(self):
- return '/sbin/ifconfig | egrep \'^s1\' | awk \'{print $5}\''
+ '''This regex will extract the macaddr of the ovs switch'''
+ return '/sbin/ifconfig s1 | grep -o -E "([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}"'
datapath_id_output_string = ''
datapath_id = ''
datapath_id_output_string = ''
datapath_id = ''