foreman_abrt 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +43 -24
- data/app/controllers/api/v2/abrt_reports_controller.rb +3 -3
- data/app/helpers/abrt_reports_helper.rb +31 -20
- data/app/models/abrt_report.rb +29 -9
- data/app/models/concerns/foreman_abrt/host_extensions.rb +9 -1
- data/app/models/setting/abrt.rb +6 -6
- data/app/overrides/add_host_bug_report_tab.rb +8 -8
- data/app/views/abrt_reports/_host_tab_pane.html.erb +19 -19
- data/app/views/abrt_reports/_list.html.erb +12 -12
- data/app/views/abrt_reports/_show_response.html.erb +10 -5
- data/app/views/abrt_reports/show.html.erb +20 -12
- data/lib/foreman_abrt/engine.rb +2 -2
- data/lib/foreman_abrt/version.rb +1 -1
- metadata +25 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b48790120660d859c2e437373bc4805aa206ac3
|
4
|
+
data.tar.gz: c44d479890517cb1b565a282d97a4d07c22bfc74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0a1b5e461594c02f2620eb722f8f87a3d1631bd3325495aa2a83fe60f048b2e27e34bdb210bcaf9082753688d7b4e31ca077838185d4c9fe084bf2accfe3dc1
|
7
|
+
data.tar.gz: a9984b9f7dbbaacffee2c24deddaf09e97e4731d73ac02ba7b313c10af93b55a13357be21062d7d28f478281fd42996b331ebccdd179f765098a3649c3197cda
|
data/README.md
CHANGED
@@ -22,20 +22,7 @@ server.
|
|
22
22
|
responds with additional information about the report, such as links to bug
|
23
23
|
trackers or suggested solutions, it is displayed alongside the report.
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
+--------------+ ureport +-------------+ aggregated ureports +---------+
|
28
|
-
| Managed host | ---------> | Smart proxy | ---------------------> | Foreman |
|
29
|
-
+--------------+ +-------------+ +---------+
|
30
|
-
: : ^
|
31
|
-
: ureport : :
|
32
|
-
: : : server response
|
33
|
-
: V :
|
34
|
-
: ureport +-------------+
|
35
|
-
+ - - - - - - - - - - - - - ->| ABRT server |
|
36
|
-
+-------------+
|
37
|
-
|
38
|
-
```
|
25
|
+
![foreman abrt workflow](/extra/foreman_abrt_workflow.png?raw=true)
|
39
26
|
|
40
27
|
## Installation
|
41
28
|
|
@@ -43,19 +30,37 @@ To be able to see ABRT bug reports in your Foreman instance, you need to
|
|
43
30
|
install the plugin itself, install ABRT plugin for your smart proxies and
|
44
31
|
configure your hosts to send the bug reports to their smart proxy.
|
45
32
|
|
46
|
-
Both plugins are available as RPMs in [
|
33
|
+
Both plugins are available as RPMs in [Foreman YUM repositories](http://yum.theforeman.org/).
|
34
|
+
|
35
|
+
### Prerequisites
|
47
36
|
|
48
37
|
The plugins require both Foreman and smart-proxy to be version 1.6 or later.
|
49
38
|
|
39
|
+
The plugins have been tested on Fedora 19, RHEL 6 and RHEL 7. Due to old
|
40
|
+
version of `rubygem-ffi` the smart-proxy plugin does not work on RHEL 6 unless
|
41
|
+
you set the option `aggregate_reports` to `false` in
|
42
|
+
`/etc/foreman-proxy/settings.d/abrt.yml`.
|
43
|
+
|
44
|
+
To have hosts automatically send ureports to Foreman, you need to have ABRT
|
45
|
+
2.1.11 or higher installed on them. RHEL 7 and Fedora 19 and higher satisfy
|
46
|
+
this. ABRT in RHEL6 does not have ureport support, however you can use an
|
47
|
+
[unofficial build](https://copr.fedoraproject.org/coprs/jfilak/abrt/) if you
|
48
|
+
wish to test this feature.
|
49
|
+
|
50
50
|
### Installing the Foreman plugin
|
51
51
|
|
52
52
|
To install the Foreman plugin, follow the [plugin installation
|
53
53
|
instructions](http://projects.theforeman.org/projects/foreman/wiki/How_to_Install_a_Plugin).
|
54
54
|
|
55
|
+
You need to install the `rubygem-foreman_abrt` package (or
|
56
|
+
`ruby193-rubygem-foreman_abrt` on RHEL/CentOS).
|
57
|
+
|
55
58
|
### Setting up smart proxies
|
56
59
|
|
57
60
|
Follow the [smart-proxy plugin installation
|
58
61
|
instructions](http://projects.theforeman.org/projects/foreman/wiki/How_to_Install_a_Smart-Proxy_Plugin).
|
62
|
+
You need to install the `rubygem-smart_proxy_abrt` package.
|
63
|
+
|
59
64
|
The plugin needs some configuration in order to work correctly.
|
60
65
|
|
61
66
|
- Edit `/etc/foreman-proxy/settings.yml` to configure the main Foreman host,
|
@@ -66,6 +71,9 @@ The plugin needs some configuration in order to work correctly.
|
|
66
71
|
# URL of your foreman instance
|
67
72
|
:foreman_url: https://f19-foreman.tld
|
68
73
|
```
|
74
|
+
Please note that the `:foreman_url:` setting may be entirely missing in the
|
75
|
+
file. In that case just add the line to the end of
|
76
|
+
`/etc/foreman-proxy/settings.yml`.
|
69
77
|
|
70
78
|
- Ensure that `/etc/foreman-proxy/settings.d/abrt.yml` contains the following line:
|
71
79
|
```
|
@@ -92,15 +100,23 @@ The plugin needs some configuration in order to work correctly.
|
|
92
100
|
```
|
93
101
|
# URL of your foreman-proxy, with /abrt path.
|
94
102
|
URL = https://f19-smartproxy.tld:8443/abrt
|
95
|
-
#
|
96
|
-
SSLVerify =
|
103
|
+
# Verify the server certificate.
|
104
|
+
SSLVerify = yes
|
97
105
|
# This asks puppet config for the path to the ceritificates. you can
|
98
106
|
# explicitly provide path by using /path/to/cert:/path/to/key on the
|
99
107
|
# right hand side.
|
100
108
|
SSLClientAuth = puppet
|
101
109
|
```
|
102
110
|
|
103
|
-
-
|
111
|
+
- Add the Puppet CA to the list of trusted certificate authorities. This is
|
112
|
+
needed for verifying the validity of smart-proxy's certificate:
|
113
|
+
|
114
|
+
```
|
115
|
+
~# cp /var/lib/puppet/ssl/certs/ca.pem /etc/pki/ca-trust/source/anchors/
|
116
|
+
~# update-ca-trust
|
117
|
+
```
|
118
|
+
|
119
|
+
- Enable auto-reporting by running the following command:
|
104
120
|
|
105
121
|
```
|
106
122
|
~# abrt-auto-reporting enabled
|
@@ -119,12 +135,20 @@ Segmentation fault (core dumped)
|
|
119
135
|
```
|
120
136
|
|
121
137
|
After a couple of seconds, a new file should appear in
|
122
|
-
`/var/spool/foreman-proxy
|
138
|
+
`/var/spool/foreman-proxy-abrt` on the smart-proxy host. The reports from
|
123
139
|
the smart-proxy are sent to the Foreman in batches every half an hour (by
|
124
140
|
default). This means that within half an hour you should be able to see the bug
|
125
141
|
report in the Foreman web interface. You can send the reports to Foreman
|
126
142
|
manually by running the `smart-proxy-abrt-send` command.
|
127
143
|
|
144
|
+
If the will-crash package is not available, you can try the following. Please
|
145
|
+
make sure not to actually report this to `sleep` maintainers, though:
|
146
|
+
|
147
|
+
```
|
148
|
+
~$ sleep 1d &
|
149
|
+
~$ kill -SEGV $!
|
150
|
+
```
|
151
|
+
|
128
152
|
## Usage
|
129
153
|
|
130
154
|
The list of received bug reports can be accessed by clicking on *Bug reports*
|
@@ -147,12 +171,7 @@ configuration screen (*Administer*->*Settings*).
|
|
147
171
|
|
148
172
|
## TODO
|
149
173
|
|
150
|
-
- Forwarding reports on the proxy - drop it altogether, or forward the server
|
151
|
-
response to the client?
|
152
174
|
- Use puppet to configure managed hosts to send ureports to Foreman.
|
153
|
-
- Figure out how to import the Puppet CA cert on managed hosts to the system
|
154
|
-
certificates so that the reporter-ureport doesn't have to skip server
|
155
|
-
certificate validation.
|
156
175
|
|
157
176
|
## Copyright
|
158
177
|
|
@@ -13,12 +13,12 @@ module Api
|
|
13
13
|
rescue => e
|
14
14
|
logger.error "Failed to import ABRT report: #{e.message}"
|
15
15
|
logger.debug e.backtrace.join("\n")
|
16
|
-
render :json => {
|
16
|
+
render :json => { 'message' => e.message }, :status => :unprocessable_entity
|
17
17
|
return
|
18
18
|
end
|
19
19
|
|
20
20
|
if abrt_reports.count == 0
|
21
|
-
render :json => {
|
21
|
+
render :json => { 'message' => 'Failed to import any report'}, :status => :unprocessable_entity
|
22
22
|
return
|
23
23
|
end
|
24
24
|
|
@@ -35,7 +35,7 @@ module Api
|
|
35
35
|
|
36
36
|
# Do not report forwarding error to the proxy, we can manually resend
|
37
37
|
# it later and the proxy probably can't do anything about it anyway.
|
38
|
-
render :json => {
|
38
|
+
render :json => { 'message' => 'OK' }
|
39
39
|
end
|
40
40
|
|
41
41
|
end
|
@@ -1,39 +1,49 @@
|
|
1
1
|
module AbrtReportsHelper
|
2
|
-
def simple_format_if_multiline
|
3
|
-
if str.include? "\n"
|
2
|
+
def simple_format_if_multiline(str)
|
3
|
+
if str and str.include? "\n"
|
4
4
|
simple_format str
|
5
5
|
else
|
6
6
|
str
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
-
def count_abrt_reports
|
10
|
+
def count_abrt_reports(abrt_reports)
|
11
11
|
range_days = 14
|
12
|
-
data
|
13
|
-
now
|
14
|
-
start
|
15
|
-
by_day
|
16
|
-
|
17
|
-
|
12
|
+
data = []
|
13
|
+
now = Time.now.utc
|
14
|
+
start = now - range_days.days
|
15
|
+
by_day = abrt_reports.where(:reported_at => start..now).
|
16
|
+
group('DATE(reported_at)').
|
17
|
+
sum(:count)
|
18
18
|
|
19
19
|
range_days.downto(1) do |days_back|
|
20
|
-
date
|
21
|
-
crashes = by_day[date]
|
20
|
+
date = (now - (days_back-1).days).strftime('%Y-%m-%d')
|
21
|
+
crashes = (by_day[date] || 0)
|
22
22
|
data << [days_back, crashes]
|
23
23
|
end
|
24
24
|
data
|
25
25
|
end
|
26
26
|
|
27
|
-
def render_abrt_graph
|
27
|
+
def render_abrt_graph(abrt_reports, options = {})
|
28
28
|
data = count_abrt_reports abrt_reports
|
29
29
|
flot_bar_chart 'abrt_graph', _('Days Ago'), _('Number of crashes'), data, options
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
class StringIOWithPath < StringIO
|
33
|
+
def initialize(string, path, content_type)
|
34
|
+
super(string)
|
35
|
+
@path = path
|
36
|
+
@content_type = content_type
|
37
|
+
end
|
38
|
+
|
39
|
+
attr_reader :path, :content_type
|
40
|
+
end
|
41
|
+
|
42
|
+
def send_to_abrt_server(abrt_report)
|
33
43
|
request_params = {
|
34
|
-
:timeout
|
44
|
+
:timeout => 60,
|
35
45
|
:open_timeout => 10,
|
36
|
-
:verify_ssl
|
46
|
+
:verify_ssl => Setting[:abrt_server_verify_ssl] ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
|
37
47
|
}
|
38
48
|
|
39
49
|
if Setting[:abrt_server_ssl_ca_file] && !Setting[:abrt_server_ssl_ca_file].empty?
|
@@ -46,20 +56,21 @@ module AbrtReportsHelper
|
|
46
56
|
request_params[:ssl_client_key] = OpenSSL::PKey::RSA.new(File.read(Setting[:abrt_server_ssl_priv_key]))
|
47
57
|
end
|
48
58
|
|
49
|
-
resource
|
50
|
-
|
59
|
+
resource = RestClient::Resource.new(Setting[:abrt_server_url], request_params)
|
60
|
+
report_file = StringIOWithPath.new(abrt_report.json, '*buffer*', 'application/json')
|
61
|
+
response = resource['reports/new/'].post({ :file => report_file, :multipart => true }, :content_type => :json, :accept => :json)
|
51
62
|
|
52
63
|
if response.code != 202
|
53
64
|
logger.error "Failed to forward bug report: #{response.code}: #{response.to_str}"
|
54
|
-
raise ::Foreman::Exception.new(N_(
|
65
|
+
raise ::Foreman::Exception.new(N_('Failed to forward bug report: %s: %s', response.code, response.to_str))
|
55
66
|
end
|
56
67
|
|
57
68
|
JSON.parse(response.body)
|
58
69
|
end
|
59
70
|
|
60
|
-
def format_reason
|
71
|
+
def format_reason(reason)
|
61
72
|
if reason.nil? or reason.empty?
|
62
|
-
_(
|
73
|
+
_('Unknown')
|
63
74
|
else
|
64
75
|
reason
|
65
76
|
end
|
data/app/models/abrt_report.rb
CHANGED
@@ -40,13 +40,33 @@ class AbrtReport < ActiveRecord::Base
|
|
40
40
|
scoped_search :in => :abrt_report_response_solutions, :on => :url, :complete_value => true, :rename => :solution_url
|
41
41
|
|
42
42
|
def self.import(json)
|
43
|
-
host = Host.find_by_name(json[:host])
|
44
43
|
reports = []
|
44
|
+
host = Host.find_by_name(json[:host])
|
45
|
+
|
46
|
+
# If the host lookup failed, it is possible that we are using subscription management certificates which
|
47
|
+
# have UUID in their CN instead of host's FQDN. Try asking Katello if it knows host with such UUID.
|
48
|
+
if host.nil? && defined?(::Katello::System) && content_host = ::Katello::System.find_by_uuid(json[:host])
|
49
|
+
host = content_host.foreman_host
|
50
|
+
end
|
51
|
+
|
52
|
+
# The subscription management certificate also has (what is likely) FQDN in the subjectAltName certificate field.
|
53
|
+
# Try finding such host as a last resort.
|
54
|
+
if host.nil? && !json[:althosts].nil?
|
55
|
+
json[:althosts].each do |hostname|
|
56
|
+
host = Host.find_by_name(hostname)
|
57
|
+
break unless host.nil?
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
if host.nil?
|
62
|
+
logger.error "Unable to find host #{json[:host]}"
|
63
|
+
return []
|
64
|
+
end
|
45
65
|
|
46
66
|
json[:reports].each do |report|
|
47
67
|
begin
|
48
|
-
reports << AbrtReport.create!(:host
|
49
|
-
:duphash
|
68
|
+
reports << AbrtReport.create!(:host => host, :count => report[:count], :json => report[:full].to_json,
|
69
|
+
:duphash => report[:duphash], :reason => report[:full][:reason],
|
50
70
|
:reported_at => report[:reported_at])
|
51
71
|
rescue => e
|
52
72
|
logger.error "Failed to import ABRT report from #{host}: #{e.class}:#{e.message}"
|
@@ -61,17 +81,17 @@ class AbrtReport < ActiveRecord::Base
|
|
61
81
|
abrt_report_response_solutions.clear
|
62
82
|
abrt_report_response_destinations.clear
|
63
83
|
|
64
|
-
self.forwarded_at
|
65
|
-
self.response_known
|
84
|
+
self.forwarded_at = Time.now
|
85
|
+
self.response_known = response['result']
|
66
86
|
self.response_message = response['message']
|
67
|
-
self.response_bthash
|
87
|
+
self.response_bthash = response['bthash']
|
68
88
|
|
69
89
|
if response['solutions']
|
70
90
|
response['solutions'].each do |solution|
|
71
91
|
abrt_report_response_solutions.create!(
|
72
92
|
:cause => solution['cause'],
|
73
|
-
:note
|
74
|
-
:url
|
93
|
+
:note => solution['note'],
|
94
|
+
:url => solution['url']
|
75
95
|
)
|
76
96
|
end
|
77
97
|
end
|
@@ -80,7 +100,7 @@ class AbrtReport < ActiveRecord::Base
|
|
80
100
|
response['reported_to'].each do |destination|
|
81
101
|
abrt_report_response_destinations.create!(
|
82
102
|
:desttype => destination['type'],
|
83
|
-
:value
|
103
|
+
:value => destination['value'],
|
84
104
|
:reporter => destination['reporter']
|
85
105
|
)
|
86
106
|
end
|
@@ -2,7 +2,15 @@ module ForemanAbrt::HostExtensions
|
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
4
|
included do
|
5
|
-
has_many :abrt_reports, :dependent => :destroy, :foreign_key =>
|
5
|
+
has_many :abrt_reports, :dependent => :destroy, :foreign_key => 'host_id'
|
6
|
+
|
7
|
+
scoped_search :in => :abrt_reports, :on => :reason, :complete_value => true, :rename => :abrt_report_reason
|
8
|
+
scoped_search :in => :abrt_reports, :on => :count, :complete_value => true, :rename => :abrt_report_count, :only_explicit => true
|
9
|
+
scoped_search :in => :abrt_reports, :on => :reported_at, :complete_value => true, :rename => :abrt_report_reported, :only_explicit => true
|
10
|
+
|
11
|
+
scoped_search :in => :abrt_reports, :on => :forwarded_at, :complete_value => true, :rename => :abrt_report_forwarded, :only_explicit => true
|
12
|
+
scoped_search :in => :abrt_reports, :on => :response_known, :complete_value => true, :rename => :abrt_report_known, :only_explicit => true
|
13
|
+
scoped_search :in => :abrt_reports, :on => :response_message, :complete_value => true, :rename => :abrt_report_response
|
6
14
|
end
|
7
15
|
|
8
16
|
def recent_abrt_reports
|
data/app/models/setting/abrt.rb
CHANGED
@@ -3,13 +3,13 @@ class Setting::Abrt < ::Setting
|
|
3
3
|
def self.load_defaults
|
4
4
|
return unless super
|
5
5
|
|
6
|
-
fqdn
|
7
|
-
lower_fqdn
|
6
|
+
fqdn = Facter.value(:fqdn) || SETTINGS[:fqdn]
|
7
|
+
lower_fqdn = fqdn.downcase
|
8
8
|
|
9
9
|
# Try taking the provisioning SSL setup for default
|
10
|
-
ssl_cert = Setting[:ssl_certificate]
|
11
|
-
ssl_ca_file = Setting[:ssl_ca_file]
|
12
|
-
ssl_priv_key = Setting[:ssl_priv_key]
|
10
|
+
ssl_cert = Setting[:ssl_certificate] || "#{SETTINGS[:puppetvardir]}/ssl/certs/#{lower_fqdn}.pem"
|
11
|
+
ssl_ca_file = Setting[:ssl_ca_file] || "#{SETTINGS[:puppetvardir]}/ssl/certs/ca.pem"
|
12
|
+
ssl_priv_key = Setting[:ssl_priv_key] || "#{SETTINGS[:puppetvardir]}/ssl/private_keys/#{lower_fqdn}.pem"
|
13
13
|
|
14
14
|
Setting.transaction do
|
15
15
|
[
|
@@ -19,7 +19,7 @@ class Setting::Abrt < ::Setting
|
|
19
19
|
self.set('abrt_server_ssl_priv_key', N_('SSL private key path that Foreman would use to communicate with ABRT server'), ssl_priv_key),
|
20
20
|
self.set('abrt_server_ssl_ca_file', N_('SSL CA file that Foreman will use to communicate with ABRT server'), ssl_ca_file),
|
21
21
|
self.set('abrt_automatically_forward', N_('Automatically forward every report to ABRT server?'), false),
|
22
|
-
].compact.each { |s| self.create s.update(:category =>
|
22
|
+
].compact.each { |s| self.create s.update(:category => 'Setting::Abrt') }
|
23
23
|
end
|
24
24
|
|
25
25
|
true
|
@@ -1,11 +1,11 @@
|
|
1
|
-
Deface::Override.new(:virtual_path
|
2
|
-
:name
|
3
|
-
:insert_bottom =>
|
4
|
-
:partial
|
1
|
+
Deface::Override.new(:virtual_path => 'hosts/show',
|
2
|
+
:name => 'add_bug_report_tab',
|
3
|
+
:insert_bottom => 'ul.nav-tabs',
|
4
|
+
:partial => 'abrt_reports/host_tab'
|
5
5
|
)
|
6
6
|
|
7
|
-
Deface::Override.new(:virtual_path
|
8
|
-
:name
|
9
|
-
:insert_bottom =>
|
10
|
-
:partial
|
7
|
+
Deface::Override.new(:virtual_path => 'hosts/show',
|
8
|
+
:name => 'add_bug_report_tab_pane',
|
9
|
+
:insert_bottom => 'div.tab-content',
|
10
|
+
:partial => 'abrt_reports/host_tab_pane'
|
11
11
|
)
|
@@ -1,21 +1,21 @@
|
|
1
1
|
<div class="tab-pane" id="abrt">
|
2
|
-
<% if @host.recent_abrt_reports.any? %>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
<% else %>
|
19
|
-
|
20
|
-
<% end %>
|
2
|
+
<% if @host.recent_abrt_reports.any? %>
|
3
|
+
<table class="table table-bordered table-striped">
|
4
|
+
<tr>
|
5
|
+
<th>Reported</th>
|
6
|
+
<th>#</th>
|
7
|
+
<th>Reason</th>
|
8
|
+
</tr>
|
9
|
+
<% @host.recent_abrt_reports.each do |abrt_report| %>
|
10
|
+
<tr>
|
11
|
+
<td> <%= link_to (_('%s ago') % time_ago_in_words(abrt_report.reported_at.getlocal)), abrt_report %></td>
|
12
|
+
<td> <%= abrt_report.count %> </td>
|
13
|
+
<td> <%= format_reason abrt_report.reason %> </td>
|
14
|
+
</tr>
|
15
|
+
<% end %>
|
16
|
+
</table>
|
17
|
+
<%= link_to _('All bug reports for this host'), host_abrt_reports_path(@host), :class => 'btn btn-default' %>
|
18
|
+
<% else %>
|
19
|
+
<div class="alert alert-success"> <%= _('No bug reports for this host in the last month') %> </div>
|
20
|
+
<% end %>
|
21
21
|
</div>
|
@@ -3,28 +3,28 @@
|
|
3
3
|
<% unless params[:host_id] %>
|
4
4
|
<th><%= sort :host %></th>
|
5
5
|
<% end %>
|
6
|
-
<th><%= sort :reported, :as => _(
|
7
|
-
<th class="col-md-1"><%= sort :reason, :as => _(
|
8
|
-
<th class="col-md-1"><%= _(
|
9
|
-
<th class="col-md-1"><%= _(
|
6
|
+
<th><%= sort :reported, :as => _('Reported') %></th>
|
7
|
+
<th class="col-md-1"><%= sort :reason, :as => _('Reason') %></th>
|
8
|
+
<th class="col-md-1"><%= _('Repeated') %></th>
|
9
|
+
<th class="col-md-1"><%= _('Forwarded') %></th>
|
10
10
|
<th class="col-md-1"></th>
|
11
11
|
</tr>
|
12
|
-
<%
|
12
|
+
<% @abrt_reports.each do |abrt_report| %>
|
13
13
|
<tr>
|
14
14
|
<% if params[:host_id].nil? %>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
<td>
|
16
|
+
<% if abrt_report.host %>
|
17
|
+
<%= link_to abrt_report.host, host_abrt_reports_path(abrt_report.host) %>
|
18
|
+
<% end %>
|
19
|
+
</td>
|
20
20
|
<% end %>
|
21
|
-
<td> <%= link_to(_(
|
21
|
+
<td> <%= link_to(_('%s ago') % time_ago_in_words(abrt_report.reported_at.getlocal), abrt_report_path(abrt_report)) %> </td>
|
22
22
|
<td> <%= format_reason abrt_report.reason %> </td>
|
23
23
|
<td> <%= abrt_report.count %> </td>
|
24
24
|
<td> <%= checked_icon !abrt_report.forwarded_at.nil? %> </td>
|
25
25
|
<td align="right">
|
26
26
|
<%= display_delete_if_authorized hash_for_abrt_report_path(:id => abrt_report.id).merge(:auth_object => abrt_report, :authorizer => authorizer),
|
27
|
-
:confirm => _(
|
27
|
+
:confirm => _('Delete bug report for %s?') % abrt_report.host.try(:name) %>
|
28
28
|
</td>
|
29
29
|
</tr>
|
30
30
|
<% end %>
|
@@ -7,9 +7,14 @@
|
|
7
7
|
<div class="row">
|
8
8
|
<div class="col-md-12">
|
9
9
|
<table class="table table-bordered table-striped">
|
10
|
-
<tr
|
11
|
-
|
12
|
-
|
10
|
+
<tr>
|
11
|
+
<th><%= _('Known problem') %></th>
|
12
|
+
<td><%= @abrt_report.response_known %></td>
|
13
|
+
</tr>
|
14
|
+
<tr>
|
15
|
+
<th><%= _('Message') %></th>
|
16
|
+
<td><%= simple_format_if_multiline @abrt_report.response_message %></td>
|
17
|
+
</tr>
|
13
18
|
</table>
|
14
19
|
</div>
|
15
20
|
</div>
|
@@ -19,7 +24,7 @@
|
|
19
24
|
<h3>Reported to</h3>
|
20
25
|
<% if !@abrt_report.abrt_report_response_destinations.empty? %>
|
21
26
|
<table class="table table-bordered table-striped">
|
22
|
-
<%
|
27
|
+
<% @abrt_report.abrt_report_response_destinations.each do |destination| %>
|
23
28
|
<tr>
|
24
29
|
<% if destination.desttype == 'url' %>
|
25
30
|
<td><a href="<%= destination.value %>"><%= destination.reporter %></a></td>
|
@@ -39,7 +44,7 @@
|
|
39
44
|
<h3>Solutions</h3>
|
40
45
|
<% if !@abrt_report.abrt_report_response_solutions.empty? %>
|
41
46
|
<table class="table table-bordered table-striped">
|
42
|
-
<%
|
47
|
+
<% @abrt_report.abrt_report_response_solutions.each do |solution| %>
|
43
48
|
<tr>
|
44
49
|
<% if solution.url %>
|
45
50
|
<td><a href="<%= solution.url %>"><%= solution.cause %></a></td>
|
@@ -1,22 +1,30 @@
|
|
1
1
|
<% title @abrt_report.host.to_s %>
|
2
2
|
|
3
|
-
<%= title_actions link_to(_(
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
<%= title_actions link_to(_('Host details'), @abrt_report.host),
|
4
|
+
link_to(_('Other reports for this host'), host_abrt_reports_path(@abrt_report.host)),
|
5
|
+
link_to(_('Forward report'),
|
6
|
+
forward_abrt_report_path(@abrt_report),
|
7
|
+
:class => 'btn btn-success',
|
8
|
+
:method => :post,
|
9
|
+
:confirm => @abrt_report.forwarded_at ? _('The report has already been sent to the ABRT server. Send again and overwrite the previous response?') : nil),
|
10
|
+
display_delete_if_authorized(hash_for_abrt_report_path(:id => @abrt_report), :class => 'btn btn-danger')
|
11
11
|
%>
|
12
12
|
|
13
13
|
<div class="row">
|
14
14
|
<div class="col-md-12">
|
15
15
|
<table class="table table-bordered table-striped">
|
16
|
-
<tr
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
<tr>
|
17
|
+
<th><%= _('Reason') %></th>
|
18
|
+
<td><%= format_reason @abrt_report.reason %></td>
|
19
|
+
</tr>
|
20
|
+
<tr>
|
21
|
+
<th><%= _('First reported') %></th>
|
22
|
+
<td><%= @abrt_report.reported_at.getlocal %></td>
|
23
|
+
</tr>
|
24
|
+
<tr>
|
25
|
+
<th><%= _('Repeated') %></th>
|
26
|
+
<td><%= @abrt_report.count %></td>
|
27
|
+
</tr>
|
20
28
|
</table>
|
21
29
|
</div>
|
22
30
|
</div>
|
data/lib/foreman_abrt/engine.rb
CHANGED
@@ -14,7 +14,7 @@ module ForemanAbrt
|
|
14
14
|
end
|
15
15
|
|
16
16
|
# Add any db migrations
|
17
|
-
initializer
|
17
|
+
initializer 'foreman_abrt.load_app_instance_data' do |app|
|
18
18
|
app.config.paths['db/migrate'] += ForemanAbrt::Engine.paths['db/migrate'].existent
|
19
19
|
end
|
20
20
|
|
@@ -31,7 +31,7 @@ module ForemanAbrt
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# Add a new role
|
34
|
-
role
|
34
|
+
role 'ABRT reports handling', [:view_abrt_reports, :destroy_abrt_reports, :upload_abrt_reports, :forward_abrt_reports]
|
35
35
|
|
36
36
|
#add menu entry
|
37
37
|
menu :top_menu, :template,
|
data/lib/foreman_abrt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_abrt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Milata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -32,44 +32,45 @@ executables: []
|
|
32
32
|
extensions: []
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
|
-
- app/controllers/concerns/foreman_abrt/dashboard_controller_extensions.rb
|
36
|
-
- app/controllers/api/v2/abrt_reports_controller.rb
|
37
|
-
- app/controllers/abrt_reports_controller.rb
|
38
|
-
- app/assets/javascripts/abrt_reports.js
|
39
|
-
- app/assets/stylesheets/abrt_reports.css
|
40
|
-
- app/models/concerns/foreman_abrt/host_extensions.rb
|
41
|
-
- app/models/abrt_report.rb
|
42
|
-
- app/models/abrt_report_response_destination.rb
|
43
|
-
- app/models/abrt_report_response_solution.rb
|
44
|
-
- app/models/setting/abrt.rb
|
45
|
-
- app/helpers/abrt_reports_helper.rb
|
46
35
|
- app/overrides/add_host_bug_report_tab.rb
|
36
|
+
- app/assets/stylesheets/abrt_reports.css
|
37
|
+
- app/assets/javascripts/abrt_reports.js
|
47
38
|
- app/views/abrt_reports/_host_tab_pane.html.erb
|
48
39
|
- app/views/abrt_reports/_host_tab.html.erb
|
49
|
-
- app/views/abrt_reports/_show_response.html.erb
|
50
40
|
- app/views/abrt_reports/index.html.erb
|
41
|
+
- app/views/abrt_reports/_show_response.html.erb
|
51
42
|
- app/views/abrt_reports/_list.html.erb
|
52
43
|
- app/views/abrt_reports/show.html.erb
|
53
44
|
- app/views/dashboard/_foreman_abrt_widget.html.erb
|
45
|
+
- app/helpers/abrt_reports_helper.rb
|
46
|
+
- app/controllers/concerns/foreman_abrt/dashboard_controller_extensions.rb
|
47
|
+
- app/controllers/api/v2/abrt_reports_controller.rb
|
48
|
+
- app/controllers/abrt_reports_controller.rb
|
49
|
+
- app/models/setting/abrt.rb
|
50
|
+
- app/models/concerns/foreman_abrt/host_extensions.rb
|
51
|
+
- app/models/abrt_report.rb
|
52
|
+
- app/models/abrt_report_response_destination.rb
|
53
|
+
- app/models/abrt_report_response_solution.rb
|
54
54
|
- config/routes.rb
|
55
55
|
- db/migrate/20140414095631_create_abrt_reports.rb
|
56
56
|
- db/migrate/20140909170102_abrt_reports_drop_timestamps.rb
|
57
|
-
- lib/foreman_abrt/version.rb
|
58
57
|
- lib/foreman_abrt/engine.rb
|
58
|
+
- lib/foreman_abrt/version.rb
|
59
59
|
- lib/foreman_abrt.rb
|
60
60
|
- lib/tasks/foreman_abrt_tasks.rake
|
61
61
|
- LICENSE
|
62
62
|
- Rakefile
|
63
63
|
- README.md
|
64
|
-
- test/fixtures/abrt_reports.yml
|
65
|
-
- test/test_plugin_helper.rb
|
66
|
-
- test/functional/abrt_reports_controller_test.rb
|
67
64
|
- test/unit/abrt_report_test.rb
|
68
|
-
- test/unit/foreman_abrt_test.rb
|
69
65
|
- test/unit/helpers/abrt_reports_helper_test.rb
|
66
|
+
- test/unit/foreman_abrt_test.rb
|
67
|
+
- test/functional/abrt_reports_controller_test.rb
|
68
|
+
- test/fixtures/abrt_reports.yml
|
69
|
+
- test/test_plugin_helper.rb
|
70
70
|
- test/factories/foreman_abrt_factories.rb
|
71
71
|
homepage: http://github.com/abrt/foreman_abrt
|
72
|
-
licenses:
|
72
|
+
licenses:
|
73
|
+
- GPL-3.0
|
73
74
|
metadata: {}
|
74
75
|
post_install_message:
|
75
76
|
rdoc_options: []
|
@@ -92,10 +93,10 @@ signing_key:
|
|
92
93
|
specification_version: 4
|
93
94
|
summary: Display reports from Automatic Bug Reporting Tool
|
94
95
|
test_files:
|
95
|
-
- test/fixtures/abrt_reports.yml
|
96
|
-
- test/test_plugin_helper.rb
|
97
|
-
- test/functional/abrt_reports_controller_test.rb
|
98
96
|
- test/unit/abrt_report_test.rb
|
99
|
-
- test/unit/foreman_abrt_test.rb
|
100
97
|
- test/unit/helpers/abrt_reports_helper_test.rb
|
98
|
+
- test/unit/foreman_abrt_test.rb
|
99
|
+
- test/functional/abrt_reports_controller_test.rb
|
100
|
+
- test/fixtures/abrt_reports.yml
|
101
|
+
- test/test_plugin_helper.rb
|
101
102
|
- test/factories/foreman_abrt_factories.rb
|