find_matches

in lib/instance_agent/plugins/codedeploy/install_instruction.rb [137:161]


        def find_matches(permission)
          log(:debug, "Finding matches for #{permission.object}")
          matches = []
          if permission.type.include?("file")
            @copy_targets.keys.each do |object|
              log(:debug, "Checking #{object}")
              if (permission.matches_pattern?(object) && !permission.matches_except?(object))
                log(:debug, "Found match #{object}")
                permission.validate_file_acl(object)
                matches << object
              end
            end
          end
          if permission.type.include?("directory")
            @mkdir_targets.each do |object|
              log(:debug, "Checking #{object}")
              if (permission.matches_pattern?(object) && !permission.matches_except?(object))
                log(:debug, "Found match #{object}")
                matches << object
              end
            end
          end
          matches
        end