Skip to content

[Otel] Fix argument mismatch in overwrite_feature_golden_config_db_singleasic call#1070

Merged
Janetxxx merged 1 commit intoAzure:202412from
sdszhang:fix/otel-method-args-mismatch
Mar 14, 2026
Merged

[Otel] Fix argument mismatch in overwrite_feature_golden_config_db_singleasic call#1070
Janetxxx merged 1 commit intoAzure:202412from
sdszhang:fix/otel-method-args-mismatch

Conversation

@sdszhang
Copy link

What is the motivation for this PR?

PR #1067 cherry-picked the otel feature enablement from upstream PR sonic-net/sonic-mgmt#22341, but introduced a runtime bug.

What is the issue?

The upstream overwrite_feature_golden_config_db_singleasic() accepts optional auto_restart and state parameters:

def overwrite_feature_golden_config_db_singleasic(self, config, feature_key, auto_restart="enabled", state="enabled"):

But the 202412 branch version only accepts (config, feature_key) and hardcodes both as "enabled":

def overwrite_feature_golden_config_db_singleasic(self, config, feature_key):

The cherry-picked call passes 4 arguments:

config = self.overwrite_feature_golden_config_db_singleasic(config, "otel", "enabled", "enabled")

This causes a TypeError at runtime:

TypeError: overwrite_feature_golden_config_db_singleasic() takes 3 positional arguments but 5 were given

How did you fix it?

Removed the extra "enabled", "enabled" arguments since the 202412 branch already hardcodes those values.

How did you verify/test it?

Verified the method signature matches the call site. Python syntax check passes.

…ngleasic call

PR Azure#1067 cherry-picked the otel feature enablement from upstream PR #22341,
but the upstream overwrite_feature_golden_config_db_singleasic() accepts
optional auto_restart and state parameters, while the 202412 branch version
only accepts (config, feature_key) and hardcodes both as 'enabled'.

This causes a TypeError at runtime:
  TypeError: overwrite_feature_golden_config_db_singleasic() takes 3
  positional arguments but 5 were given

Fix by removing the extra arguments since the 202412 branch already
hardcodes the desired 'enabled' values.

Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Dashuai Zhang <dashuaizhang@microsoft.com>
@sdszhang sdszhang requested a review from Janetxxx March 13, 2026 13:03
Copy link
Member

@Janetxxx Janetxxx left a comment

Choose a reason for hiding this comment

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

LGTM

@Janetxxx Janetxxx merged commit ec71ec7 into Azure:202412 Mar 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants