@Override public boolean shouldBlockUntilRunning() { return delegate.shouldBlockUntilRunning(); }
@Override public boolean shouldBlockUntilRunning() { return delegate.shouldBlockUntilRunning(); }
@Override public boolean shouldBlockUntilRunning() { return delegate.shouldBlockUntilRunning(); }
@Override public boolean shouldBlockUntilRunning() { return delegate.shouldBlockUntilRunning(); }
@Test public void testblockUntilRunningStatic() { TemplateOptions options = blockUntilRunning(false); assertEquals(options.shouldBlockUntilRunning(), false); }
@Test public void testblockUntilRunningStatic() { TemplateOptions options = blockUntilRunning(false); assertEquals(options.shouldBlockUntilRunning(), false); } }
@Override public Void call() { checkState(!tainted, "this object is not designed to be reused: %s", toString()); tainted = true; String originalId = node.get().getId(); try { if (options.shouldBlockUntilRunning()) { pollNodeRunning.apply(node); if (statement != null) { RunScriptOnNode runner = initScriptRunnerFactory.create(node.get(), statement, options, badNodes).call(); if (runner != null) { ExecResponse exec = runner.call(); customizationResponses.put(node.get(), exec); } } if (options.getPort() > 0) { openSocketFinder.findOpenSocketOnNode(node.get(), options.getPort(), options.getSeconds(), TimeUnit.SECONDS); } } logger.debug("<< customized node(%s)", originalId); goodNodes.add(node.get()); } catch (Exception e) { logger.error(e, "<< problem customizing node(%s): ", originalId, getRootCause(e).getMessage()); badNodes.put(node.get(), e); } return null; }
@Override public Void call() { checkState(!tainted, "this object is not designed to be reused: %s", toString()); tainted = true; String originalId = node.get().getId(); try { if (options.shouldBlockUntilRunning()) { pollNodeRunning.apply(node); if (statement != null) { RunScriptOnNode runner = initScriptRunnerFactory.create(node.get(), statement, options, badNodes).call(); if (runner != null) { ExecResponse exec = runner.call(); customizationResponses.put(node.get(), exec); } } if (options.getPort() > 0) { openSocketFinder.findOpenSocketOnNode(node.get(), options.getPort(), options.getSeconds(), TimeUnit.SECONDS); } } logger.debug("<< customized node(%s)", originalId); goodNodes.add(node.get()); } catch (Exception e) { logger.error(e, "<< problem customizing node(%s): ", originalId, getRootCause(e).getMessage()); badNodes.put(node.get(), e); } return null; }
@Override public Void call() { checkState(!tainted, "this object is not designed to be reused: %s", toString()); tainted = true; String originalId = node.get().getId(); try { if (options.shouldBlockUntilRunning()) { pollNodeRunning.apply(node); Statement statement = nodeAndTemplateOptionsToStatement.apply(node.get(), options); if (statement != null) { RunScriptOnNode runner = initScriptRunnerFactory.create(node.get(), statement, options, badNodes).call(); if (runner != null) { ExecResponse exec = runner.call(); customizationResponses.put(node.get(), exec); } } if (options.getPort() > 0) { openSocketFinder.findOpenSocketOnNode(node.get(), options.getPort(), options.getSeconds(), TimeUnit.SECONDS); } } logger.debug("<< customized node(%s)", originalId); goodNodes.add(node.get()); } catch (Exception e) { logger.error(e, "<< problem customizing node(%s): ", originalId, getRootCause(e).getMessage()); badNodes.put(node.get(), e); } return null; }
@Test public void testblockUntilRunningDefault() { TemplateOptions options = new TemplateOptions(); assertEquals(options.toString(), "{}"); assertEquals(options.shouldBlockUntilRunning(), true); }
@Test public void testblockUntilRunningDefault() { TemplateOptions options = new TemplateOptions(); assertEquals(options.toString(), "{}"); assertEquals(options.shouldBlockUntilRunning(), true); }
@Test public void testblockUntilRunning() { TemplateOptions options = new TemplateOptions(); options.blockUntilRunning(false); assertEquals(options.toString(), "{blockUntilRunning=false}"); assertEquals(options.shouldBlockUntilRunning(), false); }
@Override public InstantiateVAppTemplateOptions apply(Template from) { InstantiateVAppTemplateOptions options = processorCount(Double.valueOf(getCores(from.getHardware())).intValue()) .memory(from.getHardware().getRam()); if (!from.getOptions().shouldBlockUntilRunning()) options.block(false); String sshKeyFingerprint = TerremarkVCloudTemplateOptions.class.cast(from.getOptions()).getSshKeyFingerprint(); if (sshKeyFingerprint != null) options.sshKeyFingerprint(sshKeyFingerprint); return options; } }
@Test public void testblockUntilRunning() { TemplateOptions options = new TemplateOptions(); options.blockUntilRunning(false); assertEquals(options.toString(), "{blockUntilRunning=false}"); assertEquals(options.shouldBlockUntilRunning(), false); }
@Test public void testBlockUntilRunningUnsetsBlockOnPort() { TemplateOptions options = new TemplateOptions(); options.blockOnPort(22, 30); options.blockUntilRunning(false); assertEquals(options.shouldBlockUntilRunning(), false); assertEquals(options.getPort(), -1); assertEquals(options.getSeconds(), -1); }
@Test public void testBlockUntilRunningUnsetsBlockOnPort() { TemplateOptions options = new TemplateOptions(); options.blockOnPort(22, 30); options.blockUntilRunning(false); assertEquals(options.shouldBlockUntilRunning(), false); assertEquals(options.getPort(), -1); assertEquals(options.getSeconds(), -1); }
@Override public NodeMetadata addNodeWithTag(String tag, String name, Template template) { InstantiateVAppTemplateOptions options = processorCount((int) getCores(template.getHardware())).memory( template.getHardware().getRam()).disk( (long) ((template.getHardware().getVolumes().get(0).getSize()) * 1024 * 1024l)); if (!template.getOptions().shouldBlockUntilRunning()) options.block(false); VCloudExpressVApp vApp = computeClient.start(URI.create(template.getLocation().getId()), URI.create(template.getImage().getId()), name, options, template.getOptions().getInboundPorts()); return vAppToNodeMetadata.apply(vApp); }
public void copyTo(TemplateOptions to) { super.copyTo(to); if (!Arrays.equals(to.getInboundPorts(), this.getInboundPorts())) to.inboundPorts(this.getInboundPorts()); if (this.getRunScript() != null) to.runScript(this.getRunScript()); if (!this.getGroups().isEmpty()) to.securityGroups(this.getGroups()); if (this.getPrivateKey() != null) to.installPrivateKey(this.getPrivateKey()); if (this.getPublicKey() != null) to.authorizePublicKey(this.getPublicKey()); if (!this.getUserMetadata().isEmpty()) to.userMetadata(this.getUserMetadata()); if (!this.getTags().isEmpty()) to.tags(getTags()); if (!this.getNodeNames().isEmpty()) to.nodeNames(getNodeNames()); if (!this.shouldBlockUntilRunning()) to.blockUntilRunning(false); if (!this.getNetworks().isEmpty()) to.networks(this.getNetworks()); }
public void copyTo(TemplateOptions to) { super.copyTo(to); if (!Arrays.equals(to.getInboundPorts(), this.getInboundPorts())) to.inboundPorts(this.getInboundPorts()); if (this.getRunScript() != null) to.runScript(this.getRunScript()); if (!this.getGroups().isEmpty()) to.securityGroups(this.getGroups()); if (this.getPrivateKey() != null) to.installPrivateKey(this.getPrivateKey()); if (this.getPublicKey() != null) to.authorizePublicKey(this.getPublicKey()); if (!this.getUserMetadata().isEmpty()) to.userMetadata(this.getUserMetadata()); if (!this.getTags().isEmpty()) to.tags(getTags()); if (!this.getNodeNames().isEmpty()) to.nodeNames(getNodeNames()); if (!this.shouldBlockUntilRunning()) to.blockUntilRunning(false); if (!this.getNetworks().isEmpty()) to.networks(this.getNetworks()); }
public void copyTo(TemplateOptions to) { if (!Arrays.equals(to.getInboundPorts(), this.getInboundPorts())) to.inboundPorts(this.getInboundPorts()); if (this.getRunScript() != null) to.runScript(this.getRunScript()); if (this.getPrivateKey() != null) to.installPrivateKey(this.getPrivateKey()); if (this.getPublicKey() != null) to.authorizePublicKey(this.getPublicKey()); if (this.getPort() != -1) to.blockOnPort(this.getPort(), this.getSeconds()); if (this.getUserMetadata().size() > 0) to.userMetadata(this.getUserMetadata()); if (this.getTags().size() > 0) to.tags(getTags()); if (!this.shouldBlockUntilRunning()) to.blockUntilRunning(false); if (!this.shouldBlockOnComplete()) to.blockOnComplete(false); if (this.getLoginUser() != null) to.overrideLoginUser(this.getLoginUser()); if (this.getLoginPassword() != null) to.overrideLoginPassword(this.getLoginPassword()); if (this.getLoginPrivateKey() != null) to.overrideLoginPrivateKey(this.getLoginPrivateKey()); if (this.shouldAuthenticateSudo() != null) to.overrideAuthenticateSudo(this.shouldAuthenticateSudo()); if (this.getTaskName() != null) to.nameTask(this.getTaskName()); }