foreman_openscap 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e44b157d6a98bde81102199865d962801c45714f
|
4
|
+
data.tar.gz: a68bd3f0a7f14a5b434fb888926feb0d01e266e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 593b4ebec5ef8a449b3263c98fb041f223817ad369c526d17eb2b8626db36176b593c14abea960ea09c354850245ab8fac03984cc8f6876e0e15c37aee0a1496
|
7
|
+
data.tar.gz: ee4bc44b6d03ef9afbefdba3cf194582ffc05cc62df7356f1f3d4ed0a939fd2141cebf8d8a9a3dbd9f987ed62d89737400dea37f00ad412895c03063dbf395f2
|
@@ -51,8 +51,9 @@ module ::ProxyAPI
|
|
51
51
|
begin
|
52
52
|
parse(delete("arf/#{report.id}/#{cname}/#{report.reported_at.to_i}/#{report.policy_arf_report.digest}"))
|
53
53
|
rescue => e
|
54
|
-
|
55
|
-
logger.
|
54
|
+
msg = "Failed to destroy arf report with id #{report.id} on Smart Proxy, cause: #{e.message}"
|
55
|
+
logger.error msg
|
56
|
+
report.errors.add(:base, msg)
|
56
57
|
false
|
57
58
|
end
|
58
59
|
end
|
@@ -189,18 +189,22 @@ module ForemanOpenscap
|
|
189
189
|
end
|
190
190
|
|
191
191
|
def destroy_from_proxy
|
192
|
-
if host
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
end
|
192
|
+
if !host
|
193
|
+
destroy_from_proxy_warning "host"
|
194
|
+
elsif !policy
|
195
|
+
destroy_from_proxy_warning "policy"
|
196
|
+
elsif !openscap_proxy
|
197
|
+
destroy_from_proxy_warning "OpenSCAP proxy"
|
199
198
|
else
|
200
|
-
|
199
|
+
openscap_proxy_api.destroy_report(self, ForemanOpenscap::Helper::find_name_or_uuid_by_host(host))
|
201
200
|
end
|
202
201
|
end
|
203
202
|
|
203
|
+
def destroy_from_proxy_warning(associated)
|
204
|
+
logger.warn "Skipping deletion of report with id #{id} from proxy, no #{associated} associated with report"
|
205
|
+
true
|
206
|
+
end
|
207
|
+
|
204
208
|
def self.newline_to_space(string)
|
205
209
|
string.gsub(/ *\n+/, " ")
|
206
210
|
end
|
@@ -1,8 +1,10 @@
|
|
1
1
|
class RemoveArfReportsWithoutPolicy < ActiveRecord::Migration
|
2
2
|
def up
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
User.as_anonymous_admin do
|
4
|
+
ids_to_keep = ForemanOpenscap::ArfReport.unscoped.all.joins(:policy_arf_report).pluck(:id)
|
5
|
+
ForemanOpenscap::ArfReport.unscoped.where.not(:id => ids_to_keep).find_in_batches do |batch|
|
6
|
+
batch.map(&:destroy!)
|
7
|
+
end
|
6
8
|
end
|
7
9
|
end
|
8
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_openscap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- slukasik@redhat.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|