From 288c49a085aef65ffffa7821b0a946c24aa67239 Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Mon, 16 Aug 2021 15:36:48 +0800 Subject: [PATCH] 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. --- files/build_templates/docker_image_ctl.j2 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index e4dd02826e63..68c55e479ffc 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -277,9 +277,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 @@ -405,7 +402,7 @@ start() { {%- endif %} {%- 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 \