From 0763e130f59e1bbe2367810f8eb97514ef3d7493 Mon Sep 17 00:00:00 2001 From: Andreas Eriksen Date: Thu, 26 Oct 2017 11:21:54 +0200 Subject: don't allow nodes with spec divergence to go to dirty --- .../main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'node-repository/src') diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java index 92f52155edf..88daa34d8ca 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java @@ -386,8 +386,9 @@ public class NodeRepository extends AbstractComponent { Node nodeToDirty = getNode(hostname, Node.State.provisioned, Node.State.failed, Node.State.parked).orElseThrow(() -> new IllegalArgumentException("Could not deallocate " + hostname + ": No such node in the provisioned, failed or parked state")); - if (nodeToDirty.status().hardwareFailureDescription().isPresent()) - throw new IllegalArgumentException("Could not deallocate " + hostname + ": It has a hardware failure"); + if (nodeToDirty.status().hardwareFailureDescription().isPresent() || nodeToDirty.status().hardwareDivergence().isPresent()) + throw new IllegalArgumentException("Could not deallocate " + hostname + ": It has a hardware failure/spec divergence"); + return setDirty(nodeToDirty); } -- cgit v1.2.3 From 201b8abb18420a31b9aaad592958487a40f8e583 Mon Sep 17 00:00:00 2001 From: Andreas Eriksen Date: Thu, 26 Oct 2017 12:17:49 +0200 Subject: update expected response --- .../java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'node-repository/src') diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java index f42ba220fdf..37b2f54da4d 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java @@ -273,7 +273,7 @@ public class RestApiTest { "{\"message\":\"Moved host12.yahoo.com to failed\"}"); assertResponse(new Request("http://localhost:8080/nodes/v2/state/dirty/host12.yahoo.com", new byte[0], Request.Method.PUT), 400, - "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Could not deallocate host12.yahoo.com: It has a hardware failure\"}"); + "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Could not deallocate host12.yahoo.com: It has a hardware failure/spec divergence\"}"); } @Test -- cgit v1.2.3