Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/544#discussion_r98661586
  
    --- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooser.java
 ---
    @@ -135,10 +135,14 @@ public double score(Image img) {
             if (os!=null) {
                 if (os.getFamily()!=null) {
                     // preference for these open, popular OS (but only wrt 
versions above) 
    -                if (os.getFamily().equals(OsFamily.CENTOS)) score += 2;
    -                else if (os.getFamily().equals(OsFamily.UBUNTU)) {
    +                if (os.getFamily().equals(OsFamily.CENTOS)) {
                         score += 2;
     
    +                    if(os.getVersion()!= null && 
os.getVersion().startsWith("7.")) score += 0.1;
    +                }
    +                else if (os.getFamily().equals(OsFamily.UBUNTU)) {
    +                    score += 1;
    --- End diff --
    
    Will the version always start with "7.", or might it just be "CentOS 7"? 
I'd be inclined to say `startsWith("7")`.
    
    Do we want to favour more recent CentOS over slightly older ones (e.g. 7.3 
is better than 7.1)? Not sure of the best way to do that in a future-proof way. 
We could do something similar to `punishmentForOldOsVersions`, but to reward 
newer versions. However, we'd need to be careful that if someone says 
`7.20170104` that we don't give it a ridiculous high score!)
    
    Changing Ubuntu to `+= 1` puts it at the same level as RHEL, AMZN_LINUX and 
DEBIAN. I wonder if we should make it `+= 1.5`? Or we could make CentOS `+= 3`?
    
    Minor personal preference: I'd refactor to move the 
`punishmentForOldOsVersions(img, OsFamily.CENTOS, 6)` call into the `if 
(...CENTOS)` block here. Similar for ubuntu.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to