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

Add support for unescaping URL encoded VirtualMachine names #878

Open
atc0005 opened this issue Aug 5, 2023 · 1 comment
Open

Add support for unescaping URL encoded VirtualMachine names #878

atc0005 opened this issue Aug 5, 2023 · 1 comment
Assignees
Labels
folder output/extended Long Service Output (aka, "extended" or "detailed") output/logging virtual machine
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Aug 5, 2023

For example, a VM named server1.example.com - Q/A Web in the vSphere inventory is listed as server1.example.com - Q%2fA Web when printing the Name field.

This isn't necessarily a problem, but it would be useful to list VMs in the same format as they're shown within the web UI.

This would necessitate wrapping all access to the Name field with a helper function of some kind. It is likely that other fields would be similarly affected (e.g., Folder names).

@atc0005 atc0005 added output/logging virtual machine output/extended Long Service Output (aka, "extended" or "detailed") labels Aug 5, 2023
@atc0005 atc0005 added this to the Future milestone Aug 5, 2023
@atc0005 atc0005 self-assigned this Aug 5, 2023
@atc0005 atc0005 added the folder label Aug 5, 2023
@atc0005
Copy link
Owner Author

atc0005 commented Aug 5, 2023

Mockup:

package main

import (
	"fmt"
	"log"
	"net/url"
)

func main() {
	sampleText := "Q%2fA Web"
	expectedText := "Q/A Web"

	resultText, err := url.QueryUnescape(sampleText)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(resultText)
	if resultText == expectedText {
		fmt.Println("Successful unescape")
	}
}

Output:

Q/A Web
Successful unescape

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
folder output/extended Long Service Output (aka, "extended" or "detailed") output/logging virtual machine
Projects
None yet
Development

No branches or pull requests

1 participant