You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2014/07/14 11:04:25 UTC
git commit: Removed unnecessary whitespaces and fixed formatting
Repository: jclouds
Updated Branches:
refs/heads/1.7.x e94b878b2 -> 3b2f02b72
Removed unnecessary whitespaces and fixed formatting
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/3b2f02b7
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/3b2f02b7
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/3b2f02b7
Branch: refs/heads/1.7.x
Commit: 3b2f02b7237187295032a9c0029a4a8cea088a5d
Parents: e94b878
Author: Ignasi Barrera <na...@apache.org>
Authored: Mon Jul 14 10:53:08 2014 +0200
Committer: Ignasi Barrera <na...@apache.org>
Committed: Mon Jul 14 11:03:47 2014 +0200
----------------------------------------------------------------------
.../AllocateAndAddFloatingIpToNode.java | 24 ++++++------
.../options/NodeAndNovaTemplateOptions.java | 14 +++----
.../compute/options/NovaTemplateOptions.java | 39 ++++++++++----------
...desWithGroupEncodedIntoNameThenAddToSet.java | 6 +--
.../nova/v2_0/options/CreateServerOptions.java | 13 +++----
.../nova/v2_0/predicates/ServerPredicates.java | 12 +++---
...llocateAndAddFloatingIpToNodeExpectTest.java | 4 +-
.../nova/v2_0/internal/BaseNovaApiLiveTest.java | 5 ++-
.../predicates/ServerPredicatesMockTest.java | 23 +++++++-----
.../rest/InsufficientResourcesException.java | 4 +-
10 files changed, 74 insertions(+), 70 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3b2f02b7/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java
index e1801b9..acec9bc 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java
@@ -80,7 +80,7 @@ public class AllocateAndAddFloatingIpToNode implements
String zoneId = node.getLocation().getParent().getId();
FloatingIPApi floatingIpApi = novaApi.getFloatingIPExtensionForZone(zoneId).get();
Optional<Set<String>> poolNames = input.get().getNovaTemplateOptions().get().getFloatingIpPoolNames();
-
+
Optional<FloatingIP> ip = allocateFloatingIPForNode(floatingIpApi, poolNames, node.getId());
if (!ip.isPresent()) {
throw new InsufficientResourcesException("Failed to allocate a FloatingIP for node(" + node.getId() + ")");
@@ -95,40 +95,40 @@ public class AllocateAndAddFloatingIpToNode implements
/**
* Allocates a FloatingIP for a given Node
- *
+ *
* @param floatingIpApi FloatingIPApi to create or query for a valid FloatingIP
* @param poolNames optional set of pool names from which we will attempt to allocate an IP from. Most cases this is null
* @param nodeID optional id of the Node we are trying to allocate a FloatingIP for. Used here only for logging purposes
- * @return Optional<FloatingIP>
+ * @return Optional<FloatingIP>
*/
private Optional<FloatingIP> allocateFloatingIPForNode(FloatingIPApi floatingIpApi, Optional<Set<String>> poolNames, String nodeID) {
-
+
FloatingIP ip = null;
-
+
// 1.) Attempt to allocate from optionally passed poolNames
if (poolNames.isPresent()) {
- for (String poolName : poolNames.get()){
+ for (String poolName : poolNames.get()) {
try {
logger.debug(">> allocating floating IP from pool %s for node(%s)", poolName, nodeID);
ip = floatingIpApi.allocateFromPool(poolName);
if (ip != null)
return Optional.of(ip);
- } catch (InsufficientResourcesException ire){
+ } catch (InsufficientResourcesException ire) {
logger.trace("<< [%s] failed to allocate floating IP from pool %s for node(%s)", ire.getMessage(), poolName, nodeID);
}
}
}
-
+
// 2.) Attempt to allocate, if necessary, via 'create()' call
try {
logger.debug(">> creating floating IP for node(%s)", nodeID);
ip = floatingIpApi.create();
- if(ip != null)
+ if (ip != null)
return Optional.of(ip);
- } catch (InsufficientResourcesException ire){
+ } catch (InsufficientResourcesException ire) {
logger.trace("<< [%s] failed to create floating IP for node(%s)", ire.getMessage(), nodeID);
}
-
+
// 3.) If no IP was found make final attempt by searching through list of available IP's
logger.trace(">> searching for existing, unassigned floating IP for node(%s)", nodeID);
List<FloatingIP> unassignedIps = Lists.newArrayList(Iterables.filter(floatingIpApi.list(),
@@ -145,7 +145,7 @@ public class AllocateAndAddFloatingIpToNode implements
ip = Iterables.getLast(unassignedIps);
return Optional.fromNullable(ip);
}
-
+
@Override
public String toString() {
return Objects.toStringHelper("AllocateAndAddFloatingIpToNode").toString();
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3b2f02b7/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NodeAndNovaTemplateOptions.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NodeAndNovaTemplateOptions.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NodeAndNovaTemplateOptions.java
index d95e817..b971cfc 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NodeAndNovaTemplateOptions.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NodeAndNovaTemplateOptions.java
@@ -23,15 +23,15 @@ import org.jclouds.compute.domain.NodeMetadata;
import com.google.common.util.concurrent.Atomics;
/**
- * Simple data-structure for holding a NodeMetadata object along with a
+ * Simple data-structure for holding a NodeMetadata object along with a
* corresponding NovaTemplateOptions object.
*/
public class NodeAndNovaTemplateOptions {
private final AtomicReference<NodeMetadata> nodeMetadata;
private final AtomicReference<NovaTemplateOptions> novaTemplateOptions;
-
- protected NodeAndNovaTemplateOptions(AtomicReference<NodeMetadata> nodeMetadata, AtomicReference<NovaTemplateOptions> novaTemplateOptions){
+
+ protected NodeAndNovaTemplateOptions(AtomicReference<NodeMetadata> nodeMetadata, AtomicReference<NovaTemplateOptions> novaTemplateOptions) {
this.nodeMetadata = nodeMetadata;
this.novaTemplateOptions = novaTemplateOptions;
}
@@ -43,12 +43,12 @@ public class NodeAndNovaTemplateOptions {
public AtomicReference<NovaTemplateOptions> getNovaTemplateOptions() {
return novaTemplateOptions;
}
-
- public static NodeAndNovaTemplateOptions newReference(AtomicReference<NodeMetadata> node, AtomicReference<NovaTemplateOptions> options){
+
+ public static NodeAndNovaTemplateOptions newReference(AtomicReference<NodeMetadata> node, AtomicReference<NovaTemplateOptions> options) {
return new NodeAndNovaTemplateOptions(node, options);
}
-
- public static AtomicReference<NodeAndNovaTemplateOptions> newAtomicReference(AtomicReference<NodeMetadata> node, AtomicReference<NovaTemplateOptions> options){
+
+ public static AtomicReference<NodeAndNovaTemplateOptions> newAtomicReference(AtomicReference<NodeMetadata> node, AtomicReference<NovaTemplateOptions> options) {
return Atomics.newReference(NodeAndNovaTemplateOptions.newReference(node, options));
}
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3b2f02b7/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.java
index 4e6ce2e..2f15f66 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.java
@@ -28,7 +28,6 @@ import java.util.Set;
import org.jclouds.compute.options.TemplateOptions;
import org.jclouds.domain.LoginCredentials;
import org.jclouds.openstack.nova.v2_0.domain.Network;
-import org.jclouds.openstack.nova.v2_0.options.CreateServerOptions;
import org.jclouds.scriptbuilder.domain.Statement;
import com.google.common.base.Objects;
@@ -145,7 +144,7 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
this.autoAssignFloatingIp = enable;
return this;
}
-
+
/**
* @see #getFloatingIpPoolNames()
*/
@@ -200,7 +199,7 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
/**
* <h3>Note</h3>
*
- * This requires that {@link NovaApi#getExtensionForZone(String)} to return
+ * This requires that {@link org.jclouds.openstack.nova.v2_0.NovaApi#getExtensionForZone(String)} to return
* {@link Optional#isPresent present}
*
* @return true if auto assignment of a floating ip to each vm is enabled
@@ -211,16 +210,16 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
/**
* The floating IP pool name(s) to use when allocating a FloatingIP. Applicable
- * only if #shouldAutoAssignFloatingIp() returns true. If not set will attempt to
- * use whatever FloatingIP(s) can be found regardless of which pool they originated
+ * only if #shouldAutoAssignFloatingIp() returns true. If not set will attempt to
+ * use whatever FloatingIP(s) can be found regardless of which pool they originated
* from
- *
+ *
* @return floating-ip-pool names to use
*/
public Optional<Set<String>> getFloatingIpPoolNames() {
return floatingIpPoolNames;
- }
-
+ }
+
/**
* Specifies the keypair used to run instances with
* @return the keypair to be used
@@ -228,11 +227,11 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
public String getKeyPairName() {
return keyPairName;
}
-
+
/**
* <h3>Note</h3>
*
- * This requires that {@link NovaApi#getKeyPairExtensionForZone(String)} to return
+ * This requires that {@link org.jclouds.openstack.nova.v2_0.NovaApi#getKeyPairExtensionForZone(String)} to return
* {@link Optional#isPresent present}
*
* @return true if auto generation of keypairs is enabled
@@ -256,21 +255,21 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
}
/**
- * @see CreateServerOptions#getDiskConfig()
+ * @see org.jclouds.openstack.nova.v2_0.options.CreateServerOptions#getDiskConfig()
*/
public String getDiskConfig() {
return diskConfig;
}
/**
- * @see CreateServerOptions#getConfigDrive()
+ * @see org.jclouds.openstack.nova.v2_0.options.CreateServerOptions#getConfigDrive()
*/
public boolean getConfigDrive() {
return configDrive;
}
/**
- * @see CreateServerOptions#getNetworks()
+ * @see org.jclouds.openstack.nova.v2_0.options.CreateServerOptions#getNetworks()
*/
public Set<Network> getNovaNetworks() {
return novaNetworks;
@@ -298,11 +297,11 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
*/
public NovaTemplateOptions floatingIpPoolNames(Iterable<String> floatingIpPoolNames) {
NovaTemplateOptions options = new NovaTemplateOptions();
- return NovaTemplateOptions.class.cast(options.floatingIpPoolNames(floatingIpPoolNames));
- }
-
+ return NovaTemplateOptions.class.cast(options.floatingIpPoolNames(floatingIpPoolNames));
+ }
+
/**
- * @see NovaTemplateOptions#shouldGenerateKeyPair()
+ * @see NovaTemplateOptions#shouldGenerateKeyPair()
*/
public static NovaTemplateOptions generateKeyPair(boolean enable) {
return new NovaTemplateOptions().generateKeyPair(enable);
@@ -638,7 +637,7 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
}
/**
- * @see CreateServerOptions#getDiskConfig()
+ * @see org.jclouds.openstack.nova.v2_0.options.CreateServerOptions#getDiskConfig()
*/
public NovaTemplateOptions diskConfig(String diskConfig) {
this.diskConfig = diskConfig;
@@ -651,7 +650,7 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
* normally be available through the metadata service by mounting this disk and reading files from it.
* To enable the config drive, set this parameter to "true".
* This has to be enabled for user data cases.
- * @see CreateServerOptions#getConfigDrive()
+ * @see org.jclouds.openstack.nova.v2_0.options.CreateServerOptions#getConfigDrive()
*/
public NovaTemplateOptions configDrive(boolean configDrive) {
this.configDrive = configDrive;
@@ -662,7 +661,7 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
* @param novaNetworks The list of network declarations.
* Nova-specific network declarations allow for specifying network UUIDs, port UUIDs, and fixed IPs.
* Unline {@link #networks(Iterable)} this supports setting additional network parameters and not just network UUIDs.
- * @see CreateServerOptions#getNetworks()
+ * @see org.jclouds.openstack.nova.v2_0.options.CreateServerOptions#getNetworks()
*/
public NovaTemplateOptions novaNetworks(Set<Network> novaNetworks) {
this.novaNetworks = novaNetworks;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3b2f02b7/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/strategy/ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/strategy/ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/strategy/ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet.java
index 2ba160c..616119d 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/strategy/ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/strategy/ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet.java
@@ -158,9 +158,9 @@ public class ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddT
ListenableFuture<AtomicReference<NodeMetadata>> future = super.createNodeInGroupWithNameAndTemplate(group, name, template);
final NovaTemplateOptions templateOptions = NovaTemplateOptions.class.cast(template.getOptions());
if (templateOptions.shouldAutoAssignFloatingIp()) {
-
- ListenableFuture<AtomicReference<NodeAndNovaTemplateOptions>> nodeAndNovaTemplateOptions = Futures.transform(future,
- new Function<AtomicReference<NodeMetadata>, AtomicReference<NodeAndNovaTemplateOptions>>(){
+
+ ListenableFuture<AtomicReference<NodeAndNovaTemplateOptions>> nodeAndNovaTemplateOptions = Futures.transform(future,
+ new Function<AtomicReference<NodeMetadata>, AtomicReference<NodeAndNovaTemplateOptions>>() {
@Override
public AtomicReference<NodeAndNovaTemplateOptions> apply(AtomicReference<NodeMetadata> input) {
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3b2f02b7/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java
index 05cbd8a..2fe33fa 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java
@@ -33,15 +33,12 @@ import javax.inject.Inject;
import javax.inject.Named;
import org.jclouds.http.HttpRequest;
-import org.jclouds.openstack.nova.v2_0.NovaApi;
import org.jclouds.openstack.nova.v2_0.domain.Network;
-import org.jclouds.openstack.nova.v2_0.domain.Server;
import org.jclouds.rest.MapBinder;
import org.jclouds.rest.binders.BindToJsonPayload;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.base.Optional;
import com.google.common.collect.ForwardingObject;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
@@ -208,7 +205,7 @@ public class CreateServerOptions implements MapBinder {
server.availabilityZone = availabilityZone;
if (userData != null)
server.user_data = base64().encode(userData);
- if (configDrive == true)
+ if (configDrive)
server.configDrive = "true";
if (securityGroupNames.size() > 0) {
server.securityGroupNames = Sets.newLinkedHashSet();
@@ -367,8 +364,8 @@ public class CreateServerOptions implements MapBinder {
* <p/>
* <h3>Note</h3>
* <p/>
- * This requires that {@link NovaApi#getSecurityGroupExtensionForZone(String)} to return
- * {@link Optional#isPresent present}
+ * This requires that {@link org.jclouds.openstack.nova.v2_0.NovaApi#getSecurityGroupExtensionForZone(String)} to return
+ * {@link com.google.common.base.Optional#isPresent present}
*/
public Set<String> getSecurityGroupNames() {
return securityGroupNames;
@@ -413,9 +410,9 @@ public class CreateServerOptions implements MapBinder {
/**
* When you create a server from an image with the diskConfig value set to
- * {@link Server#DISK_CONFIG_AUTO}, the server is built with a single partition that is expanded to
+ * {@link org.jclouds.openstack.nova.v2_0.domain.Server#DISK_CONFIG_AUTO}, the server is built with a single partition that is expanded to
* the disk size of the flavor selected. When you set the diskConfig attribute to
- * {@link Server#DISK_CONFIG_MANUAL}, the server is built by using the partition scheme and file
+ * {@link org.jclouds.openstack.nova.v2_0.domain.Server#DISK_CONFIG_MANUAL}, the server is built by using the partition scheme and file
* system that is in the source image.
* <p/>
* If the target flavor disk is larger, remaining disk space is left unpartitioned. A server inherits the diskConfig
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3b2f02b7/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/ServerPredicates.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/ServerPredicates.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/ServerPredicates.java
index 47812eb..e955368 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/ServerPredicates.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/ServerPredicates.java
@@ -16,18 +16,18 @@
*/
package org.jclouds.openstack.nova.v2_0.predicates;
-import com.google.common.base.Predicate;
-import org.jclouds.openstack.nova.v2_0.domain.Server;
-import org.jclouds.openstack.nova.v2_0.domain.ServerCreated;
-import org.jclouds.openstack.nova.v2_0.features.ServerApi;
-
import static com.google.common.base.Preconditions.checkNotNull;
import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.jclouds.openstack.nova.v2_0.domain.Server.Status;
import static org.jclouds.openstack.nova.v2_0.domain.Server.Status.ACTIVE;
import static org.jclouds.openstack.nova.v2_0.domain.Server.Status.SHUTOFF;
import static org.jclouds.util.Predicates2.retry;
+import org.jclouds.openstack.nova.v2_0.domain.Server;
+import org.jclouds.openstack.nova.v2_0.domain.Server.Status;
+import org.jclouds.openstack.nova.v2_0.features.ServerApi;
+
+import com.google.common.base.Predicate;
+
/**
* This class tests to see if a Server or ServerCreated has reached a desired status. This class is most useful when
* paired with a RetryablePredicate as in the code below. Together these classes can be used to block execution until
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3b2f02b7/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNodeExpectTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNodeExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNodeExpectTest.java
index 8edf4a5..8c7dae9 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNodeExpectTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNodeExpectTest.java
@@ -58,7 +58,7 @@ public class AllocateAndAddFloatingIpToNodeExpectTest extends BaseNovaComputeSer
host).name("Server 71592").status(Status.RUNNING).privateAddresses(ImmutableSet.of("10.4.27.237"))
.credentials(LoginCredentials.builder().password("foo").build()).build();
final NovaTemplateOptions options = NovaTemplateOptions.Builder.autoAssignFloatingIp(false);
-
+
HttpRequest createFloatingIP = HttpRequest.builder().method("POST").endpoint(
URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-floating-ips")).headers(
ImmutableMultimap.<String, String> builder().put("Accept", "application/json").put("X-Auth-Token",
@@ -140,7 +140,7 @@ public class AllocateAndAddFloatingIpToNodeExpectTest extends BaseNovaComputeSer
assertNotNull(optionsRef.get());
assertEquals(node1.getPublicAddresses(), ImmutableSet.of("10.0.0.5"));
}
-
+
public void testAllocateWhenAllocationFailsOn404LookupUnusedIpAddToServerAndUpdatesNodeMetadata() throws Exception {
HttpResponse createFloatingIPResponse = HttpResponse
.builder()
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3b2f02b7/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaApiLiveTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaApiLiveTest.java
index 78f5ff3..631b5f2 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaApiLiveTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaApiLiveTest.java
@@ -19,7 +19,6 @@ package org.jclouds.openstack.nova.v2_0.internal;
import java.util.Properties;
import java.util.Set;
-import com.google.common.collect.*;
import org.jclouds.apis.BaseApiLiveTest;
import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
import org.jclouds.openstack.nova.v2_0.NovaApi;
@@ -37,6 +36,10 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.google.common.base.Throwables;
+import com.google.common.collect.ComparisonChain;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Ordering;
/**
* Tests behavior of {@code NovaApi}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3b2f02b7/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/ServerPredicatesMockTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/ServerPredicatesMockTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/ServerPredicatesMockTest.java
index a8479ab..4203c75 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/ServerPredicatesMockTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/predicates/ServerPredicatesMockTest.java
@@ -16,17 +16,22 @@
*/
package org.jclouds.openstack.nova.v2_0.predicates;
-import com.squareup.okhttp.mockwebserver.MockResponse;
-import com.squareup.okhttp.mockwebserver.MockWebServer;
+import static org.jclouds.openstack.nova.v2_0.domain.Server.Status.ACTIVE;
+import static org.jclouds.openstack.nova.v2_0.domain.Server.Status.SHUTOFF;
+import static org.jclouds.openstack.nova.v2_0.predicates.ServerPredicates.awaitActive;
+import static org.jclouds.openstack.nova.v2_0.predicates.ServerPredicates.awaitShutoff;
+import static org.jclouds.openstack.nova.v2_0.predicates.ServerPredicates.awaitStatus;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
import org.jclouds.openstack.nova.v2_0.NovaApi;
import org.jclouds.openstack.nova.v2_0.features.ServerApi;
import org.jclouds.openstack.v2_0.internal.BaseOpenStackMockTest;
import org.testng.annotations.Test;
-import static org.jclouds.openstack.nova.v2_0.domain.Server.Status.ACTIVE;
-import static org.jclouds.openstack.nova.v2_0.domain.Server.Status.SHUTOFF;
-import static org.jclouds.openstack.nova.v2_0.predicates.ServerPredicates.*;
-import static org.testng.Assert.*;
+import com.squareup.okhttp.mockwebserver.MockResponse;
+import com.squareup.okhttp.mockwebserver.MockWebServer;
@Test(groups = "unit", testName = "ServerPredicatesMockTest")
public class ServerPredicatesMockTest extends BaseOpenStackMockTest<NovaApi> {
@@ -41,7 +46,7 @@ public class ServerPredicatesMockTest extends BaseOpenStackMockTest<NovaApi> {
try {
NovaApi novaApi = api(server.getUrl("/").toString(), "openstack-nova");
- ServerApi serverApi = novaApi.getServerApiForZone(("RegionOne"));
+ ServerApi serverApi = novaApi.getServerApiForZone("RegionOne");
boolean result = awaitActive(serverApi).apply("71752");
@@ -66,7 +71,7 @@ public class ServerPredicatesMockTest extends BaseOpenStackMockTest<NovaApi> {
try {
NovaApi novaApi = api(server.getUrl("/").toString(), "openstack-nova");
- ServerApi serverApi = novaApi.getServerApiForZone(("RegionOne"));
+ ServerApi serverApi = novaApi.getServerApiForZone("RegionOne");
boolean result = awaitShutoff(serverApi).apply("71752");
@@ -88,7 +93,7 @@ public class ServerPredicatesMockTest extends BaseOpenStackMockTest<NovaApi> {
try {
NovaApi novaApi = api(server.getUrl("/").toString(), "openstack-nova");
- ServerApi serverApi = novaApi.getServerApiForZone(("RegionOne"));
+ ServerApi serverApi = novaApi.getServerApiForZone("RegionOne");
boolean result = awaitStatus(serverApi, ACTIVE, 3, 1).apply("71752");
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3b2f02b7/core/src/main/java/org/jclouds/rest/InsufficientResourcesException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/rest/InsufficientResourcesException.java b/core/src/main/java/org/jclouds/rest/InsufficientResourcesException.java
index 15db2b4..19b0b81 100644
--- a/core/src/main/java/org/jclouds/rest/InsufficientResourcesException.java
+++ b/core/src/main/java/org/jclouds/rest/InsufficientResourcesException.java
@@ -28,11 +28,11 @@ public class InsufficientResourcesException extends RuntimeException {
public InsufficientResourcesException() {
super();
}
-
+
public InsufficientResourcesException(String arg0) {
super(arg0);
}
-
+
public InsufficientResourcesException(String arg0, Throwable arg1) {
super(arg0, arg1);
}