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) { 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: " assert template.getLocation().getParent().getScope() == LocationScope.REGION : "template location should have a parent of org, which should be mapped to region: "
+ template.getLocation(); + template.getLocation();
createNewKeyPairUnlessUserSpecifiedOtherwise.execute(URI.create(template.getLocation().getParent().getId()), tag, String orgId = template.getLocation().getParent().getId();
template.getImage().getDefaultCredentials().identity, template.getOptions().as( assert orgId.startsWith("http") : "parent id should be a rest url: " + template.getLocation().getParent();
TerremarkVCloudTemplateOptions.class)); createNewKeyPairUnlessUserSpecifiedOtherwise.execute(URI.create(orgId), tag, template.getImage()
.getDefaultCredentials().identity, template.getOptions().as(TerremarkVCloudTemplateOptions.class));
return super.execute(tag, count, template, nodes, badNodes); return super.execute(tag, count, template, nodes, badNodes);
} }
} }

View File

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