Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GCU] Turning port admin down before some critical port changes (soni…
…c-net#1998) #### What I did Fixes sonic-net#1930 Issue can be summarized into these 2 case: * A patch can contain an operation to turn port `admin up` -- do at the end * A patch that modifies config that needs the port to be down -- start by bringing the port down then do the update then bring it back up #### How I did it The configs that need the port to be down, we will call them `critical-port` configs. * Added a move validator to validate `critical-port` configs, which does the following * If a port is up, make sure the move does not make changes to related `critical-port` configs * If the move is turning a port up, make sure there is no `critical-port` config are still left in the patch * Added a move extender to `critical-port` changes: * If a port is up, bring down if there are critical-port changes * If the move is turning a port up, flip it to down if there are still `critical-port` configs left. In other words, do not turn the port back up until all `critical-port` changes are in done. #### How to verify it * Added `AddRack` unit-test to `tests/generic_config_updater/files/patch_sorter_test_success.json` * Other unit-tests #### Previous command output (if the output of a command-line utility has changed) Check issue sonic-net#1930 for old sorting order #### New command output (if the output of a command-line utility has changed) Check `AddRack` unit-test to `tests/generic_config_updater/files/patch_sorter_test_success.json` for new sorting-order
- Loading branch information