Merge pull request #1014 from ahgittin/fix/cloudstack-niggles

fix cloudstack network NPE, and 2 logging cleanups
This commit is contained in:
Adrian Cole 2012-12-01 11:12:17 -08:00
commit 39bf8f9897
3 changed files with 3 additions and 7 deletions

View File

@ -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);

View File

@ -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

View File

@ -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<User> {
users));
}
if (currentUser.getAccountType() != Account.Type.USER) {
logger.warn("Expecting an user account: %s", currentUser);
}
return currentUser;
}
}