Skip to content

Commit

Permalink
Fixed issue with required param
Browse files Browse the repository at this point in the history
  • Loading branch information
davidallendj committed Jul 22, 2024
1 parent 1ab5c8a commit c537e49
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cmd/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ var (
// on a subnet.
var collectCmd = &cobra.Command{
Use: "collect",
Short: "Query information about BMC",
Short: "Collect system information by interrogating BMC node",
Long: "Send request(s) to a collection of hosts running Redfish services found stored from the 'scan' in cache.\n" +
"See the 'scan' command on how to perform a scan.\n\n" +
"Examples:\n" +
" magellan collect --cache ./assets.db --output ./logs --timeout 30 --cacert cecert.pem\n" +
" magellan collect --host smd.example.com --port 27779 --username username --password password",
Run: func(cmd *cobra.Command, args []string) {
// make application logger
l := log.NewLogger(logrus.New(), logrus.DebugLevel)
Expand Down Expand Up @@ -52,8 +57,8 @@ var collectCmd = &cobra.Command{
concurrency = mathutil.Clamp(len(probeStates), 1, 255)
}
q := &magellan.QueryParams{
User: username,
Pass: password,
Username: username,
Password: password,
Protocol: protocol,
Timeout: timeout,
Concurrency: concurrency,
Expand Down Expand Up @@ -88,7 +93,7 @@ func init() {
collectCmd.PersistentFlags().StringVar(&cacertPath, "cacert", "", "path to CA cert. (defaults to system CAs)")

// set flags to only be used together
collectCmd.MarkFlagsRequiredTogether("user", "pass")
collectCmd.MarkFlagsRequiredTogether("username", "password")

viper.BindPFlag("collect.driver", collectCmd.Flags().Lookup("driver"))
viper.BindPFlag("collect.host", collectCmd.Flags().Lookup("host"))
Expand Down

0 comments on commit c537e49

Please # to comment.