From 225b3e5b9155792c542255ad3d6a5b29f4f41eb7 Mon Sep 17 00:00:00 2001 From: Taoyu Li Date: Tue, 29 May 2018 13:46:25 -0700 Subject: [PATCH] Fix a bug that default graph might be missing when generating minimal config (#1747) --- 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 f0cea0894a..96827f09f9 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