diff options
author | toby <smorgrav@yahoo-inc.com> | 2018-04-23 13:08:33 +0200 |
---|---|---|
committer | toby <smorgrav@yahoo-inc.com> | 2018-04-23 13:08:33 +0200 |
commit | 8acf1fb0657d0a7d8e11678c75ef5da02044ee0f (patch) | |
tree | dc04efbeb305d352a8f804e65160fbd51a545bd8 /node-repository | |
parent | 506f66bda3b65f41496064307ba010bd9c353101 (diff) |
Allow us to reset hardwarefailure by passing 'null' over REST
Diffstat (limited to 'node-repository')
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java index b808921a713..0e697dd97a3 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java @@ -125,7 +125,7 @@ public class NodePatcher { case "flavor" : return node.with(nodeFlavors.getFlavorOrThrow(asString(value))); case HARDWARE_FAILURE_DESCRIPTION: - return node.with(node.status().withHardwareFailureDescription(asOptionalString(value))); + return node.with(node.status().withHardwareFailureDescription(removeQuotedNulls(asOptionalString(value)))); case "parentHostname" : return node.withParentHostname(asString(value)); case "ipAddresses" : @@ -182,7 +182,7 @@ public class NodePatcher { return field.type().equals(Type.NIX) ? Optional.empty() : Optional.of(asString(field)); } - // Remove when we no longer have "null" strings for this field in the node repo + // Allows us to clear optional flags by passing "null" as slime does not have an empty (but present) representation private Optional<String> removeQuotedNulls(Optional<String> value) { return value.filter(v -> !v.equals("null")); } |