hardened compute adapter

This commit is contained in:
Adrian Cole 2011-12-21 23:57:14 -08:00
parent 548068c7ff
commit 618dc907a1
1 changed files with 3 additions and 2 deletions

View File

@ -159,7 +159,8 @@ public class AdaptingComputeServiceStrategies<N, H, I, L> implements CreateNodeW
public NodeMetadata createNodeWithGroupEncodedIntoName(String group, String name, Template template) { public NodeMetadata createNodeWithGroupEncodedIntoName(String group, String name, Template template) {
checkState(group != null, "group (that which groups identical nodes together) must be specified"); checkState(group != null, "group (that which groups identical nodes together) must be specified");
checkState(name != null && name.indexOf(group) != -1, "name should have %s encoded into it", group); checkState(name != null && name.indexOf(group) != -1, "name should have %s encoded into it", group);
checkState(template != null, "template must be specified"); checkState(template != null, "template was null");
checkState(template.getOptions() != null, "template options was null");
NodeAndInitialCredentials<N> from = client.createNodeWithGroupEncodedIntoName(group, name, template); NodeAndInitialCredentials<N> from = client.createNodeWithGroupEncodedIntoName(group, name, template);
LoginCredentials fromNode = from.getCredentials(); LoginCredentials fromNode = from.getCredentials();