Use predefined macro as vendor information (#8361)

#### Why I did it
Use a predefined variable to get vendor information when the swss docker container is created

#### How I did it
Use `{{ sonic_asic_platform }}` instead of `$SONIC_CFGGEN -y /etc/sonic/sonic_version.yml -v asic_type`

#### How to verify it
Manually test.
This commit is contained in:
Stephen Sun 2021-08-16 15:36:48 +08:00 committed by Qi Luo
parent ba2284c4c0
commit d599450052

View File

@ -249,9 +249,6 @@ start() {
{%- endif %} {%- endif %}
{%- if docker_container_name == "swss" %} {%- if docker_container_name == "swss" %}
# Obtain the vendor name
ASIC_VENDOR=`$SONIC_CFGGEN -y /etc/sonic/sonic_version.yml -v asic_type`
# Generate the asic_table.json and peripheral_table.json # Generate the asic_table.json and peripheral_table.json
if [ ! -f /etc/sonic/asic_table.json ] && [ -f /usr/share/sonic/templates/asic_table.j2 ]; then if [ ! -f /etc/sonic/asic_table.json ] && [ -f /usr/share/sonic/templates/asic_table.j2 ]; then
sonic-cfggen -d -t /usr/share/sonic/templates/asic_table.j2 > /etc/sonic/asic_table.json sonic-cfggen -d -t /usr/share/sonic/templates/asic_table.j2 > /etc/sonic/asic_table.json
@ -378,7 +375,7 @@ start() {
-v /usr/share/sonic/firmware:/usr/share/sonic/firmware:rw \ -v /usr/share/sonic/firmware:/usr/share/sonic/firmware:rw \
{%- endif %} {%- endif %}
{%- if docker_container_name == "swss" %} {%- if docker_container_name == "swss" %}
-e ASIC_VENDOR=$ASIC_VENDOR \ -e ASIC_VENDOR={{ sonic_asic_platform }} \
{%- endif -%} {%- endif -%}
{%- if docker_container_name == "bgp" %} {%- if docker_container_name == "bgp" %}
-v /etc/sonic/frr/$DEV:/etc/frr:rw \ -v /etc/sonic/frr/$DEV:/etc/frr:rw \