Skip to content
This repository was archived by the owner on Sep 1, 2026. It is now read-only.
This repository was archived by the owner on Sep 1, 2026. It is now read-only.

Authentication failure when using direct return value from create_vsphere_client #435

Description

@nikstuckenbrock

Describe the bug

Calling the synchronous vcenter api leads to different behaviors depending on if you assign the return value of create_vsphere_client before usage.

Calling it directly from the return value raises this excpetion:

LocalizableMessage(id='com.vmware.vapi.endpoint.method.authentication.required', default_message='Authentication required.', args=[], params=None, localized=None)], data : None, error_type : UNAUTHENTICATED} 

Reproduction steps

Failure

x = create_vsphere_client(
    server="",
    username="",
    password="",
    session="",
).vcenter.vm.list()

Works

x = create_vsphere_client(
    server="",
    username="",
    password="",
    session="",
)
x.vcenter.vm.list()

Expected behavior

Both version work without errors.

Additional context

No response

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions