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

    https://github.com/apache/brooklyn-server/pull/926#discussion_r160125927
  
    --- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/pool/MachinePoolPredicates.java
 ---
    @@ -82,40 +83,31 @@ public boolean apply(NodeMetadata input) {
          * (Caveat: If explicit Hardware, Image, and/or Template were 
specified in the template,
          * then the hash code probably will not detect it.)   
          **/
    -    public static boolean matches(ReusableMachineTemplate template, 
NodeMetadata m) {
    +    public static boolean matches(Template template, NodeMetadata m) {
             try {
                 // tags and user metadata
     
    -            if (! m.getTags().containsAll( template.getTags(false) )) 
return false;
    +            if (! m.getTags().containsAll( 
template.getOptions().getTags())) return false;
     
    -            if (! isSubMapOf(template.getUserMetadata(false), 
m.getUserMetadata())) return false;
    +            if (! isSubMapOf(template.getOptions().getUserMetadata(), 
m.getUserMetadata())) return false;
     
     
                 // common hardware parameters
    +            if (m.getHardware().getRam() < 
template.getHardware().getRam()) return false;
     
    -            if (template.getMinRam()!=null && m.getHardware().getRam() < 
template.getMinRam()) return false;
    -
    -            if (template.getMinCores()!=null) {
    +            if (template.getHardware().getProcessors().get(0) != null) {
                     double numCores = 0;
                     for (Processor p: m.getHardware().getProcessors()) 
numCores += p.getCores();
    -                if (numCores+0.001 < template.getMinCores()) return false;
    -            }
    -
    -            if (template.getIs64bit()!=null) {
    -                if (m.getOperatingSystem().is64Bit() != 
template.getIs64bit()) return false;
    +                if (numCores+0.001 < 
template.getHardware().getProcessors().get(0).getCores()) return false;
                 }
     
    -            if (template.getOsFamily()!=null) {
    +            if (template.getImage().getOperatingSystem().getFamily() != 
null) {
                     if (m.getOperatingSystem() == null || 
    -                        
!template.getOsFamily().equals(m.getOperatingSystem().getFamily())) return 
false;
    +                        
!template.getImage().getOperatingSystem().getFamily().equals(m.getOperatingSystem().getFamily()))
 return false;
                 }
    -            if (template.getOsNameMatchesRegex()!=null) {
    --- End diff --
    
    This deleted line does not have an equivalent in the new version. Does this 
mean a potential a change in behaviour?


---

Reply via email to