brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreatu...@apache.org
Subject [1/2] incubator-brooklyn git commit: image chooser prefers id's containing the os name
Date Tue, 17 Mar 2015 19:42:51 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master ab46e6fd8 -> 2a3292027


image chooser prefers id's containing the os name

useful heuristic in softlayer


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/89c12634
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/89c12634
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/89c12634

Branch: refs/heads/master
Commit: 89c126340dcf350a3d887782a5ea79a672fe2f17
Parents: ab46e6f
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Tue Mar 17 19:10:49 2015 +0000
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Tue Mar 17 19:10:49 2015 +0000

----------------------------------------------------------------------
 .../java/brooklyn/location/jclouds/BrooklynImageChooser.java    | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/89c12634/locations/jclouds/src/main/java/brooklyn/location/jclouds/BrooklynImageChooser.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/brooklyn/location/jclouds/BrooklynImageChooser.java
b/locations/jclouds/src/main/java/brooklyn/location/jclouds/BrooklynImageChooser.java
index 75d761f..e4dac68 100644
--- a/locations/jclouds/src/main/java/brooklyn/location/jclouds/BrooklynImageChooser.java
+++ b/locations/jclouds/src/main/java/brooklyn/location/jclouds/BrooklynImageChooser.java
@@ -138,6 +138,11 @@ public class BrooklynImageChooser {
 
                 // prefer to take our chances with unknown / unlabelled linux than something
explicitly windows
                 else if (os.getFamily().equals(OsFamily.WINDOWS)) score -= 1;
+                
+                // if family is part of the image name, give it a slight pref
+                // (useful on softlayer where id is a uuid for user-supplied)
+                if (img.getId().toLowerCase().indexOf(os.getFamily().toString().toLowerCase())
>= 0)
+                    score += 0.5;
             }
             // prefer 64-bit
             if (os.is64Bit()) score += 0.5;


Mime
View raw message