diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2019-05-09 10:42:02 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2019-05-09 10:42:02 +0200 |
commit | 034fbc59208294df7e2e044a998a627db3cfe036 (patch) | |
tree | 357c952d5f3cb0d3fdf4700829ad89d7b47f2c40 /config-model | |
parent | eae7dde35aa7fe09f8be516035f6ac61c3f0374a (diff) |
Add a comment and rename some variables
Diffstat (limited to 'config-model')
2 files changed, 6 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/first/AccessControlValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/first/AccessControlValidator.java index 96295d16445..a89f96453fb 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/first/AccessControlValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/first/AccessControlValidator.java @@ -58,4 +58,5 @@ public class AccessControlValidator extends Validator { private boolean hasNonMbusBinding(Handler<?> handler) { return handler.getServerBindings().stream().anyMatch(binding -> ! binding.startsWith("mbus")); } + } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java index 7a1caf83b9f..b2d9b31e9b2 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java @@ -174,11 +174,11 @@ public class NodesSpecification { } private static Optional<NodeResources> getFlavor(ModelElement nodesElement) { - ModelElement flavor = nodesElement.child("resources"); - if (flavor != null) { - return Optional.of(new NodeResources(flavor.requiredDoubleAttribute("vcpu"), - parseGbAmount(flavor.requiredStringAttribute("memory")), - parseGbAmount(flavor.requiredStringAttribute("disk")))); + ModelElement resources = nodesElement.child("resources"); + if (resources != null) { + return Optional.of(new NodeResources(resources.requiredDoubleAttribute("vcpu"), + parseGbAmount(resources.requiredStringAttribute("memory")), + parseGbAmount(resources.requiredStringAttribute("disk")))); } else if (nodesElement.stringAttribute("flavor") != null) { // legacy fallback return Optional.of(NodeResources.fromLegacyName(nodesElement.stringAttribute("flavor"))); |