vmware-archive / vcd-cli

Command Line Interface for VMware vCloud Director
https://vmware.github.io/vcd-cli
Other
163 stars 104 forks source link

Disable edge HA is not working #545

Open merlimpt opened 3 years ago

merlimpt commented 3 years ago

Hello,

First I logged in with global admin account : vcd login host.name.url system adminusername --password passwd -w -i

Then I select the org and VCD : vcd org use myorg

If I have HA disabled in my edge, I can enable it with : vcd gateway update --ha-enabled edgenamexpto

But if I have HA enabled, I cannot disable it with this command : vcd gateway update --ha-disabled edgenamexpto

The put command in vcd.log had true.

Any clue?

The function executed was edit_gateway, click options appear to be correct. I create a small program to test it, and everything look like correct :

[root@vdcreport01 ~]# ./x.py --ha-disabled
HA Disabled
[root@vdcreport01 ~]# ./x.py --ha-enabled
HA Enabled
[root@vdcreport01 ~]# cat x.py
#! /usr/bin/python3
import click
import sys

@click.command()
@click.option(
    '--ha-enabled/--ha-disabled',
    'is_enabled',
    default=False,
    metavar='<bool>',
    help='enable/disable HA for gateway.')

def info(is_enabled):
    rv = "HA Disabled"
    if is_enabled:
        rv = "HA Enabled"
    click.echo(rv)

if __name__ == '__main__':
    info()

Regards, Rui