Skip to content

Commit 6d592d8

Browse files
sihuihan88yxieca
authored andcommitted
[build_template]: combine the init config write into one block (#1513)
Signed-off-by: Sihui Han <[email protected]>
1 parent 1464014 commit 6d592d8

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

files/build_templates/sonic_debian_extension.j2

+1-6
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,7 @@ sudo bash -c "echo dhcp_as_static=true >> $FILESYSTEM_ROOT/etc/sonic/updategraph
165165
{% else %}
166166
sudo bash -c "echo enabled=false > $FILESYSTEM_ROOT/etc/sonic/updategraph.conf"
167167
{% endif %}
168-
{% if shutdown_bgp_on_start == "y" %}
169-
sudo bash -c "echo '{ \"DEVICE_METADATA\": { \"localhost\": { \"default_bgp_status\": \"down\" } } }' >> $FILESYSTEM_ROOT/etc/sonic/init_cfg.json"
170-
{% endif %}
171-
{% if enable_pfcwd_on_start == "y" %}
172-
sudo bash -c "echo '{ \"DEVICE_METADATA\": { \"localhost\": { \"default_pfcwd_status\": \"enable\" } } }' >> $FILESYSTEM_ROOT/etc/sonic/init_cfg.json"
173-
{% endif %}
168+
sudo bash -c "echo '{ \"DEVICE_METADATA\": { \"localhost\": { \"default_bgp_status\": {% if shutdown_bgp_on_start == "y" %}\"down\"{% else %}\"up\"{% endif %}, \"default_pfcwd_status\": {% if enable_pfcwd_on_start == "y" %}\"enable\"{% else %}\"disable\"{% endif %} } } }' >> $FILESYSTEM_ROOT/etc/sonic/init_cfg.json"
174169

175170
# Copy SNMP configuration files
176171
sudo cp $IMAGE_CONFIGS/snmp/snmp.yml $FILESYSTEM_ROOT/etc/sonic/

0 commit comments

Comments
 (0)