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
|