Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] govc ls -xml fails with "xml: unsupported type" #3053

Closed
CarstenGrohmann opened this issue Feb 23, 2023 · 1 comment · Fixed by #3079
Closed

[BUG] govc ls -xml fails with "xml: unsupported type" #3053

CarstenGrohmann opened this issue Feb 23, 2023 · 1 comment · Fixed by #3079

Comments

@CarstenGrohmann
Copy link
Contributor

Describe the bug
govc ls -xml returns an error but govc ls -json don't. The help for govc ls says that -json and -xml are valid options.

# ./govc ls -xml / 
./govc: xml: unsupported type: func(context.Context, *vim25.Client) error

# ./govc ls -json /
{
  "elements": [
    {
      "Path": "/MyDC",
      "Object": {
        "Self": {
          "Type": "Datacenter",
          "Value": "datacenter-1"
        },
        "Value": null,
[...]

# ./govc ls -h
Usage: ./govc ls [OPTIONS] [PATH]...

List inventory items.

Examples:
  govc ls -l '*'
  govc ls -t ClusterComputeResource host
  govc ls -t Datastore host/ClusterA/* | grep -v local | xargs -n1 basename | sort | uniq

Options:
  -L=false               Follow managed object references
  -cert=                 Certificate [GOVC_CERTIFICATE]
  -dc=                   Datacenter [GOVC_DATACENTER]
  -debug=false           Store debug logs [GOVC_DEBUG]
  -dump=false            Enable Go output
  -i=false               Print the managed object reference
  -json=false            Enable JSON output
  -k=false               Skip verification of server certificate [GOVC_INSECURE]
  -key=                  Private key [GOVC_PRIVATE_KEY]
  -l=false               Long listing format
  -persist-session=true  Persist session to disk [GOVC_PERSIST_SESSION]
  -t=                    Object type
  -tls-ca-certs=         TLS CA certificates file [GOVC_TLS_CA_CERTS]
  -tls-known-hosts=      TLS known hosts file [GOVC_TLS_KNOWN_HOSTS]
  -trace=false           Write SOAP/REST traffic to stderr
  -u=                    ESX or vCenter URL [GOVC_URL]
  -verbose=false         Write request/response data to stderr
  -vim-namespace=vim25   Vim namespace [GOVC_VIM_NAMESPACE]
  -vim-version=7.0       Vim version [GOVC_VIM_VERSION]
  -xml=false             Enable XML output

To Reproduce
Steps to reproduce the behavior:

  1. run ./govc ls -json /
  2. run ./govc ls -xml /

Expected behavior
./govc ls -xml / return the content in XML.

Affected version

# ./govc version -l
Build Version: 0.30.2
Build Commit: 9078b0b4
Build Date: 2023-02-01T04:38:27Z
@github-actions
Copy link
Contributor

Howdy 🖐   CarstenGrohmann ! Thank you for your interest in this project. We value your feedback and will respond soon.

If you want to contribute to this project, please make yourself familiar with the CONTRIBUTION guidelines.

@CarstenGrohmann CarstenGrohmann changed the title [BUG] [BUG] govc ls -xml fails with "xml: unsupported type" Feb 23, 2023
dougm added a commit to dougm/govmomi that referenced this issue Mar 25, 2023
dougm added a commit to dougm/govmomi that referenced this issue Mar 27, 2023
dougm added a commit that referenced this issue Jun 27, 2023
priyanka19-98 pushed a commit to priyanka19-98/govmomi that referenced this issue Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant