[updategraph] Use empty configuration when DHCP graphurl option is missing (#2185)
This commit is contained in:
parent
c64f105a3e
commit
2897686de8
@ -3,7 +3,7 @@ case $reason in
|
|||||||
if [ -n "$new_minigraph_url" ]; then
|
if [ -n "$new_minigraph_url" ]; then
|
||||||
echo $new_minigraph_url > /tmp/dhcp_graph_url
|
echo $new_minigraph_url > /tmp/dhcp_graph_url
|
||||||
else
|
else
|
||||||
echo "default" > /tmp/dhcp_graph_url
|
echo "N/A" > /tmp/dhcp_graph_url
|
||||||
fi
|
fi
|
||||||
if [ -n "$new_acl_url" ]; then
|
if [ -n "$new_acl_url" ]; then
|
||||||
echo $new_acl_url > /tmp/dhcp_acl_url
|
echo $new_acl_url > /tmp/dhcp_acl_url
|
||||||
|
@ -82,16 +82,8 @@ if [ "$src" = "dhcp" ]; then
|
|||||||
sleep 1
|
sleep 1
|
||||||
done
|
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
|
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`
|
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
|
||||||
if [ -f /etc/sonic/minigraph.xml ]; then
|
if [ -f /etc/sonic/minigraph.xml ]; then
|
||||||
sonic-cfggen -H -m /etc/sonic/minigraph.xml --preset empty > /tmp/device_meta.json
|
sonic-cfggen -H -m /etc/sonic/minigraph.xml --preset empty > /tmp/device_meta.json
|
||||||
|
Reference in New Issue
Block a user