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

Vendor not read from .drackvmrc #12

Open
radek-senfeld opened this issue Feb 1, 2019 · 0 comments
Open

Vendor not read from .drackvmrc #12

radek-senfeld opened this issue Feb 1, 2019 · 0 comments

Comments

@radek-senfeld
Copy link

radek-senfeld commented Feb 1, 2019

Hello,
thank you once more for this marvelous tool! Today I started using it for Supermicro as well.

There's a minor annoyance with --vendor having default value set to "dell". It causes ignoring vendor set in .drackvmrc.

The reason is this if block - *_vendor is never an empty string due to the default value. (https://github.com/rockyluke/drac-kvm/blob/master/main.go#L141)

	if *_vendor == "" {
		if value, err := cfg.GetValue(*_host, "vendor"); err == nil {
			vendor = value
		} else {
			// To keep old default behaviour we set vendor string to dell by default.
			vendor = "dell"
		}
	} else {
		vendor = *_vendor
	}

	if _, err := kvm.CheckVendorString(vendor); err != nil {
		log.Fatalf("Provided vendor: %s, is not supported consider adding support with Github PR...", vendor)
	}

Quick and dirty fix is to replace if *_vendor == "" { with if *_vendor == "" || *_vendor == "dell" { but it's clearly suboptimal.

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

No branches or pull requests

1 participant