Skip to content

PFC storm stop on arista fanout: use if else semantics to prevent command trailing#1188

Merged
wendani merged 2 commits intosonic-net:masterfrom
wendani:stop_master
Oct 31, 2019
Merged

PFC storm stop on arista fanout: use if else semantics to prevent command trailing#1188
wendani merged 2 commits intosonic-net:masterfrom
wendani:stop_master

Conversation

@wendani
Copy link
Contributor

@wendani wendani commented Oct 30, 2019

The conditional jinja2 template causes the next command in the next line to be piggy-backed at the end of the preceding command, causing a syntax error to run the command

sudo pkill -f "sudo python pfc_gen.py -p 16 -t 65535 -n 100000000 -i et16 -r 10.3.147.195" exit

Signed-off-by: Wenda Ni [email protected]

Description of PR

Summary:
Fixes # (issue)

Type of change

  • [*] Bug fix
  • [] Testbed and Framework(new/improvement)
  • [] Test case(new/improvement)

Approach

How did you do it?

How did you verify/test it?

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@wendani wendani changed the title Put the command execution to background unconditionally PFC storm stop on arista fanout: Put the command execution to background unconditionally Oct 30, 2019
@qiluo-msft
Copy link
Contributor

Seems a Jinja2 syntax error, why change behavior. Did you try raw or other escaping method?

Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like Jinja2 is not adding the newline after the conditional. Have you tried forcing the trailing newline to be added by adding a plus sign to the final endif: {% endif +%}?

Nevermind. The plus sign can only be added to the leading percent sign, and will disable 'lstrip_blocks'. It doesn't affect whitespace like the minus sign does :(

@jleveque
Copy link
Contributor

Here's someone with a similar issue: ansible/ansible#32220

The suggested solution may not apply here because in one case we want to add the &, otherwise we don't want to add anything. There must be a way to do that...

@wendani wendani changed the title PFC storm stop on arista fanout: Put the command execution to background unconditionally PFC storm stop on arista fanout: put a newline to prevent command trailing Oct 31, 2019
@wendani wendani requested a review from jleveque October 31, 2019 00:54
@jleveque
Copy link
Contributor

@wendani: Did you try a solution similar to the example I linked above? Maybe something like the following will work?

{{ '&' if pfc_storm_stop_defer_time is defined else '' }}

