Skip to content

Commit

Permalink
Use predefined macro as vendor information (sonic-net#8361)
Browse files Browse the repository at this point in the history
#### 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.
  • Loading branch information
stephenxs authored Aug 16, 2021
1 parent aa6d457 commit c895677
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,6 @@ start() {
{%- endif %}

{%- 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
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
Expand Down Expand Up @@ -418,7 +415,7 @@ start() {
-v /usr/share/sonic/firmware:/usr/share/sonic/firmware:rw \
{%- endif %}
{%- if docker_container_name == "swss" %}
-e ASIC_VENDOR=$ASIC_VENDOR \
-e ASIC_VENDOR={{ sonic_asic_platform }} \
{%- endif -%}
{%- if docker_container_name == "bgp" %}
-v /etc/sonic/frr/$DEV:/etc/frr:rw \
Expand Down

0 comments on commit c895677

Please sign in to comment.