ClusterLabs / fence-agents

Fence agents
101 stars 155 forks source link

fence_azure_arm: fix get virtual machines call #562

Closed jcanocan closed 8 months ago

jcanocan commented 9 months ago

Problem:

The fence_azure_arm script shows the following error:

VirtualMachinesOperations.get() takes 3 positional arguments but 4 were given

Explanation:

The function virtual_machines.get() has changed its signature from:

def get(
    self,
    resource_group_name,
    expand=None,
    **kwargs
):

to:

def get(
    self,
    resource_group_name: str,
    machine_name: str,
    expand: Optional[Union[str, _models.InstanceViewTypes]] = None,
    **kwargs: Any
    ) -> _models.Machine:

Therefore, the number of positional arguments has been reduced to two: resource_group_name and machine_name, while the expand parameter has swift from a positional argument to a keyword-only argument: https://github.com/Azure/azure-sdk-for-python/pull/27590/files#diff-d5feb43fb2e32f16f624d64917b3fa784cc7ea829373fcd49dc09a9a36e46f56L105

Fix: https://github.com/Azure/azure-sdk-for-python/issues/30983

All credit to @msyyc who originally posted the solution to this issue in: https://github.com/Azure/azure-sdk-for-python/issues/30983#issuecomment-1647081509

knet-jenkins[bot] commented 9 months ago

Can one of the admins check and authorise this run please: https://ci.kronosnet.org/job/fence-agents/job/fence-agents-pipeline/job/PR-562/1/input

razo7 commented 8 months ago

+1 Trying to run fence_azure_arm failed with the same error, and the above fix helped

oalbrigt commented 8 months ago

Thanks.