diff options
author | Martin Sivak <msivak@redhat.com> | 2010-09-01 11:52:19 +0200 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2010-09-01 11:52:19 +0200 |
commit | 7cdc5637bd39e78413ce48321abd31438a1a5bd4 (patch) | |
tree | 3c35d3810a7c73a233173fc71d796dd54a3934fc | |
parent | ab18cf300509a15075bae20f63ce35c2afa0dd97 (diff) | |
download | firstaidkit-7cdc5637bd39e78413ce48321abd31438a1a5bd4.tar.gz firstaidkit-7cdc5637bd39e78413ce48321abd31438a1a5bd4.tar.xz firstaidkit-7cdc5637bd39e78413ce48321abd31438a1a5bd4.zip |
Fixes in openscap interface required new release, so there it is
-rw-r--r-- | firstaidkit.spec | 4 | ||||
-rw-r--r-- | plugins/openscap_plugin.py | 17 | ||||
-rw-r--r-- | setup.py | 2 |
3 files changed, 18 insertions, 5 deletions
diff --git a/firstaidkit.spec b/firstaidkit.spec index c61467e..693eacc 100644 --- a/firstaidkit.spec +++ b/firstaidkit.spec @@ -4,7 +4,7 @@ %define debug_package %{nil} Name: firstaidkit -Version: 0.2.14 +Version: 0.2.15 Release: 1%{?dist} Summary: System Rescue Tool @@ -99,7 +99,7 @@ password. Group: Applications/System Summary: OpenSCAP plugin for FirstAidKit Requires: %{name} = %{version}-%{release} -Requires: openscap >= 0.6.1-1 +Requires: openscap >= 0.6.3 BuildArch: noarch %description plugin-openscap diff --git a/plugins/openscap_plugin.py b/plugins/openscap_plugin.py index 2c9d0a5..ace9c41 100644 --- a/plugins/openscap_plugin.py +++ b/plugins/openscap_plugin.py @@ -63,7 +63,12 @@ class OpenSCAPPlugin(Plugin): self._result=ReturnSuccess def policy(self): - # Select the last available policy + # Select the only available policy + if len(self._xccdf_policy_model.policies)==1: + self._result=ReturnSuccess + self._policy = self._xccdf_policy_model.policies[0] + return + all_policies = map(lambda p: ( p.id, p.profile and len(p.profile.title) and p.profile.title[0].text or "Default profile", @@ -95,7 +100,11 @@ class OpenSCAPPlugin(Plugin): self._result=ReturnSuccess def rules(self): - all_rules = self._policy.get_rules() + all_rules = self._policy.get_selects() + if len(all_rules) == 0: + self._result=ReturnSuccess + return + preprocess_rules = lambda x: (x.item, self._policy.model.benchmark.get_item(x.item).title[0].text, x.selected and True, @@ -127,6 +136,10 @@ class OpenSCAPPlugin(Plugin): def tailoring(self): tailor_items = self._policy.get_tailor_items() + if len(tailor_items) == 0: + self._result=ReturnSuccess + return + preproces_tailor_items = lambda i: (i["id"], i["titles"][i["lang"]] or "", i["selected"][1] or "", @@ -58,7 +58,7 @@ cmdclass = { } setup(name='firstaidkit', - version='0.2.14', + version='0.2.15', description='System Rescue Tool', author='Martin Sivak / Joel Andres Granados', author_email='msivak@redhat.com / jgranado@redhat.com', |