Fix a bug that default graph might be missing when generating minimal config (#1747)

This commit is contained in:
Taoyu Li 2018-05-29 13:46:25 -07:00 committed by GitHub
parent a917517f60
commit 225b3e5b91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,6 +106,9 @@ if [ "$src" = "dhcp" ]; then
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."
if [ ! -f /etc/sonic/minigraph.xml ]; then
copy_default_minigraph
fi
echo '{"DEVICE_METADATA":' > /tmp/device_meta.json
sonic-cfggen -H -m /etc/sonic/minigraph.xml --var-json DEVICE_METADATA >> /tmp/device_meta.json
echo '}' >> /tmp/device_meta.json