summaryrefslogtreecommitdiffstats
path: root/node-admin
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2018-03-14 09:31:13 +0100
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2018-03-14 09:31:13 +0100
commit3f251bf0cdcadbe4d384b59917bfb147222a95cc (patch)
tree1c6f1e4eb4bf08f00bb80f2cd80b44812dee105e /node-admin
parent832692c4ba452526b2694b1424a6d4e9f335b3d1 (diff)
Replace with try-catch, and with more commentary
Diffstat (limited to 'node-admin')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java
index 336e947d7b4..f08c91ec9c0 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java
@@ -29,6 +29,7 @@ import com.yahoo.vespa.hosted.node.admin.component.Environment;
import com.yahoo.vespa.hosted.node.admin.util.PrefixLogger;
import com.yahoo.vespa.hosted.provision.Node;
+import java.io.UncheckedIOException;
import java.text.SimpleDateFormat;
import java.time.Clock;
import java.time.Duration;
@@ -688,18 +689,21 @@ public class NodeAgentImpl implements NodeAgent {
ContainerName.fromHostname(nodeSpec.hostname));
// ContainerData only works when root, which is the case only for HostAdmin so far -- config nodes are only used under HostAdmin.
+ // If this fails, however, we should fail the start-up, as the config server won't work without it. Thus, no catch here.
if (nodeSpec.nodeType.equals(NodeType.config.name())) {
logger.info("Creating files needed by config server");
new ConfigServerContainerData(environment, nodeSpec.hostname).writeTo(containerData);
}
- // ContainerData only works when root, which is the case only for HostAdmin so far -- only AWS uses HostAdmin now.
- if (environment.getRegion().startsWith("aws-")) {
+ // ContainerData only works when root, which is the case only for HostAdmin so far. Allow this to fail, since it's not critical.
+ try {
logger.info("Creating files for message of the day and the bash prompt");
new MotdContainerData(nodeSpec, environment).writeTo(containerData);
new PromptContainerData(environment).writeTo(containerData);
}
-
+ catch (UncheckedIOException e) {
+ logger.info("Failed creating files for message of the day and the bash prompt", e);
+ }
}
}