From 674a5f4baf74a2c934038a9a64fb28d3b6dce63e Mon Sep 17 00:00:00 2001 From: Taoyu Li Date: Tue, 29 May 2018 18:25:27 +0000 Subject: [PATCH] Fix a bug that default graph might be missing when generating minimal config --- files/image_config/updategraph/updategraph | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/image_config/updategraph/updategraph b/files/image_config/updategraph/updategraph index f0cea0894a9c..96827f09f97f 100755 --- a/files/image_config/updategraph/updategraph +++ b/files/image_config/updategraph/updategraph @@ -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