Skip to content

Commit

Permalink
[updategraph] Use empty configuration when DHCP graphurl option is mi…
Browse files Browse the repository at this point in the history
…ssing (#2185)
  • Loading branch information
taoyl-ms authored Oct 29, 2018
1 parent c64f105 commit 2897686
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion files/dhcp/graphserviceurl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ case $reason in
if [ -n "$new_minigraph_url" ]; then
echo $new_minigraph_url > /tmp/dhcp_graph_url
else
echo "default" > /tmp/dhcp_graph_url
echo "N/A" > /tmp/dhcp_graph_url
fi
if [ -n "$new_acl_url" ]; then
echo $new_acl_url > /tmp/dhcp_acl_url
Expand Down
10 changes: 1 addition & 9 deletions files/image_config/updategraph/updategraph
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,8 @@ if [ "$src" = "dhcp" ]; then
sleep 1
done

if [ "`cat /tmp/dhcp_graph_url`" = "default" ]; then
echo "No graph_url option in DHCP response. Skipping graph update and using existing minigraph."
if [ "$dhcp_as_static" = "true" ]; then
sed -i "/enabled=/d" /etc/sonic/updategraph.conf
echo "enabled=false" >> /etc/sonic/updategraph.conf
fi
exit 0
fi
if [ "`cat /tmp/dhcp_graph_url`" = "N/A" ]; then
echo "'N/A' found in DHCP response. Skipping graph update and generating an empty configuration."
echo "No graph_url option in DHCP response. Skipping graph update and generating an empty configuration."
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
if [ -f /etc/sonic/minigraph.xml ]; then
sonic-cfggen -H -m /etc/sonic/minigraph.xml --preset empty > /tmp/device_meta.json
Expand Down

0 comments on commit 2897686

Please sign in to comment.