From 95b220f26f1658b23aeecd771a0826821b4966c4 Mon Sep 17 00:00:00 2001 From: Alex Heneveld Date: Fri, 30 Nov 2012 15:55:51 -0800 Subject: [PATCH 1/3] the associatedNetwork is @Nullable so guard against (a fatal) NPE --- .../cloudstack/predicates/PublicIPAddressPredicates.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/predicates/PublicIPAddressPredicates.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/predicates/PublicIPAddressPredicates.java index e8f082fbde..462061811c 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/predicates/PublicIPAddressPredicates.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/predicates/PublicIPAddressPredicates.java @@ -35,12 +35,12 @@ public class PublicIPAddressPredicates { private final String networkId; public AssociatedWithNetwork(String networkId) { - this.networkId = networkId; + this.networkId = checkNotNull(networkId, "networkId"); } @Override public boolean apply(PublicIPAddress input) { - return checkNotNull(input, "ipaddress").getAssociatedNetworkId().equals(networkId); + return networkId.equals(checkNotNull(input, "ipaddress").getAssociatedNetworkId()); } @Override From 29cd4efab3e5a43175cd7b0f5f9b3db07b7a6f4e Mon Sep 17 00:00:00 2001 From: Alex Heneveld Date: Fri, 30 Nov 2012 15:57:49 -0800 Subject: [PATCH 2/3] no warning needed if it's admin or domain_admin rather than normal user --- .../java/org/jclouds/cloudstack/suppliers/GetCurrentUser.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/suppliers/GetCurrentUser.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/suppliers/GetCurrentUser.java index fa564fc422..7c0ef86c22 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/suppliers/GetCurrentUser.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/suppliers/GetCurrentUser.java @@ -26,7 +26,6 @@ import javax.annotation.Resource; import javax.inject.Inject; import org.jclouds.cloudstack.CloudStackClient; -import org.jclouds.cloudstack.domain.Account; import org.jclouds.cloudstack.domain.User; import org.jclouds.cloudstack.predicates.UserPredicates; import org.jclouds.logging.Logger; @@ -66,9 +65,6 @@ public class GetCurrentUser implements Supplier { users)); } - if (currentUser.getAccountType() != Account.Type.USER) { - logger.warn("Expecting an user account: %s", currentUser); - } return currentUser; } } From b7b3a4c33366c2465f073854c9bd9f4c24796877 Mon Sep 17 00:00:00 2001 From: Alex Heneveld Date: Fri, 30 Nov 2012 15:58:35 -0800 Subject: [PATCH 3/3] log debug info at debug, not info --- .../compute/strategy/CloudStackComputeServiceAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/CloudStackComputeServiceAdapter.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/CloudStackComputeServiceAdapter.java index 93de9d7742..0dab654e2c 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/CloudStackComputeServiceAdapter.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/CloudStackComputeServiceAdapter.java @@ -175,7 +175,7 @@ public class CloudStackComputeServiceAdapter implements String templateId = template.getImage().getId(); String serviceOfferingId = template.getHardware().getId(); - logger.info("serviceOfferingId %s, templateId %s, zoneId %s, options %s%n", serviceOfferingId, templateId, + logger.debug("serviceOfferingId %s, templateId %s, zoneId %s, options %s%n", serviceOfferingId, templateId, zoneId, options); AsyncCreateResponse job = client.getVirtualMachineClient().deployVirtualMachineInZone(zoneId, serviceOfferingId, templateId, options);