Skip to content
Snippets Groups Projects
Commit 60aaa655 authored by kayrus's avatar kayrus
Browse files

Return 1 rc if the server was not found

Resolves #3
parent 782299aa
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,8 @@ var RootCmd = &cobra.Command{
}
}
var errors []error
switch v := privateKey.(type) {
// Only RSA PKCS #1 v1.5 is supported by OpenStack
case *rsa.PrivateKey:
......@@ -113,12 +115,17 @@ var RootCmd = &cobra.Command{
err = processServer(client, server, v)
if err != nil {
log.Printf("%s", err)
errors = append(errors, err)
}
}
default:
return fmt.Errorf("unsupported key type %T\nOnly RSA PKCS #1 v1.5 is supported by OpenStack", v)
}
if len(errors) > 0 {
return fmt.Errorf("%v", errors)
}
return nil
},
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment