Class: Katello::ProxyStatus::Pulp

Inherits:
ProxyStatus::Base
  • Object
show all
Defined in:
app/services/katello/proxy_status/pulp.rb

Direct Known Subclasses

PulpNode

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.humanized_nameObject



37
38
39
# File 'app/services/katello/proxy_status/pulp.rb', line 37

def self.humanized_name
  'Pulp'
end

Instance Method Details

#statusObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/services/katello/proxy_status/pulp.rb', line 12

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

#storageObject



6
7
8
9
10
# File 'app/services/katello/proxy_status/pulp.rb', line 6

def storage
  fetch_proxy_data do
    api.pulp_storage
  end
end