Skip to content

Commit 64cceb4

Browse files
Chet Powersmeta-codesync[bot]
authored andcommitted
Add fboss2 create/delete/show config patcher qsfp
Summary: Copy the agent patcher cmds to add support for qsfp_service as well. I often get asked to add config/platform mapping fixes for test setups to unblock other teams. Right now we have to rush to manually build fbpkgs, config overrides, get approval from config owners, land changes, and run fboss-updater manually, which is a lot of manual effort. If we can do this via coop patchers, it gives us an easy stop-gap solution until automation builds our fixes into a package that we can pin on these devices. claude: `fboss2 create config patcher` only has an `agent` subcommand, so registering a coop patcher against the qsfp config means talking to the coop thrift API by hand. Now that there's a `qsfp_add_update_default_arguments` patcher, add the `qsfp` subcommands so overriding a qsfp_service gflag on a test device is a one-liner: ``` fboss2 -H <switch> create config patcher qsfp \ --py-patcher qsfp_add_update_default_arguments \ --py-patcher-arg 'platform_mapping_override_path=/root/pm_override.json' \ --experimental true --to-current true ``` Adds `create`, `delete` and `show` variants, all reusing the existing `createCoopPatcher` / `unregisterCoopPatcher` / `convertPatcherList` helpers. Unlike the agent commands these don't reload the daemon - qsfp_service has no `reloadConfig` thrift API - so they report a restart reminder instead. That's the honest behavior anyway, since `--platform_mapping_override_path` is only read at init. The reminder is conditional: with `--to-current false` (or `--remove-from-current false` on delete) the current config isn't touched, so we say that instead of telling you to restart for nothing. `CmdShowConfigPatchersTest.cpp` was in the repo but not in any BUCK target, so its agent/bgp cases had never been compiled or run. Wire it into `cmd_test` and add the qsfp cases alongside them. That's what pulls in the `cmd-show-utils` dep; autodeps also drops the now-unused `fboss2-routing-protocol` from the same target. Also generalizes the shared `--jq-program` help text, which hardcoded `/etc/coop/agent/current` and was missing a space after "config.". Depends on D116486207 Reviewed By: harshitgulati18 Differential Revision: D116486202 fbshipit-source-id: 6c9f318028c47297d6b4ea3bfe1270b3ccb0fb26
1 parent 5288aaf commit 64cceb4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • fboss/cli/fboss2

fboss/cli/fboss2/BUCK

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ cpp_library(
421421
"commands/clear_and_override/facebook/bgp/ribpolicy/CmdClearAndOverrideBgpRibPolicyCrf.cpp",
422422
"commands/create/config/facebook/CmdCreateConfig.cpp",
423423
"commands/create/config/facebook/CmdCreateConfigPatcherAgent.cpp",
424+
"commands/create/config/facebook/CmdCreateConfigPatcherQsfp.cpp",
424425
"commands/create/config/facebook/CmdCreateConfigUtils.cpp",
425426
"commands/create/facebook/CmdCreateMirror.cpp",
426427
"commands/debug/facebook/CmdDebugUtils.cpp",
@@ -435,6 +436,7 @@ cpp_library(
435436
"commands/debug/facebook/bgp/neighbors/CmdDebugBgpNeighborsStart.cpp",
436437
"commands/delete/config/CmdDeleteConfig.cpp",
437438
"commands/delete/config/facebook/CmdDeleteConfigPatcherAgent.cpp",
439+
"commands/delete/config/facebook/CmdDeleteConfigPatcherQsfp.cpp",
438440
"commands/delete/config/facebook/CmdDeleteConfigUtils.cpp",
439441
"commands/facebook/rage/CmdRage.cpp",
440442
"commands/get/pcap/CmdGetPcap.cpp",
@@ -526,6 +528,7 @@ cpp_library(
526528
"commands/show/facebook/config/CmdShowConfigHistoryBgp.cpp",
527529
"commands/show/facebook/config/CmdShowConfigPatchersAgent.cpp",
528530
"commands/show/facebook/config/CmdShowConfigPatchersBgp.cpp",
531+
"commands/show/facebook/config/CmdShowConfigPatchersQsfp.cpp",
529532
"commands/show/facebook/config/CmdShowConfigRawBgp.cpp",
530533
"commands/show/facebook/config/CmdShowConfigRunningBgp.cpp",
531534
"commands/show/facebook/config/CmdShowConfigUtils.cpp",
@@ -656,6 +659,7 @@ cpp_library(
656659
"commands/clear_and_override/facebook/bgp/ribpolicy/Constants.h",
657660
"commands/create/config/facebook/CmdCreateConfig.h",
658661
"commands/create/config/facebook/CmdCreateConfigPatcherAgent.h",
662+
"commands/create/config/facebook/CmdCreateConfigPatcherQsfp.h",
659663
"commands/create/config/facebook/CmdCreateConfigUtils.h",
660664
"commands/create/facebook/CmdCreateMirror.h",
661665
"commands/debug/facebook/CmdDebugUtils.h",
@@ -670,6 +674,7 @@ cpp_library(
670674
"commands/debug/facebook/bgp/neighbors/CmdDebugBgpNeighborsStart.h",
671675
"commands/delete/config/CmdDeleteConfig.h",
672676
"commands/delete/config/facebook/CmdDeleteConfigPatcherAgent.h",
677+
"commands/delete/config/facebook/CmdDeleteConfigPatcherQsfp.h",
673678
"commands/delete/config/facebook/CmdDeleteConfigUtils.h",
674679
"commands/facebook/rage/CmdRage.h",
675680
"commands/facebook/stream/CmdStreamDummy.h",
@@ -728,6 +733,7 @@ cpp_library(
728733
"commands/show/facebook/config/CmdShowConfigHistoryBgp.h",
729734
"commands/show/facebook/config/CmdShowConfigPatchersAgent.h",
730735
"commands/show/facebook/config/CmdShowConfigPatchersBgp.h",
736+
"commands/show/facebook/config/CmdShowConfigPatchersQsfp.h",
731737
"commands/show/facebook/config/CmdShowConfigRawBgp.h",
732738
"commands/show/facebook/config/CmdShowConfigUtils.h",
733739
"commands/show/facebook/config/CmdShowConfigVersionAgent.h",

0 commit comments

Comments
 (0)