Issue 1053:add ORD to rackspace-cloudservers-us

This commit is contained in:
Adrian Cole 2012-08-01 12:40:30 -07:00
parent b478b02bbe
commit d00efae8a7
2 changed files with 13 additions and 7 deletions

View File

@ -18,6 +18,9 @@
*/
package org.jclouds.rackspace.cloudservers.us;
import static org.jclouds.location.reference.LocationConstants.ISO3166_CODES;
import static org.jclouds.location.reference.LocationConstants.PROPERTY_ZONE;
import static org.jclouds.location.reference.LocationConstants.PROPERTY_ZONES;
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
import java.net.URI;
@ -65,6 +68,9 @@ public class CloudServersUSProviderMetadata extends BaseProviderMetadata {
public static Properties defaultProperties() {
Properties properties = new Properties();
properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS);
properties.setProperty(PROPERTY_ZONES, "ORD,DFW");
properties.setProperty(PROPERTY_ZONE + ".ORD." + ISO3166_CODES, "US-IL");
properties.setProperty(PROPERTY_ZONE + ".DFW." + ISO3166_CODES, "US-TX");
return properties;
}
@ -89,7 +95,7 @@ public class CloudServersUSProviderMetadata extends BaseProviderMetadata {
.homepage(URI.create("http://www.rackspace.com/cloud/nextgen"))
.console(URI.create("https://mycloud.rackspace.com"))
.linkedServices("rackspace-cloudservers-us", "cloudfiles-swift-us")
.iso3166Codes("US-TX")
.iso3166Codes("US-IL", "US-TX")
.endpoint("https://identity.api.rackspacecloud.com/v2.0/")
.defaultProperties(CloudServersUSProviderMetadata.defaultProperties());
}

View File

@ -59,7 +59,7 @@ public class CloudServersUSTemplateBuilderLiveTest extends BaseTemplateBuilderLi
case DEBIAN:
return input.is64Bit && !input.version.equals("5.0");
case CENTOS:
return (input.version.equals("") || input.version.equals("5.0")|| input.version.equals("5.6") || input.version.equals("6.0"))
return (input.version.equals("") || input.version.equals("5.6") || input.version.equals("6.0"))
&& input.is64Bit;
case WINDOWS:
return input.is64Bit && input.version.equals("");
@ -77,17 +77,17 @@ public class CloudServersUSTemplateBuilderLiveTest extends BaseTemplateBuilderLi
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "12.04");
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(defaultTemplate.getImage().getName(), "Ubuntu 12.04 LTS");
assertEquals(defaultTemplate.getImage().getName(), "Ubuntu 12.04 LTS (Precise Pangolin)");
assertEquals(defaultTemplate.getImage().getDefaultCredentials().getUser(), "root");
assertEquals(defaultTemplate.getLocation().getId(), "DFW");
assertEquals(defaultTemplate.getImage().getLocation().getId(), "DFW");
assertEquals(defaultTemplate.getHardware().getLocation().getId(), "DFW");
assertEquals(defaultTemplate.getLocation().getId(), "ORD");
assertEquals(defaultTemplate.getImage().getLocation().getId(), "ORD");
assertEquals(defaultTemplate.getHardware().getLocation().getId(), "ORD");
assertEquals(defaultTemplate.getOptions().as(NovaTemplateOptions.class).shouldAutoAssignFloatingIp(), false);
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
}
@Override
protected Set<String> getIso3166Codes() {
return ImmutableSet.<String> of("US-TX");
return ImmutableSet.<String> of("US-IL", "US-TX");
}
}