@wendani wendani changed the title PFC storm stop on arista fanout: put a newline to prevent command trailing PFC storm stop on arista fanout: use if else semantics to prevent command trailing Oct 31, 2019
@wendani wendani merged commit 56f755a into sonic-net:master Oct 31, 2019
yxieca pushed a commit that referenced this pull request Nov 1, 2019
…mand trailing (#1188)

* Leave a newline to prevent 'exit' trailing the preceding
command

Signed-off-by: Wenda Ni <[email protected]>

* Address comment: use if else semantics

Signed-off-by: Wenda Ni <[email protected]>
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…aemons] advance submodule head (sonic-net#13755)

linkmgrd:
* e191338 2023-02-10 | Fix the warning of unused variables (sonic-net#167) (HEAD -> 202205) [Longxiang Lyu]

utilities:
* 2c933b0a 2023-02-07 | [sai_failure_dump]Invoking dump during SAI failure (sonic-net#2633) (HEAD -> 202205) [Sudharsan Dhamal Gopalarathnam]
* e949f318 2023-02-07 | [show] add support for gRPC show commands for `active-active` (sonic-net#2629) [vdahiya12]
* 77723927 2023-01-30 | Fixed admin state config CLI for Backport interfaces (sonic-net#2557) [anamehra]
* 32b1d4d6 2023-02-01 | [masic support] 'show run bgp' support for multi-asic (sonic-net#2427) [wenyiz2021]
* a2252d8a 2022-10-11 | Filter port invalid MTU configuration (sonic-net#2378) [pettershao-ragilenetworks]
* 0ffb4b6a 2023-02-09 | Add Transceiver PM basic CLI support to show output from TRANSCEIVER_PM table for ZR (sonic-net#2655) (github/202205) [longhuan-cisco]
* 496a0774 2023-02-09 | Add asic id for linecards so "show fabric counters queue/port" can work for single chip systems (sonic-net#2656) [jfeng-arista]
* 2591e8b5 2023-02-03 | multi asic support for show queue counter (sonic-net#2647) [zhixzhu]

swss:
* e0373a4 2023-02-07 | [autoneg]Fixing adv interface types to be set when AN is disabled (sonic-net#2638) (HEAD -> 202205, github/202205) [Sudharsan Dhamal Gopalarathnam]
* 62a09a0 2023-02-09 | [sai_failure_dump]Invoking dump during SAI failure (sonic-net#2644) (sonic-net#2661) [Sudharsan Dhamal Gopalarathnam]
* 076f63e 2023-02-08 | [202205] Revert "Revert "[voq][chassis]Add show fabric counters port/queue commands (sonic-net#2522)" (sonic-net#2612)" (sonic-net#2655) [kenneth-arista]
* a35e074 2023-02-06 | [202205][voq][chassis] Remove created ports from the default vlan. (sonic-net#2651) [arista-nwolfe]

swss-common:
* b9d4284 2023-02-08 | [202205] Fix epoll and socket resource leak issue. (sonic-net#651) (sonic-net#741) (github/202205) [Kevin Petremann]

sairedis:
* 9d8e731 2023-02-08 | [Mellanox] Enable DSCP remapping by using SAI attribute (sonic-net#1188) (HEAD -> 202205, github/202205) [Stephen Sun]
* 272a8bd 2023-02-10 | Fixing race condition for rif counters sonic-net#1136 (sonic-net#1202) [Suman Kumar]
* 211365a 2023-02-08 | [202205][submodule][SAI]Advance SAI header (sonic-net#1207) [Richard.Yu]
* 939c14b 2023-02-08 | [Submodule][upgrade]Upgrade SAI submodule (sonic-net#1203) [Richard.Yu]

platform-daemons:
* e5ccd40 2022-10-03 | [ycabled] fix naming error for error condition for CLI handling (sonic-net#302) (HEAD -> 202205, github/202205) [vdahiya12]
* cdd354d 2022-09-29 | [ycabled] add some exception catching logic to some vendor specific API's (sonic-net#301) [vdahiya12]
* cf58c08 2023-02-01 | Chassisd do an explicit stop of the config_manager (sonic-net#328) (sonic-net#336) [judyjoseph]

Signed-off-by: Ying Xie <[email protected]>
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
Why I did it
sonic-sairedis

53488e9 - [sai_failure_dump]Invoking dump during SAI failure (Update Mellanox buffer profiles config sonic-net#1198) (15 hours ago) [Sudharsan Dhamal Gopalarathnam]
85921af - [Mellanox] Enable DSCP remapping by using SAI attribute ([Nephos] Updating download link for SAI and SDK sonic-net#1188) (15 hours ago) [Stephen Sun]
82f2cd7 - Switch to using stock gcovr 5.2 (Add service to config hostname based on configdb sonic-net#1174) (15 hours ago) [Saikrishna Arcot]
3a6c60d - [ppi]: Enable bulk API. ([Aboot] Declare flash_size for all platform sonic-net#1171) (15 hours ago) [Nazarii Hnydyn]
f1303cb - Use github code scanning instead of LGTM (sonic-net#1160) (15 hours ago) [Liu Shilong]
b1972d9 - Fix for [EVPN] When MAC moves from remote end point to local, ASIC DB fields are not updated properly for the mac #11503Update NotificationProcessor.cpp ([libteam] Add fallback support for single-member-port LAG sonic-net#1118) (15 hours ago) [anilkpan]
How I did it
How to verify it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants