Skip to content

Commit

Permalink
Addressed comments, added log message
Browse files Browse the repository at this point in the history
  • Loading branch information
prsunny committed Feb 19, 2020
1 parent 058928b commit 55410e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions dockers/docker-orchagent/orchagent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
# vendor specific code.
export platform=`sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type`

MAC_ADDRESS=`sonic-cfggen -d -v 'DEVICE_METADATA.localhost.mac'`
MAC_ADDRESS=$(sonic-cfggen -d -v 'DEVICE_METADATA.localhost.mac')
if [ "$MAC_ADDRESS" == "None" ] || [ -z "$MAC_ADDRESS" ]; then
MAC_ADDRESS=`ip link show eth0 | grep ether | awk '{print $2}'`
MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
logger "Mac address not found in Device Metadata, Falling back to eth0"
fi

# Create a folder for SwSS record files
Expand Down
5 changes: 3 additions & 2 deletions platform/p4/docker-sonic-p4/orchagent.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash

MAC_ADDRESS=`sonic-cfggen -d -v 'DEVICE_METADATA.localhost.mac'`
MAC_ADDRESS=$(sonic-cfggen -d -v 'DEVICE_METADATA.localhost.mac')
if [ "$MAC_ADDRESS" == "None" ] || [ -z "$MAC_ADDRESS" ]; then
MAC_ADDRESS=`ip link show eth0 | grep ether | awk '{print $2}'`
MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
logger "Mac address not found in Device Metadata, Falling back to eth0"
fi

# Create a folder for SsWW record files
Expand Down
5 changes: 3 additions & 2 deletions platform/vs/docker-sonic-vs/orchagent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ else
export platform=$fake_platform
fi

MAC_ADDRESS=`sonic-cfggen -d -v 'DEVICE_METADATA.localhost.mac'`
MAC_ADDRESS=$(sonic-cfggen -d -v 'DEVICE_METADATA.localhost.mac')
if [ "$MAC_ADDRESS" == "None" ] || [ -z "$MAC_ADDRESS" ]; then
MAC_ADDRESS=`ip link show eth0 | grep ether | awk '{print $2}'`
MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
logger "Mac address not found in Device Metadata, Falling back to eth0"
fi

# Create a folder for SwSS record files
Expand Down

0 comments on commit 55410e5

Please sign in to comment.