Project

General

Profile

Revision 9f0918fc

Added by Daniel Lobato Garcia over 7 years ago

Fixes #9242 - Backport image_search to fog 1.24

View differences:

app/models/concerns/fog_extensions/fogdocker/images.rb
1
# Compatibility fixes - to be removed once 1.7 compatibility is no longer required
2
module FogExtensions
3
  module Fogdocker
4
    module Images
5
      extend ActiveSupport::Concern
6

  
7
      def image_search(query = {})
8
        Docker::Util.parse_json(Docker.connection.get('/images/search', query)).map do |image|
9
          downcase_hash_keys(image)
10
        end
11
      end
12
    end
13
  end
14
end
lib/foreman_docker/engine.rb
86 86

  
87 87
    require 'fog/fogdocker/models/compute/server'
88 88
    require 'fog/fogdocker/models/compute/image'
89
    require 'fog/fogdocker/models/compute/images'
89 90
    require File.expand_path('../../../app/models/concerns/fog_extensions/fogdocker/server',
90 91
                             __FILE__)
91 92
    require File.expand_path('../../../app/models/concerns/fog_extensions/fogdocker/image',
92 93
                             __FILE__)
94
    require File.expand_path('../../../app/models/concerns/fog_extensions/fogdocker/images',
95
                             __FILE__)
93 96
    config.to_prepare do
94 97
      Fog::Compute::Fogdocker::Server.send(:include, ::FogExtensions::Fogdocker::Server)
95 98
      Fog::Compute::Fogdocker::Image.send(:include, ::FogExtensions::Fogdocker::Image)
99
      # Compatibility fixes - to be removed once 1.7 compatibility is no longer required
100
      Fog::Compute::Fogdocker::Images.send(:include, ::FogExtensions::Fogdocker::Images)
96 101
      ::Taxonomy.send(:include, ForemanDocker::TaxonomyExtensions)
97 102
    end
98 103
  end

Also available in: Unified diff