NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Active IQ Unified Manager Discussions

Doing Concatenation and not addition

Adai
6,945 Views

I am using cDOT Resize volume command to resize a volume by specifying a increment size and not the absolute size.

resizeVolume is my Command Variable.

In the other parameters tab, for attribute TargetSize I am having an expression as follows

resizeVolume.size_mb+$IncrementSizeInGB*1024

 

 

The above expresion is getting evalueated as string and getting concatenated and not added as integers.

 

So if my resizeVolume.size_mb is 1024 which is 1GB and my $IncrementSizeInGB is 50GB then the result I get in the execution plan is 

102451200 which is (1024+50*1024) 102551200

 

Am I missing something ? How to get this as addition and not concatenation

 

Regards

adai

1 ACCEPTED SOLUTION

ag
NetApp
6,932 Views

This worked for me:

($increment*1024) + (int)resizeVolume.size_mb

 

resizeVolume.size_mb returns a long value and it somehow gets concatenated.

 

Let me know if it works.

 

-Anil

 

View solution in original post

5 REPLIES 5

trentino123
6,908 Views

Here is an example of resize function ( check for the (int) when returning a result so it does not concatenate as a string ) :

 

def setNewVolSize(growVolume, addSize, rateOfChange) {
  if (addSize=='')
     return growVolume.size_mb;
  else
     return ((int) growVolume.size_mb) + calculateVolumeSizeFromDataSize(convertFromGB(addSize),rateOfChange);
}

paragp
6,905 Views

Adai, I am checking to see if this is a bug. In the meanwhile you can use this expression to make sure the numbers get added instead of concatenated.

 

Long.valueOf(resizeVolume.size_mb)+$IncrementSizeInGB*1024

 

ag
NetApp
6,933 Views

This worked for me:

($increment*1024) + (int)resizeVolume.size_mb

 

resizeVolume.size_mb returns a long value and it somehow gets concatenated.

 

Let me know if it works.

 

-Anil

 

AdaikkappanArumugam
6,668 Views

Hi WFA Team,

Is this bug fixed in WFA 3.0 GA or atleast in 3.1 RC thats coming soon ?

 

Regards

Adai

Adai
6,893 Views

Hi Anil and Parag,

Thanks for your quick replies, both your solution works.

 

Regards

adai

Public