You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/04/08 11:10:31 UTC

[GitHub] [cloudstack] soreana commented on a change in pull request #4023: FIX: prevent empty sshkey name.

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:
users@infra.apache.org


With regards,
Apache Git Services