soreana commented on a change in pull request #4023: FIX: prevent empty sshkey
name.
URL: https://github.com/apache/cloudstack/pull/4023#discussion_r405444406
##########
File path: server/src/main/java/com/cloud/server/ManagementServerImpl.java
##########
@@ -3711,6 +3711,11 @@ public SSHKeyPair createSSHKeyPair(final
CreateSSHKeyPairCmd cmd) {
final SSHKeysHelper keys = new SSHKeysHelper(sshKeyLength.value());
final String name = cmd.getName();
+
+ if (StringUtils.isBlank(name)) {
+ throw new InvalidParameterValueException("Please specify a valid
name for the key pair. The key name can't be empty");
+ }
+
Review comment:
Thanks for your comment. Moved it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services