Update troubleshoot.go

This commit is contained in:
luke-hagar-sp
2023-08-04 16:22:35 -05:00
parent 43547491e7
commit 9fa8ccbf96

View File

@@ -36,8 +36,7 @@ func NewTroubleshootCmd(term terminal.Terminal) *cobra.Command {
credentials = append(credentials, password) credentials = append(credentials, password)
} }
for host := 0; host < len(args); host++ { for index, endpoint := range args {
endpoint := args[host]
outputDir := path.Join(output, endpoint) outputDir := path.Join(output, endpoint)
if _, err := os.Stat(outputDir); errors.Is(err, os.ErrNotExist) { if _, err := os.Stat(outputDir); errors.Is(err, os.ErrNotExist) {
@@ -47,7 +46,7 @@ func NewTroubleshootCmd(term terminal.Terminal) *cobra.Command {
} }
} }
password := credentials[host] password := credentials[index]
orgErr := va.RunVACmdLive(endpoint, password, TroubleshootingScript) orgErr := va.RunVACmdLive(endpoint, password, TroubleshootingScript)
if orgErr != nil { if orgErr != nil {