vmware-archive / vcd-cli

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

vcd right info not working with comma in right name #200

Open MarRio81 opened 6 years ago

MarRio81 commented 6 years ago

Hi,

The error is returned on all commands where you specify rights with comma in its name.

vcd right info 'vApp: Migrate, Force Undeploy, Relocate, Consolidate'
Usage: vcd right info [OPTIONS] <right-name>

Error: Status code: 400/BAD_REQUEST, Bad request: Expression  Force Undeploy is not a comparison expression. (request id: 4d76e99d-dece-4eba-a340-cef1b2505d13)
vcd version
vcd-cli, VMware vCloud Director Command Line Interface, 20.1.2
rocknes commented 6 years ago

This is embarrassing. We will fix this soon. In the meantime please encode the right using percent encoding e.g. https://www.url-encode-decode.com/

(vcd-cli) C:\code\vcd-cli>vcd right add "vApp%3A+VM+Migrate%2C+Force+Undeploy%2C+Relocate%2C+Consolidate" Rights added to the Org 'testorg1'

(vcd-cli) C:\code\vcd-cli>vcd right list

Catalog: Create / Delete a Catalog . . vApp: View VM metrics VAPP_VM_METADATA_TO_VCENTER vApp: VM Boot Options vApp: VM Migrate, Force Undeploy, Relocate, Consolidate

rocknes commented 6 years ago

Btw please note that removing the right (with comma in it) from the org might not work even after percent encoding.

rocknes commented 6 years ago

Fix is being pushed to branch via https://github.com/vmware/pyvcloud/pull/282 and https://github.com/vmware/vcd-cli/pull/239