Fixes bug #7915
---
src/bin/secstate | 10 ++++------
src/secstate/main.py | 4 ++--
src/secstate/util.py | 4 ----
3 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/src/bin/secstate b/src/bin/secstate
index f658dc9..3d8df51 100644
--- a/src/bin/secstate
+++ b/src/bin/secstate
@@ -125,9 +125,9 @@ def help(arg):
elif arg[0] == 'remove':
remove(['-h'])
elif arg[0] == 'select':
- select(['-h'])
+ select(['-h'], None)
elif arg[0] == 'deselect':
- select(['-h'])
+ select(['-h'], None)
elif arg[0] == 'audit':
audit(['-h'])
elif arg[0] == 'search':
@@ -183,17 +183,15 @@ def select(arguments, value):
sel = "de"
parser = OptionParser(usage="secstate %(sel)sselect <benchmark> [options]
[id]" % {'sel':sel})
- parser.add_option('-m', '--message', action='store',
type='string', dest='message',
- default=None, help="Adds message about %(sel)sselection"
% {'sel':sel})
parser.add_option('-r', '--recurse', action='store_true',
dest='recurse', default=False,
help="Recursively %(sel)sselect rules inside of groups or
benchmarks" % {'sel':sel})
(options, args) = parser.parse_args(arguments)
if len(args) == 1:
- if not sec_instance.select(args[0], args[0], value, recurse=options.recurse,
message=options.message):
+ if not sec_instance.select(args[0], args[0], value, recurse=options.recurse):
return -1
else:
for arg in args[1:]:
- if (not (sec_instance.select(args[0], arg, value, recurse=options.recurse,
message=options.message))):
+ if (not (sec_instance.select(args[0], arg, value,
recurse=options.recurse))):
return -1
def audit(arguments):
diff --git a/src/secstate/main.py b/src/secstate/main.py
index 711d335..d584ff5 100644
--- a/src/secstate/main.py
+++ b/src/secstate/main.py
@@ -511,13 +511,13 @@ class Secstate:
return True
- def select(self, benchmark_id, item_id, selected, recurse=False, message=None):
+ def select(self, benchmark_id, item_id, selected, recurse=False):
"""
Function: Set the specified item to be selected, as well as its
subelements
Input: Benchmark id, id of rule or group, boolean value to set the items
selected status
Output: Succes or failure
"""
- sel_dict = {'selected':selected, 'message':message}
+ sel_dict = {'selected':selected}
if not self.content.has_key(benchmark_id):
self.log.error("No benchmark %(id)s in datastore" %
{'id':benchmark_id})
diff --git a/src/secstate/util.py b/src/secstate/util.py
index b6a25e4..387b16e 100644
--- a/src/secstate/util.py
+++ b/src/secstate/util.py
@@ -397,10 +397,6 @@ def apply_changes_profile(benchmark):
select = oscap.xccdf.select_new()
select.item = id
select.selected = sel_dict['selected']
- if sel_dict['message']:
- text = oscap.common.text_new()
- text.text = str(sel_dict['message'])
- select.add_remark(text)
prof.add_select(select)
benchmark.add_profile(prof)
--
1.7.2.2