mirror of https://github.com/apache/jclouds.git
temporary fix to CloudLinux blow-up
This commit is contained in:
parent
a1fbb00da6
commit
6301e23a1a
|
@ -45,7 +45,7 @@ public enum OsFamily {
|
|||
SCIENTIFIC,
|
||||
SIGAR,
|
||||
SLACKWARE,
|
||||
SOLARIS, SUSE, TURBOLINUX, UBUNTU, WINDOWS;
|
||||
SOLARIS, SUSE, TURBOLINUX, CLOUD_LINUX, UBUNTU, WINDOWS;
|
||||
public String value() {
|
||||
return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name());
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ public class ProductItemToImage implements Function<ProductItem, Image> {
|
|||
private static final String RHEL = "Red Hat Enterprise Linux";
|
||||
private static final String UBUNTU = "Ubuntu Linux";
|
||||
private static final String WINDOWS = "Windows Server";
|
||||
private static final String CLOUD_LINUX = "CloudLinux";
|
||||
|
||||
@Resource
|
||||
@Named(ComputeServiceConstants.COMPUTE_LOGGER)
|
||||
|
@ -96,6 +97,7 @@ public class ProductItemToImage implements Function<ProductItem, Image> {
|
|||
else if(description.startsWith(RHEL)) return OsFamily.RHEL;
|
||||
else if(description.startsWith(UBUNTU)) return OsFamily.UBUNTU;
|
||||
else if(description.startsWith(WINDOWS)) return OsFamily.WINDOWS;
|
||||
else if(description.startsWith(CLOUD_LINUX)) return OsFamily.CLOUD_LINUX;
|
||||
return OsFamily.UNRECOGNIZED;
|
||||
}
|
||||
};
|
||||
|
@ -120,6 +122,7 @@ public class ProductItemToImage implements Function<ProductItem, Image> {
|
|||
else if(family.equals(OsFamily.RHEL)) return parseVersion(description, RHEL);
|
||||
else if(family.equals(OsFamily.UBUNTU)) return parseVersion(description, UBUNTU);
|
||||
else if(family.equals(OsFamily.WINDOWS)) return parseVersion(description, WINDOWS);
|
||||
else if(family.equals(OsFamily.CLOUD_LINUX)) return parseVersion(description, CLOUD_LINUX);
|
||||
else throw new NoSuchElementException("No os version for item:"+productItem);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -40,7 +40,7 @@ import static org.testng.AssertJUnit.*;
|
|||
*/
|
||||
@Test(groups = "unit")
|
||||
public class ProductItemToImageTest {
|
||||
// Operating Systems available SEPT 2011
|
||||
// Operating Systems available MAR 2012
|
||||
private static final List<String> operatingSystems = Arrays.asList(
|
||||
"CentOS 5 - LAMP Install (32 bit)",
|
||||
"CentOS 5 - LAMP Install (64 bit)",
|
||||
|
@ -77,6 +77,8 @@ public class ProductItemToImageTest {
|
|||
"Ubuntu Linux 8 LTS Hardy Heron - LAMP Install (64 bit)",
|
||||
"Ubuntu Linux 8 LTS Hardy Heron - Minimal Install (32 bit)",
|
||||
"Ubuntu Linux 8 LTS Hardy Heron - Minimal Install (64 bit)",
|
||||
"CloudLinux 6 (32 bit)",
|
||||
"CloudLinux 6 (64 bit)",
|
||||
"Windows Server 2003 Datacenter SP2 with R2 (32 bit)",
|
||||
"Windows Server 2003 Datacenter SP2 with R2 (64 bit)",
|
||||
"Windows Server 2003 Enterprise SP2 with R2 (64 bit)",
|
||||
|
|
Loading…
Reference in New Issue