mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -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
|
return nil
|
||||||
},
|
},
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
staticStore := &secrets.StaticStore{
|
store, err := secrets.OpenStore(secretsFile)
|
||||||
Username: viper.GetString("crawl.username"),
|
if err != nil {
|
||||||
Password: viper.GetString("crawl.password"),
|
fmt.Println(err)
|
||||||
|
store = &secrets.StaticStore{
|
||||||
|
Username: viper.GetString("crawl.username"),
|
||||||
|
Password: viper.GetString("crawl.password"),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
systems, err := crawler.CrawlBMCForSystems(crawler.CrawlerConfig{
|
systems, err := crawler.CrawlBMCForSystems(crawler.CrawlerConfig{
|
||||||
URI: args[0],
|
URI: args[0],
|
||||||
CredentialStore: staticStore,
|
CredentialStore: store,
|
||||||
Insecure: cmd.Flag("insecure").Value.String() == "true",
|
Insecure: cmd.Flag("insecure").Value.String() == "true",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue