foreman_openscap 0.7.11 → 0.7.12
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: cc3b45bd13e06f6643cd988849bce306296faf54
|
4
|
+
data.tar.gz: fc17630400c564c7d3144bf49e57786400a1e4e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f7f43276f7c01c32f019dc1621135e5d499daa534af1fe3818763cb1a673bcd5613a7a887e734a5880e5c4c9f3eeb0e9c08e57f31588c49163a3266a5658b88
|
7
|
+
data.tar.gz: 79a5d3c58b7b2d604f3ffb499a68776247d052d16897fd50f771193b72623111888231d34b882960ab23d698120704cabd1b3f1444858c0f67adf76036f3f094
|
@@ -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
|
@@ -177,18 +177,22 @@ module ForemanOpenscap
|
|
177
177
|
end
|
178
178
|
|
179
179
|
def destroy_from_proxy
|
180
|
-
if host
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
end
|
180
|
+
if !host
|
181
|
+
destroy_from_proxy_warning "host"
|
182
|
+
elsif !policy
|
183
|
+
destroy_from_proxy_warning "policy"
|
184
|
+
elsif !openscap_proxy
|
185
|
+
destroy_from_proxy_warning "OpenSCAP proxy"
|
187
186
|
else
|
188
|
-
|
187
|
+
openscap_proxy_api.destroy_report(self, ForemanOpenscap::Helper::find_name_or_uuid_by_host(host))
|
189
188
|
end
|
190
189
|
end
|
191
190
|
|
191
|
+
def destroy_from_proxy_warning(associated)
|
192
|
+
logger.warn "Skipping deletion of report with id #{id} from proxy, no #{associated} associated with report"
|
193
|
+
true
|
194
|
+
end
|
195
|
+
|
192
196
|
def self.newline_to_space(string)
|
193
197
|
string.gsub(/ *\n+/, " ")
|
194
198
|
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.7.
|
4
|
+
version: 0.7.12
|
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:
|
11
|
+
date: 2018-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|