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

Fix usagetype parameter autocomplete #156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hsato03
Copy link

@hsato03 hsato03 commented Jan 1, 2025

Currently, when using autocomplete in the usagetype parameter (present in APIs such as quotaPresetVariableList and quotaCreateTariff) the CLI panics.

$ cmk  
Apache CloudStack 🐵 CloudMonkey 6.4.0
Report issues: https://github.com/apache/cloudstack-cloudmonkey/issues

panic: interface conversion: interface {} is float64, not string

goroutine 36 [running]:
github.com/apache/cloudstack-cloudmonkey/cli.buildArgOptions(0xc000f48000?, 0x0)
	/Users/rohit/lab/apache/cloudstack-cloudmonkey/cli/completer.go:126 +0x8c5
github.com/apache/cloudstack-cloudmonkey/cli.(*autoCompleter).Do(0xc00004f790, {0xc000e9e3f0, 0x0?, 0x24}, 0x24)
	/Users/rohit/lab/apache/cloudstack-cloudmonkey/cli/completer.go:402 +0x136c
github.com/chzyer/readline.(*opCompleter).OnComplete(0xc000130ee0)
	/Users/rohit/lab/apache/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/complete.go:101 +0x10d
github.com/chzyer/readline.(*Operation).ioloop(0xc000130e00)
	/Users/rohit/lab/apache/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/operation.go:180 +0xc8a
created by github.com/chzyer/readline.NewOperation in goroutine 1
	/Users/rohit/lab/apache/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/operation.go:88 +0x2d6

This PR aims to fix this bug and allow users to use the completer for the usagetype parameter.

Screenshot from 2025-01-01 15-30-09

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 this pull request may close these issues.

1 participant