From 3b3c6eeac305bd4e6adb4468c1fc466bf912f6aa Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Mon, 12 Sep 2011 23:00:20 -0700 Subject: [PATCH] Issue 645: updated image list for go2cloud --- ...2CloudJohannesburg1ComputeServiceContextModule.java | 9 +++++++++ .../resources/go2cloud-jhb1/preinstalled_images.json | 10 +++++----- .../Go2CloudJohannesburg1TemplateBuilderLiveTest.java | 8 ++++---- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/sandbox-providers/go2cloud-jhb1/src/main/java/org/jclouds/go2cloud/config/Go2CloudJohannesburg1ComputeServiceContextModule.java b/sandbox-providers/go2cloud-jhb1/src/main/java/org/jclouds/go2cloud/config/Go2CloudJohannesburg1ComputeServiceContextModule.java index 4cd4c2b422..792d669e59 100644 --- a/sandbox-providers/go2cloud-jhb1/src/main/java/org/jclouds/go2cloud/config/Go2CloudJohannesburg1ComputeServiceContextModule.java +++ b/sandbox-providers/go2cloud-jhb1/src/main/java/org/jclouds/go2cloud/config/Go2CloudJohannesburg1ComputeServiceContextModule.java @@ -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); + } } diff --git a/sandbox-providers/go2cloud-jhb1/src/main/resources/go2cloud-jhb1/preinstalled_images.json b/sandbox-providers/go2cloud-jhb1/src/main/resources/go2cloud-jhb1/preinstalled_images.json index 8ac6adf3b9..cc87604c50 100644 --- a/sandbox-providers/go2cloud-jhb1/src/main/resources/go2cloud-jhb1/preinstalled_images.json +++ b/sandbox-providers/go2cloud-jhb1/src/main/resources/go2cloud-jhb1/preinstalled_images.json @@ -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", diff --git a/sandbox-providers/go2cloud-jhb1/src/test/java/org/jclouds/go2cloud/compute/Go2CloudJohannesburg1TemplateBuilderLiveTest.java b/sandbox-providers/go2cloud-jhb1/src/test/java/org/jclouds/go2cloud/compute/Go2CloudJohannesburg1TemplateBuilderLiveTest.java index bc5832d4e8..a66c219954 100644 --- a/sandbox-providers/go2cloud-jhb1/src/test/java/org/jclouds/go2cloud/compute/Go2CloudJohannesburg1TemplateBuilderLiveTest.java +++ b/sandbox-providers/go2cloud-jhb1/src/test/java/org/jclouds/go2cloud/compute/Go2CloudJohannesburg1TemplateBuilderLiveTest.java @@ -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); }