-
Notifications
You must be signed in to change notification settings - Fork 1.3k
assume a property is one when it isn't a number #5647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,7 +246,17 @@ public long getTemplateVirtualSize(String templatePath, String templateName) thr | |
| NodeList diskElements = new OVFHelper().getElementsByTagNameAndPrefix(ovfDoc, "Disk", "ovf"); | ||
| for (int i = 0; i < diskElements.getLength(); i++) { | ||
| Element disk = (Element)diskElements.item(i); | ||
| long diskSize = Long.parseLong(disk.getAttribute("ovf:capacity")); | ||
| String diskSizeValue = disk.getAttribute("ovf:capacity"); | ||
| long diskSize = 1; | ||
| try { | ||
| diskSize = Long.parseLong(diskSizeValue); | ||
| } catch (NumberFormatException e) { | ||
| // ASSUMEably the diskSize contains a property for replacement | ||
| LOGGER.warn(String.format("the disksize for disk %s is not a valid number: %s", disk.getAttribute("diskId"), diskSizeValue)); | ||
| // TODO parse the property to get any value can not be done at registration time | ||
| // and will have to be done at deploytime, so for orchestration purposes | ||
| // we now assume, a value of one | ||
|
Comment on lines
+256
to
+258
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more like a design brainstorm than a TODO
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DaanHoogland any specific reason for completely not supporting those kinds of templates instead of assuming the size to be 1 ? I think this approach will have some effect on the usage records of the volume also.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @harikrishna-patnala this is only the template and there will be only a "real" disksize on/after deployment. This will only fix registration btw, and assumes deployment is going on as usual, probably for bad reason. |
||
| } | ||
| String allocationUnits = disk.getAttribute("ovf:capacityAllocationUnits"); | ||
| diskSize = OVFHelper.getDiskVirtualSize(diskSize, allocationUnits, ovfFileName); | ||
| virtualSize += diskSize; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure here if we should 'some' or 0 (zero)