From 301f6812afd46d7822b932ad04fecd660c09c950 Mon Sep 17 00:00:00 2001 From: Zack Shoylev Date: Fri, 18 Nov 2016 22:53:18 -0600 Subject: [PATCH] Updates the default template so live tests pass again. --- .../nova/v2_0/compute/functions/ImageToOperatingSystem.java | 4 ++-- .../jclouds/compute/reference/ComputeServiceConstants.java | 2 +- .../jclouds/compute/internal/BaseTemplateBuilderLiveTest.java | 2 +- .../cloudservers/us/CloudServersUSProviderMetadata.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/ImageToOperatingSystem.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/ImageToOperatingSystem.java index 4805a57f14..59a0786162 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/ImageToOperatingSystem.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/ImageToOperatingSystem.java @@ -80,9 +80,9 @@ public class ImageToOperatingSystem implements Function is64Bit = matcher.group(2).equals("x64"); } } else { - if (imageName.contains("Red Hat EL")) { + if (imageName.contains("Red Hat")) { osFamily = OsFamily.RHEL; - } else if (imageName.contains("Oracle EL")) { + } else if (imageName.contains("Oracle")) { osFamily = OsFamily.OEL; } else { final Iterable imageNameParts = Splitter.on(CharMatcher.WHITESPACE).trimResults().split( diff --git a/compute/src/main/java/org/jclouds/compute/reference/ComputeServiceConstants.java b/compute/src/main/java/org/jclouds/compute/reference/ComputeServiceConstants.java index fd751d0094..7414624c45 100644 --- a/compute/src/main/java/org/jclouds/compute/reference/ComputeServiceConstants.java +++ b/compute/src/main/java/org/jclouds/compute/reference/ComputeServiceConstants.java @@ -87,7 +87,7 @@ public final class ComputeServiceConstants { @Named(OS_VERSION_MAP_JSON) // TODO: switch this to read from resource, failing back to string // constant on classpath problem - public String osVersionMapJson = "{\"suse\":{\"\":\"\",\"11\":\"11\",\"11 SP1\":\"11 SP1\"},\"debian\":{\"\":\"\",\"lenny\":\"5.0\",\"6\":\"6.0\",\"squeeze\":\"6.0\"},\"centos\":{\"\":\"\",\"5\":\"5.0\",\"5.2\":\"5.2\",\"5.3\":\"5.3\",\"5.4\":\"5.4\",\"5.5\":\"5.5\",\"5.6\":\"5.6\",\"5.7\":\"5.7\",\"6\":\"6.0\",\"6.0\":\"6.0\",\"6.2\":\"6.2\",\"6.3\":\"6.3\",\"6.4\":\"6.4\",\"6.5\":\"6.5\",\"6.6\":\"6.6\",\"7.0\":\"7.0\"},\"rhel\":{\"\":\"\",\"5\":\"5.0\",\"5.2\":\"5.2\",\"5.3\":\"5.3\",\"5.4\":\"5.4\",\"5.5\":\"5.5\",\"5.6\":\"5.6\",\"5.7\":\"5.7\",\"6\":\"6.0\",\"6.0\":\"6.0\",\"6.1\":\"6.1\",\"6.3\":\"6.3\",\"6.4\":\"6.4\",\"6.5\":\"6.5\",\"6.6\":\"6.6\",\"7.0\":\"7.0\"},\"solaris\":{\"\":\"\",\"10\":\"10\"},\"ubuntu\":{\"\":\"\",\"hardy\":\"8.04\",\"karmic\":\"9.10\",\"lucid\":\"10.04\",\"10.04.1\":\"10.04\",\"maverick\":\"10.10\",\"natty\":\"11.04\",\"oneiric\":\"11.10\",\"precise\":\"12.04\",\"quantal\":\"12.10\",\"raring\":\"13.04\",\"saucy\":\"13.10\",\"trusty\":\"14.04\",\"utopic\":\"14.10\",\"vivid\":\"15.04\",\"wily\":\"15.10\"},\"windows\":{\"\":\"\",\"7\":\"7\",\"2003\":\"2003\",\"2003 Standard\":\"2003\",\"2003 R2\":\"2003 R2\",\"2008\":\"2008\",\"2008 Web\":\"2008\",\"2008 Server\":\"2008\",\"Server 2008\":\"2008\",\"2008 R1\":\"2008 R1\",\"2008 R2\":\"2008 R2\",\"Server 2008 R2\":\"2008 R2\",\"2008 Server R2\":\"2008 R2\",\"2008 SP2\":\"2008 SP2\",\"Server 2008 SP2\":\"2008 SP2\"}}"; + public String osVersionMapJson = "{\"suse\":{\"\":\"\",\"11\":\"11\",\"11 SP1\":\"11 SP1\"},\"debian\":{\"\":\"\",\"lenny\":\"5.0\",\"6\":\"6.0\",\"squeeze\":\"6.0\"},\"centos\":{\"\":\"\",\"5\":\"5.0\",\"5.2\":\"5.2\",\"5.3\":\"5.3\",\"5.4\":\"5.4\",\"5.5\":\"5.5\",\"5.6\":\"5.6\",\"5.7\":\"5.7\",\"6\":\"6.0\",\"6.0\":\"6.0\",\"6.2\":\"6.2\",\"6.3\":\"6.3\",\"6.4\":\"6.4\",\"6.5\":\"6.5\",\"6.6\":\"6.6\",\"7\":\"7.0\",\"7.0\":\"7.0\"},\"rhel\":{\"\":\"\",\"5\":\"5.0\",\"5.2\":\"5.2\",\"5.3\":\"5.3\",\"5.4\":\"5.4\",\"5.5\":\"5.5\",\"5.6\":\"5.6\",\"5.7\":\"5.7\",\"6\":\"6.0\",\"6.0\":\"6.0\",\"6.1\":\"6.1\",\"6.3\":\"6.3\",\"6.4\":\"6.4\",\"6.5\":\"6.5\",\"6.6\":\"6.6\",\"7\":\"7.0\",\"7.0\":\"7.0\"},\"solaris\":{\"\":\"\",\"10\":\"10\"},\"ubuntu\":{\"\":\"\",\"hardy\":\"8.04\",\"karmic\":\"9.10\",\"lucid\":\"10.04\",\"10.04.1\":\"10.04\",\"maverick\":\"10.10\",\"natty\":\"11.04\",\"oneiric\":\"11.10\",\"precise\":\"12.04\",\"quantal\":\"12.10\",\"raring\":\"13.04\",\"saucy\":\"13.10\",\"trusty\":\"14.04\",\"utopic\":\"14.10\",\"vivid\":\"15.04\",\"wily\":\"15.10\",\"xenial\":\"16.04\",\"yakkety\":\"16.10\",\"zesty\":\"17.04\"},\"windows\":{\"\":\"\",\"7\":\"7\",\"2003\":\"2003\",\"2003 Standard\":\"2003\",\"2003 R2\":\"2003 R2\",\"2008\":\"2008\",\"2008 Web\":\"2008\",\"2008 Server\":\"2008\",\"Server 2008\":\"2008\",\"2008 R1\":\"2008 R1\",\"2008 R2\":\"2008 R2\",\"Server 2008 R2\":\"2008 R2\",\"2008 Server R2\":\"2008 R2\",\"2008 SP2\":\"2008 SP2\",\"Server 2008 SP2\":\"2008 SP2\"}}"; } @Singleton diff --git a/compute/src/test/java/org/jclouds/compute/internal/BaseTemplateBuilderLiveTest.java b/compute/src/test/java/org/jclouds/compute/internal/BaseTemplateBuilderLiveTest.java index ecc048211c..30f7386db4 100644 --- a/compute/src/test/java/org/jclouds/compute/internal/BaseTemplateBuilderLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/internal/BaseTemplateBuilderLiveTest.java @@ -90,7 +90,7 @@ public abstract class BaseTemplateBuilderLiveTest extends BaseComputeServiceCont @Test public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); - assertTrue(defaultTemplate.getImage().getOperatingSystem().getVersion().matches("\\d\\d\\.\\d\\d"), + assertTrue(defaultTemplate.getImage().getOperatingSystem().getVersion().matches("\\d+\\.\\d+"), "Version mismatch, expected dd.dd, found: " + defaultTemplate.getImage().getOperatingSystem().getVersion()); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); diff --git a/providers/rackspace-cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/us/CloudServersUSProviderMetadata.java b/providers/rackspace-cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/us/CloudServersUSProviderMetadata.java index 2c7a619d8e..2d247dca02 100644 --- a/providers/rackspace-cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/us/CloudServersUSProviderMetadata.java +++ b/providers/rackspace-cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/us/CloudServersUSProviderMetadata.java @@ -76,7 +76,7 @@ public class CloudServersUSProviderMetadata extends BaseProviderMetadata { * Debian - script problems * Ubuntu - script problems * */ - properties.setProperty(TEMPLATE, "imageNameMatches=.*CentOS.*7.*,os64Bit=true"); + properties.setProperty(TEMPLATE, "imageNameMatches=.*Ubuntu.*,os64Bit=true"); return properties; }