Issue 645: updated image list for go2cloud

This commit is contained in:
Adrian Cole 2011-09-12 23:00:20 -07:00
parent 508372bbfa
commit 3b3c6eeac3
3 changed files with 18 additions and 9 deletions

View File

@ -18,12 +18,21 @@
*/
package org.jclouds.go2cloud.config;
import static org.jclouds.compute.domain.OsFamily.DEBIAN;
import org.jclouds.compute.domain.TemplateBuilder;
import org.jclouds.elasticstack.compute.config.ElasticStackComputeServiceContextModule;
import com.google.inject.Injector;
/**
*
* @author Adrian Cole
*/
public class Go2CloudJohannesburg1ComputeServiceContextModule extends ElasticStackComputeServiceContextModule {
@Override
protected TemplateBuilder provideTemplate(Injector injector, TemplateBuilder template) {
return template.osFamily(DEBIAN).osVersionMatches("6.0").os64Bit(true);
}
}

View File

@ -1,13 +1,13 @@
[
{
"uuid": "5192adbd-046f-4a48-90f9-3db390b1efab",
"description": "Ubuntu 11.04 Server 64 Bit",
"osFamily": "UBUNTU",
"osVersion": "11.04",
"uuid": "cc54132d-4912-4106-a91a-7a27e6866c8b",
"description": "Debian 6.0.2.1",
"osFamily": "DEBIAN",
"osVersion": "6.0",
"size": "1"
},
{
"uuid": "757f1074-82bd-453c-8cc1-70c4e697e5fe",
"uuid": "46e305b6-6a49-409c-bd12-eb966cdb3664",
"description": "Windows 2008 R2 with SP1 (x64)",
"osFamily": "WINDOWS",
"osVersion": "2008 R2",

View File

@ -52,8 +52,8 @@ public class Go2CloudJohannesburg1TemplateBuilderLiveTest extends BaseTemplateBu
@Override
public boolean apply(OsFamilyVersion64Bit input) {
switch (input.family) {
case UBUNTU:
return (input.version.equals("") || input.version.equals("11.04")) && input.is64Bit;
case DEBIAN:
return (input.version.equals("") || input.version.equals("6.0")) && input.is64Bit;
case WINDOWS:
return (input.version.equals("") || input.version.equals("2008 R2")) && input.is64Bit;
default:
@ -68,8 +68,8 @@ public class Go2CloudJohannesburg1TemplateBuilderLiveTest extends BaseTemplateBu
public void testDefaultTemplateBuilder() throws IOException {
Template defaultTemplate = this.context.getComputeService().templateBuilder().build();
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "11.04");
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "6.0");
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.DEBIAN);
assertEquals(defaultTemplate.getLocation().getId(), "go2cloud-jhb1");
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
}