aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Aune <kkraune@users.noreply.github.com>2022-09-27 08:23:55 +0200
committerGitHub <noreply@github.com>2022-09-27 08:23:55 +0200
commit1e1d12333ee48b2426ce336265c962de493a39a0 (patch)
tree0503377e80ede6c4aa888e5ae010098cae2cda5b
parent373eac0314d2c916c6203d49474cf5adaa775b1c (diff)
parent39105823319ff9c5ddbd553bed5348e80da3312b (diff)
Merge pull request #24228 from vespa-engine/bratseth/shorter-error
Bratseth/shorter error
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Nodes.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Nodes.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Nodes.java
index 41a23ac21ff..d641f59eafb 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Nodes.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Nodes.java
@@ -132,9 +132,7 @@ public class Nodes {
illegal("Cannot add " + node + ": Child nodes need to be allocated");
Optional<Node> existing = node(node.hostname());
if (existing.isPresent())
- illegal("Cannot add " + node + ": A node with this name already exists (" +
- existing.get() + ", " + existing.get().history() + "). Node to be added: " +
- node + ", " + node.history());
+ illegal("Cannot add " + node + ": A node with this name already exists");
}
return db.addNodesInState(nodes.asList(), Node.State.reserved, Agent.system);
}
@@ -291,16 +289,13 @@ public class Nodes {
List<Node> nodesToDirty =
(nodeToDirty.type().isHost() ?
Stream.concat(list().childrenOf(hostname).asList().stream(), Stream.of(nodeToDirty)) :
- Stream.of(nodeToDirty))
- .filter(node -> node.state() != Node.State.dirty)
- .collect(Collectors.toList());
+ Stream.of(nodeToDirty)).filter(node -> node.state() != Node.State.dirty).toList();
List<String> hostnamesNotAllowedToDirty = nodesToDirty.stream()
.filter(node -> node.state() != Node.State.provisioned)
.filter(node -> node.state() != Node.State.failed)
.filter(node -> node.state() != Node.State.parked)
.filter(node -> node.state() != Node.State.breakfixed)
- .map(Node::hostname)
- .collect(Collectors.toList());
+ .map(Node::hostname).toList();
if ( ! hostnamesNotAllowedToDirty.isEmpty())
illegal("Could not deallocate " + nodeToDirty + ": " +
hostnamesNotAllowedToDirty + " are not in states [provisioned, failed, parked, breakfixed]");