I've just tested the following code with 1.7.3 (with DigitalOcean, but
the provider is not relevant):
Properties overrides = new Properties();
overrides.setProperty(SOCKET_FINDER_ALLOWED_INTERFACES, "PRIVATE");
ComputeServiceContext context = ContextBuilder.newBuilder("digitalocean")
.credentials("foo", "bar")
.modules(ImmutableSet.of(new SshjSshClientModule()))
.overrides(overrides)
.buildView(ComputeServiceContext.class);
ComputeService compute = context.getComputeService();
TemplateOptions options = compute.templateOptions().runScript("uptime");
NodeMetadata node =
getOnlyElement(compute.createNodesInGroup("access", 1, options));
And it properly worked: DigittalOcean by default only provides a
public IP, and the code failed to run the script saying:
1) IllegalStateException on node 1769496:
java.lang.IllegalStateException: node does not have IP addresses
configured: <node info>
at com.google.common.base.Preconditions.checkState(Preconditions.java:177)
at
org.jclouds.compute.util.ConcurrentOpenSocketFinder.checkNodeHasIps(ConcurrentOpenSocketFinder.java:191)
...
Which is the expected behavior. With that configuration, only private
addresses are configured, so the feature works as expected.
Could you share your code in a Gist or Pastie so we can see if there
is something wrong?
On 2 June 2014 21:05, Andrew Phillips <[email protected]> wrote:
>> If it is (which it seems to be), I'm good to go.
>
>
> I'm also guessing a bit here (we'll see what the experts have to say ;-)),
> but as far as I am aware, Guice is the one providing the string-to-enum
> conversion as part of it's out-of-the-box binding support [2].
>
>
> [1] https://code.google.com/p/google-guice/
> [2]
> http://google-guice.googlecode.com/svn/trunk/javadoc/com/google/inject/Binder.html,
> search for "all enums"