mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
refactor: changed to use local store with static store fallback
This commit is contained in:
parent
df77e075ef
commit
41346aebbb
1 changed files with 8 additions and 4 deletions
12
cmd/crawl.go
12
cmd/crawl.go
|
|
@ -36,13 +36,17 @@ var CrawlCmd = &cobra.Command{
|
|||
return nil
|
||||
},
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
staticStore := &secrets.StaticStore{
|
||||
Username: viper.GetString("crawl.username"),
|
||||
Password: viper.GetString("crawl.password"),
|
||||
store, err := secrets.OpenStore(secretsFile)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
store = &secrets.StaticStore{
|
||||
Username: viper.GetString("crawl.username"),
|
||||
Password: viper.GetString("crawl.password"),
|
||||
}
|
||||
}
|
||||
systems, err := crawler.CrawlBMCForSystems(crawler.CrawlerConfig{
|
||||
URI: args[0],
|
||||
CredentialStore: staticStore,
|
||||
CredentialStore: store,
|
||||
Insecure: cmd.Flag("insecure").Value.String() == "true",
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue