Skip to content

Static external IP sample entry point passes invalid keyword arguments #14611

Description

@aniruddhaadak80

In which file did you encounter the issue?

  • compute/client_library/recipes/instances/ip_address/assign_static_external_ip_to_new_vm.py
  • compute/client_library/snippets/instances/ip_address/assign_static_external_ip_to_new_vm.py

Did you change the file? If so, how?

No.

Describe the issue

The command-line entry point calls assign_static_external_ip_to_new_vm with external_ipv4 and external_access keyword arguments, but the function accepts a single ip_address argument. The generated snippet and its source recipe contain the same incorrect call.

Static reproduction:

compute\\client_library\\snippets\\instances\\ip_address\\assign_static_external_ip_to_new_vm.py:313: error: Unexpected keyword argument "external_ipv4" for "assign_static_external_ip_to_new_vm"  [call-arg]
compute\\client_library\\snippets\\instances\\ip_address\\assign_static_external_ip_to_new_vm.py:313: error: Unexpected keyword argument "external_access" for "assign_static_external_ip_to_new_vm"  [call-arg]

At runtime, the call raises TypeError: assign_static_external_ip_to_new_vm() got an unexpected keyword argument 'external_ipv4' before the instance is created.

Expected behavior: the sample entry point passes the pre-created address as ip_address. Actual behavior: the generated sample cannot run.

Environment: Python 3.12, mypy 1.14.1, repository main at commit 430a87ada6f2d33f318b5d16b77464679905a140.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    samplesIssues that are directly related to samples.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions