You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2017/05/30 14:46:42 UTC
jclouds-labs git commit: Add extra check on
SingleServerApplianceToImage function in case the osFamily is null
Repository: jclouds-labs
Updated Branches:
refs/heads/master b3da4b330 -> 3b8f5c607
Add extra check on SingleServerApplianceToImage function in case the osFamily is null
Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/3b8f5c60
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs/tree/3b8f5c60
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs/diff/3b8f5c60
Branch: refs/heads/master
Commit: 3b8f5c607dfe8a31fc2945e4fc85a55867a76117
Parents: b3da4b3
Author: Ali Bazlamit <al...@hotmail.com>
Authored: Tue May 30 16:37:16 2017 +0200
Committer: Ignasi Barrera <na...@apache.org>
Committed: Tue May 30 16:41:56 2017 +0200
----------------------------------------------------------------------
.../rest/compute/function/SingleServerApplianceToImage.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/3b8f5c60/oneandone/src/main/java/org/apache/jclouds/oneandone/rest/compute/function/SingleServerApplianceToImage.java
----------------------------------------------------------------------
diff --git a/oneandone/src/main/java/org/apache/jclouds/oneandone/rest/compute/function/SingleServerApplianceToImage.java b/oneandone/src/main/java/org/apache/jclouds/oneandone/rest/compute/function/SingleServerApplianceToImage.java
index 71ab088..28ba70f 100644
--- a/oneandone/src/main/java/org/apache/jclouds/oneandone/rest/compute/function/SingleServerApplianceToImage.java
+++ b/oneandone/src/main/java/org/apache/jclouds/oneandone/rest/compute/function/SingleServerApplianceToImage.java
@@ -71,6 +71,9 @@ public class SingleServerApplianceToImage implements Function<SingleServerApplia
}
private static Optional<OsFamily> findInStandardFamilies(final String osFamily) {
+ if (osFamily == null) {
+ return Optional.absent();
+ }
return tryFind(asList(OsFamily.values()), new Predicate<OsFamily>() {
@Override
public boolean apply(OsFamily input) {
@@ -80,6 +83,9 @@ public class SingleServerApplianceToImage implements Function<SingleServerApplia
}
private static Optional<OsFamily> findInOtherOSMap(final String label) {
+ if (label == null) {
+ return Optional.absent();
+ }
return tryFind(OTHER_OS_MAP.keySet(), new Predicate<String>() {
@Override
public boolean apply(String input) {