[sonic-config-engine][marvell] read mac address fix (#4649)

Signed-off-by: Sabareesh Kumar Anandan <sanandan@marvell.com>
This commit is contained in:
Sabareesh-Kumar-Anandan 2020-05-27 14:32:19 +05:30 committed by GitHub
parent f532fb95a9
commit 17904969b6

View File

@ -161,7 +161,7 @@ def get_system_mac(namespace=None):
# Try valid mac in eeprom, else fetch it from eth0 # Try valid mac in eeprom, else fetch it from eth0
platform = get_platform_info(get_machine_info()) platform = get_platform_info(get_machine_info())
hwsku = get_machine_info()['onie_machine'] hwsku = get_machine_info()['onie_machine']
profile_cmd = 'cat' + SONIC_DEVICE_PATH + '/' + platform +'/'+ hwsku +'/profile.ini | cut -f2 -d=' profile_cmd = 'cat' + SONIC_DEVICE_PATH + '/' + platform +'/'+ hwsku +'/profile.ini | grep switchMacAddress | cut -f2 -d='
hw_mac_entry_cmds = [ profile_cmd, "sudo decode-syseeprom -m", "ip link show eth0 | grep ether | awk '{print $2}'" ] hw_mac_entry_cmds = [ profile_cmd, "sudo decode-syseeprom -m", "ip link show eth0 | grep ether | awk '{print $2}'" ]
else: else:
mac_address_cmd = "cat /sys/class/net/eth0/address" mac_address_cmd = "cat /sys/class/net/eth0/address"