Skip to content

Commit 2897686

Browse files
authored
[updategraph] Use empty configuration when DHCP graphurl option is missing (#2185)
1 parent c64f105 commit 2897686

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

files/dhcp/graphserviceurl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ case $reason in
33
if [ -n "$new_minigraph_url" ]; then
44
echo $new_minigraph_url > /tmp/dhcp_graph_url
55
else
6-
echo "default" > /tmp/dhcp_graph_url
6+
echo "N/A" > /tmp/dhcp_graph_url
77
fi
88
if [ -n "$new_acl_url" ]; then
99
echo $new_acl_url > /tmp/dhcp_acl_url

files/image_config/updategraph/updategraph

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,8 @@ if [ "$src" = "dhcp" ]; then
8282
sleep 1
8383
done
8484

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

0 commit comments

Comments
 (0)