Cleaning up changes from JCLOUDS-106

This commit is contained in:
Andrew Bayer 2013-06-24 12:09:57 -07:00
parent 95308de808
commit ccb4323986
3 changed files with 8 additions and 8 deletions

View File

@ -119,7 +119,7 @@ public class CloudStackComputeService extends BaseComputeService {
startNodeStrategy, stopNodeStrategy, templateBuilderProvider, templateOptionsProvider, nodeRunning, startNodeStrategy, stopNodeStrategy, templateBuilderProvider, templateOptionsProvider, nodeRunning,
nodeTerminated, nodeSuspended, initScriptRunnerFactory, initAdminAccess, runScriptOnNodeFactory, nodeTerminated, nodeSuspended, initScriptRunnerFactory, initAdminAccess, runScriptOnNodeFactory,
persistNodeCredentials, timeouts, userExecutor, imageExtension); persistNodeCredentials, timeouts, userExecutor, imageExtension);
this.zoneIdToZone = zoneIdToZone; this.zoneIdToZone = checkNotNull(zoneIdToZone, "zoneIdToZone");
this.client = checkNotNull(client, "client"); this.client = checkNotNull(client, "client");
this.securityGroupMap = checkNotNull(securityGroupMap, "securityGroupMap"); this.securityGroupMap = checkNotNull(securityGroupMap, "securityGroupMap");
this.keyPairCache = checkNotNull(keyPairCache, "keyPairCache"); this.keyPairCache = checkNotNull(keyPairCache, "keyPairCache");
@ -173,7 +173,7 @@ public class CloudStackComputeService extends BaseComputeService {
} }
/** /**
* returns template options, except of type {@link CloudStackTemplateOptions}. * returns template options, as {@link CloudStackTemplateOptions}.
*/ */
@Override @Override
public CloudStackTemplateOptions templateOptions() { public CloudStackTemplateOptions templateOptions() {

View File

@ -129,13 +129,10 @@ public class CloudStackComputeServiceContextModule extends
}).to(CreateUniqueKeyPair.class); }).to(CreateUniqueKeyPair.class);
bind(new TypeLiteral<Supplier<LoadingCache<String, Zone>>>() { bind(new TypeLiteral<Supplier<LoadingCache<String, Zone>>>() {
}).to(ZoneIdToZoneSupplier.class); }).to(ZoneIdToZoneSupplier.class);
bind(new TypeLiteral<Function<ZoneSecurityGroupNamePortsCidrs, SecurityGroup>>() { bind(new TypeLiteral<Function<ZoneSecurityGroupNamePortsCidrs, SecurityGroup>>() {
}).to(CreateSecurityGroupIfNeeded.class); }).to(CreateSecurityGroupIfNeeded.class);
bind(new TypeLiteral<CacheLoader<ZoneAndName, SecurityGroup>>() { bind(new TypeLiteral<CacheLoader<ZoneAndName, SecurityGroup>>() {
}).to(FindSecurityGroupOrCreate.class); }).to(FindSecurityGroupOrCreate.class);
bind(new TypeLiteral<Function<Set<? extends NodeMetadata>, Multimap<String, String>>>() { bind(new TypeLiteral<Function<Set<? extends NodeMetadata>, Multimap<String, String>>>() {
}).to(OrphanedGroupsByZoneId.class); }).to(OrphanedGroupsByZoneId.class);
@ -236,8 +233,8 @@ public class CloudStackComputeServiceContextModule extends
@Provides @Provides
@Singleton @Singleton
protected LoadingCache<String, Set<IPForwardingRule>> getIPForwardingRulesByVirtualMachine( protected LoadingCache<String, Set<IPForwardingRule>> getIPForwardingRulesByVirtualMachine(
CacheLoader<String, Set<IPForwardingRule>> getIPForwardingRules) { CacheLoader<String, Set<IPForwardingRule>> in) {
return CacheBuilder.newBuilder().build(getIPForwardingRules); return CacheBuilder.newBuilder().build(in);
} }

View File

@ -31,6 +31,7 @@ import org.jclouds.cloudstack.domain.SshKeyPair;
import org.jclouds.cloudstack.strategy.BlockUntilJobCompletesAndReturnResult; import org.jclouds.cloudstack.strategy.BlockUntilJobCompletesAndReturnResult;
import com.google.common.base.Optional; import com.google.common.base.Optional;
import com.google.common.base.Throwables;
import com.google.common.cache.CacheLoader; import com.google.common.cache.CacheLoader;
import com.google.inject.Inject; import com.google.inject.Inject;
@ -58,7 +59,9 @@ public class CreateUniqueKeyPair extends CacheLoader<String, SshKeyPair> {
keyPair = client.getSSHKeyPairClient().createSSHKeyPair(input); keyPair = client.getSSHKeyPairClient().createSSHKeyPair(input);
logger.debug(">> creating SSH key pair with name %s", input); logger.debug(">> creating SSH key pair with name %s", input);
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
logger.error(e, "<< error creating SSH key pair with name %s: ",
Throwables.getRootCause(e).getMessage());
throw Throwables.propagate(e);
} }
} }