Sha256: 042a440db579c7649469de874edd041e7b1a270d3f69e76d28d391ca887c1a32

Contents?: true

Size: 1.29 KB

Versions: 244

Compression:

Stored size: 1.29 KB

Contents

require 'uri'

module Katello
  module ProxyStatus
    class Pulp < ::ProxyStatus::Base
      def storage
        fetch_proxy_data do
          api.pulp_storage
        end
      end

      def status
        begin
          body = RestClient.get(pulp_url)
        rescue => e
          return {'fatal' => _('Unable to connect. Got: %s') % e}
        end
        fail _("Pulp does not appear to be running.") if body.empty?
        json = JSON.parse(body)
        json['errors'] = {}

        if json['known_workers'].empty?
          json['errors']['known_workers'] = _("No pulp workers running.")
        end

        if json['database_connection'] && json['database_connection']['connected'] != true
          json['errors']['database_connection'] = _("Pulp database connection issue.")
        end

        if json['messaging_connection'] && json['messaging_connection']['connected'] != true
          json['errors']['messaging_connection'] = _("Pulp message bus connection issue.")
        end

        json
      end

      def self.humanized_name
        'Pulp'
      end

      private

      def pulp_url
        url = URI.parse(proxy.url)
        url.port = 443
        url.path = '/pulp/api/v2/status/'
        url.to_s
      end
    end
  end
end
::ProxyStatus.status_registry.add(Katello::ProxyStatus::Pulp)

Version data entries

244 entries across 244 versions & 1 rubygems

Version Path
katello-4.16.0 app/services/katello/proxy_status/pulp.rb
katello-4.15.1 app/services/katello/proxy_status/pulp.rb
katello-4.16.0.rc2 app/services/katello/proxy_status/pulp.rb
katello-4.16.0.rc1 app/services/katello/proxy_status/pulp.rb
katello-4.14.3 app/services/katello/proxy_status/pulp.rb
katello-4.14.2 app/services/katello/proxy_status/pulp.rb
katello-4.15.0 app/services/katello/proxy_status/pulp.rb
katello-4.15.0.rc2 app/services/katello/proxy_status/pulp.rb
katello-4.15.0.rc1 app/services/katello/proxy_status/pulp.rb
katello-4.14.1 app/services/katello/proxy_status/pulp.rb
katello-4.14.0 app/services/katello/proxy_status/pulp.rb
katello-4.14.0.rc3 app/services/katello/proxy_status/pulp.rb
katello-4.14.0.rc2 app/services/katello/proxy_status/pulp.rb
katello-4.14.0.rc1.1 app/services/katello/proxy_status/pulp.rb
katello-4.14.0.rc1 app/services/katello/proxy_status/pulp.rb
katello-4.13.1 app/services/katello/proxy_status/pulp.rb
katello-4.13.0 app/services/katello/proxy_status/pulp.rb
katello-4.12.1 app/services/katello/proxy_status/pulp.rb
katello-4.13.0.rc1 app/services/katello/proxy_status/pulp.rb
katello-4.12.0 app/services/katello/proxy_status/pulp.rb