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

vm list recursive - bug! #490

Open
ghost opened this issue Dec 17, 2019 · 6 comments
Open

vm list recursive - bug! #490

ghost opened this issue Dec 17, 2019 · 6 comments
Labels
Triage: Confirmed Indicates and issue has been confirmed as described. Type: Bug Does not work as expected.

Comments

@ghost
Copy link

ghost commented Dec 17, 2019

Version:

Chef Workstation version: 0.12.20
knife-vsphere (4.0.7)

Environment:

ubuntu server 18.04 lts

Scenario:

trying to list the vms in vcenter using the recursive option

Steps to Reproduce:

knife vsphere vm list -r

ERROR: RbVmomi::Fault: InvalidLogin: Cannot complete login due to an incorrect user name
or password.

knife vsphere vm list --recursive

(works correctly)

Expected Result:

I expected the '-r' option to work as in the documentation

"-r, --recursive - Recurse down through sub-folders to the specified folder"

Actual Result:

the error message is shown instead of vm listing

"ERROR: RbVmomi::Fault: InvalidLogin: Cannot complete login due to an incorrect user name
or password."

the exact same command works with "--recursive" instead or "-r"

@ghost ghost added the Status: Untriaged An issue that has yet to be triaged. label Dec 17, 2019
@ghost
Copy link
Author

ghost commented Dec 17, 2019

also, the documentation mentions

"... Only name is currently displayed."

This is incorrect. from the code you can see there are also IP,RAM,State

puts "\t#{ui.color("VM Name:", :cyan)} #{vm.name}"
puts "\t\t#{ui.color("IP:", :magenta)} #{vm.guest.ipAddress}"
puts "\t\t#{ui.color("RAM:", :magenta)} #{vm.summary.config.memorySizeMB}"
puts "\t\t#{ui.color("State:", :magenta)} #{state}"

eg.

Capture222

@swalberg
Copy link
Collaborator

Hey Scott, thanks for the bug report. Is that the exact command you're running or do you also log in on the command line? What version of the chef gem do you have installed?

Can you give a stack trace (-VV) for the -r case?

Just tried it here, with knife-vsphere 2.0.1 both -r and --recursive work fine. With what we have in master, --recursive works but -r gives me OptionParser::MissingArgument: missing argument: -r. If I do -r foo it works though.

It might be that -r gets used somewhere else in Chef because if I switch it to -a it works as expected.

Let me know what you see, please.

Thanks/

@ghost
Copy link
Author

ghost commented Dec 17, 2019 via email

@swalberg
Copy link
Collaborator

Aha, thanks for the traces. See how you've got -r --vsuser [email protected] and when it works you get

DEBUG: value for config item vsphere_user: [email protected]

but when it doesn't,

DEBUG: value for config item vsphere_user:

"something changed" in the parsing of that -r option so it's not seeing the full --vsuser after that. If you put -r at the end of the command line you'd probably get the same "missing argument" error that I got.

I will do some more digging later but my guess is I'll have to get rid of the short -r.

@swalberg swalberg added Triage: Confirmed Indicates and issue has been confirmed as described. Type: Bug Does not work as expected. and removed Status: Untriaged An issue that has yet to be triaged. labels Dec 17, 2019
@ghost
Copy link
Author

ghost commented Dec 17, 2019 via email

@swalberg
Copy link
Collaborator

Anything that applies to an individual VM will search recursively anyway at this point. I guess I need to remove those options!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage: Confirmed Indicates and issue has been confirmed as described. Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

1 participant