Issue 381: refined logging statements

This commit is contained in:
Adrian Cole 2010-10-26 20:47:38 -07:00
parent faa57c71bb
commit 562b487b15
2 changed files with 5 additions and 4 deletions

View File

@ -63,9 +63,10 @@ public class TerremarkEncodeTagIntoNameRunNodesAndAddToSetStrategy extends Encod
Map<NodeMetadata, Exception> badNodes) {
assert template.getLocation().getParent().getScope() == LocationScope.REGION : "template location should have a parent of org, which should be mapped to region: "
+ template.getLocation();
createNewKeyPairUnlessUserSpecifiedOtherwise.execute(URI.create(template.getLocation().getParent().getId()), tag,
template.getImage().getDefaultCredentials().identity, template.getOptions().as(
TerremarkVCloudTemplateOptions.class));
String orgId = template.getLocation().getParent().getId();
assert orgId.startsWith("http") : "parent id should be a rest url: " + template.getLocation().getParent();
createNewKeyPairUnlessUserSpecifiedOtherwise.execute(URI.create(orgId), tag, template.getImage()
.getDefaultCredentials().identity, template.getOptions().as(TerremarkVCloudTemplateOptions.class));
return super.execute(tag, count, template, nodes, badNodes);
}
}

View File

@ -61,7 +61,7 @@ public class OrgURIToKeysListEndpoint implements Function<Object, URI> {
try {
return TerremarkOrg.class.cast(uriToOrg.get(from == null ? defaultOrg : from)).getKeysList().getHref();
} catch (NullPointerException e) {
throw new ResourceNotFoundException("org " + from + " not found in " + uriToOrg);
throw new ResourceNotFoundException("org " + from + " not found in: " + uriToOrg, e);
}
}