fix: pass runtime_json to program_switch() in main() - #729
Open
xovishnukosuri wants to merge 1 commit into
Open
xovishnukosuri wants to merge 1 commit into
xovishnukosuri wants to merge 1 commit into
Conversation
When runtime_json was added as a required parameter to program_switch() in commit 071b89a, the main() function was not updated to pass it. Running simple_controller.py directly from the command line would fail with TypeError: program_switch() missing 1 required positional argument. Pass args.runtime_conf_file as runtime_json, consistent with how run_exercise.py calls program_switch() with the runtime JSON file path. Signed-off-by: Vishnu Kosuri <xovishnukosuri@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
program_switch()requiresruntime_jsonas a positional parameter (added in #452). Themain()function, which is the entry point when runningsimple_controller.pydirectly from the command line, was never updated to pass this argument.Running
simple_controller.pywith any valid arguments produces:Fix
Pass
args.runtime_conf_fileasruntime_json. This is consistent with howrun_exercise.pycallsprogram_switch(), where it passes the runtime JSON file path for use in error messages fromvalidateTableEntry().Test plan
simple_controller.pydirectly with-a,-d,-p,-carguments against a running BMv2 switch and confirm noTypeErroris raised.validateTableEntry()still includes the file path when a table entry is missing a requiredpriorityfield.