[GitHub] DaanHoogland commented on a change in pull request #2567: [Vmware] Fix for OVF parsing error

2018-04-13 Thread GitBox
DaanHoogland commented on a change in pull request #2567: [Vmware] Fix for OVF 
parsing error
URL: https://github.com/apache/cloudstack/pull/2567#discussion_r181345229
 
 

 ##
 File path: api/src/com/cloud/agent/api/storage/OVFHelper.java
 ##
 @@ -113,7 +113,7 @@ public static Long getDiskVirtualSize(Long capacity, 
String allocationUnits, Str
 String allocationUnits = 
disk.getAttribute("ovf:capacityAllocationUnits");
 od._diskId = disk.getAttribute("ovf:diskId");
 od._fileRef = disk.getAttribute("ovf:fileRef");
-od._populatedSize = 
Long.parseLong(disk.getAttribute("ovf:populatedSize") == null ? "0" : 
disk.getAttribute("ovf:populatedSize"));
+od._populatedSize = 
NumberUtils.toLong(disk.getAttribute("ovf:populatedSize"));
 
 Review comment:
   remains teh question: are we settling for the ci on this one (i did check 
that before merging) @rhtyd @rafaelweingartner @borisstoyanov ?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] DaanHoogland commented on a change in pull request #2567: [Vmware] Fix for OVF parsing error

2018-04-13 Thread GitBox
DaanHoogland commented on a change in pull request #2567: [Vmware] Fix for OVF 
parsing error
URL: https://github.com/apache/cloudstack/pull/2567#discussion_r181344017
 
 

 ##
 File path: api/src/com/cloud/agent/api/storage/OVFHelper.java
 ##
 @@ -113,7 +113,7 @@ public static Long getDiskVirtualSize(Long capacity, 
String allocationUnits, Str
 String allocationUnits = 
disk.getAttribute("ovf:capacityAllocationUnits");
 od._diskId = disk.getAttribute("ovf:diskId");
 od._fileRef = disk.getAttribute("ovf:fileRef");
-od._populatedSize = 
Long.parseLong(disk.getAttribute("ovf:populatedSize") == null ? "0" : 
disk.getAttribute("ovf:populatedSize"));
+od._populatedSize = 
NumberUtils.toLong(disk.getAttribute("ovf:populatedSize"));
 
 Review comment:
   sorry @rhtyd , you are right about the tests. I saw @borisstoyanov 's lgtm 
and assumed.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] DaanHoogland commented on a change in pull request #2567: [Vmware] Fix for OVF parsing error

2018-04-13 Thread GitBox
DaanHoogland commented on a change in pull request #2567: [Vmware] Fix for OVF 
parsing error
URL: https://github.com/apache/cloudstack/pull/2567#discussion_r181343883
 
 

 ##
 File path: api/src/com/cloud/agent/api/storage/OVFHelper.java
 ##
 @@ -113,7 +113,7 @@ public static Long getDiskVirtualSize(Long capacity, 
String allocationUnits, Str
 String allocationUnits = 
disk.getAttribute("ovf:capacityAllocationUnits");
 od._diskId = disk.getAttribute("ovf:diskId");
 od._fileRef = disk.getAttribute("ovf:fileRef");
-od._populatedSize = 
Long.parseLong(disk.getAttribute("ovf:populatedSize") == null ? "0" : 
disk.getAttribute("ovf:populatedSize"));
+od._populatedSize = 
NumberUtils.toLong(disk.getAttribute("ovf:populatedSize"));
 
 Review comment:
   @rhtyd NumberUtils.toLong(Sting) calls NumberUtils.toLong(Sting,0L)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services