[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-9132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15095602#comment-15095602
 ] 

ASF GitHub Bot commented on CLOUDSTACK-9132:
--------------------------------------------

Github user nitin-maharana commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1319#discussion_r49551329
  
    --- Diff: server/src/com/cloud/storage/VolumeApiServiceImpl.java ---
    @@ -476,6 +476,25 @@ public VolumeVO doInTransaction(TransactionStatus 
status) {
             });
         }
     
    +    /**
    +     * Retrieves the volume name from CreateVolumeCmd object.
    +     *
    +     * If the retrieved volume name is null, empty or blank, then A random 
name
    +     * will be generated using getRandomVolumeName method.
    +     *
    +     * @param cmd
    +     * @return Either the retrieved name or a random name.
    +     */
    +    public String getVolumeNameFromCommand(CreateVolumeCmd cmd) {
    +        String userSpecifiedName = cmd.getVolumeName();
    +
    +        if 
(org.apache.commons.lang.StringUtils.isBlank(userSpecifiedName)) {
    --- End diff --
    
    Yes, you can test the change. But I have tested this on my environment. Its 
working fine. Thanks.


> API createVolume takes empty string for name parameter
> ------------------------------------------------------
>
>                 Key: CLOUDSTACK-9132
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9132
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: API
>            Reporter: Nitin Kumar Maharana
>
> Steps to Reproduce:
> ================
> Create a volume using createVolume API where parameter name is empty.
> It creates a volume with empty name.
> But the name parameter is mandatory.(Issue)
> Expected Behaviour:
> ================
> It shouldn't create a volume with an empty name. Error should be returned.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to