hammer_cli_foreman_openscap 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hammer_cli_foreman_openscap.rb +6 -4
- data/lib/hammer_cli_foreman_openscap/arf_report.rb +25 -11
- data/lib/hammer_cli_foreman_openscap/host.rb +2 -0
- data/lib/hammer_cli_foreman_openscap/host_extensions.rb +9 -0
- data/lib/hammer_cli_foreman_openscap/hostgroup.rb +2 -0
- data/lib/hammer_cli_foreman_openscap/hostgroup_extensions.rb +9 -0
- data/lib/hammer_cli_foreman_openscap/i18n.rb +24 -0
- data/lib/hammer_cli_foreman_openscap/id_resolver.rb +1 -1
- data/lib/hammer_cli_foreman_openscap/policy.rb +4 -2
- data/lib/hammer_cli_foreman_openscap/scap_content.rb +16 -9
- data/lib/hammer_cli_foreman_openscap/version.rb +1 -1
- data/locale/Makefile +65 -0
- data/locale/README.md +18 -0
- data/locale/en/hammer_cli_foreman_openscap.po +204 -0
- data/locale/hammer_cli_foreman_openscap.pot +281 -0
- data/test/functional/scap_content_test.rb +27 -0
- data/test/unit/arf_report_test.rb +3 -2
- data/test/unit/policy_test.rb +3 -1
- data/test/unit/scap_content_test.rb +1 -1
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d97687adbccb06adceff03dfe0168eb82b41f426
|
4
|
+
data.tar.gz: 317708f0cc4013865c8d2eae91a80cc88259a088
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b66779accf7d6b1849d6c61341f727604f89570fbae6b544fdbd22e8a99df20d5f7bff5d4b16de9c34d42f65fbbb970d3ff1be2346a9d4f015ed020e8a128aa4
|
7
|
+
data.tar.gz: c41765bceb936bf3cc9c45920b86d2ae8d097e19f0cd675da426e373bdfcd673ef211bc3ef0d32a5685ea15e5b626785efffd4bc13ab4d909d1619a85a550afc
|
@@ -4,25 +4,27 @@ require 'hammer_cli_foreman_openscap/id_resolver'
|
|
4
4
|
require 'hammer_cli_foreman_openscap/commands'
|
5
5
|
require 'hammer_cli_foreman_openscap/error'
|
6
6
|
require 'hammer_cli_foreman_openscap/exception_handler'
|
7
|
+
require 'hammer_cli_foreman_openscap/hostgroup'
|
8
|
+
require 'hammer_cli_foreman_openscap/host'
|
7
9
|
|
8
10
|
module HammerCLIForemanOpenscap
|
9
11
|
def self.exception_handler_class
|
10
12
|
HammerCLIForemanOpenscap::ExceptionHandler
|
11
13
|
end
|
12
14
|
|
13
|
-
HammerCLI::MainCommand.lazy_subcommand("arf-report", _("Manipulate compliance reports
|
15
|
+
HammerCLI::MainCommand.lazy_subcommand("arf-report", _("Manipulate compliance reports"),
|
14
16
|
"HammerCLIForemanOpenscap::ArfReport",
|
15
17
|
"hammer_cli_foreman_openscap/arf_report")
|
16
18
|
|
17
|
-
HammerCLI::MainCommand.lazy_subcommand("policy", _("Manipulate policies
|
19
|
+
HammerCLI::MainCommand.lazy_subcommand("policy", _("Manipulate policies"),
|
18
20
|
"HammerCLIForemanOpenscap::Policy",
|
19
21
|
"hammer_cli_foreman_openscap/policy")
|
20
22
|
|
21
|
-
HammerCLI::MainCommand.lazy_subcommand("scap-content", _("Manipulate
|
23
|
+
HammerCLI::MainCommand.lazy_subcommand("scap-content", _("Manipulate SCAP contents"),
|
22
24
|
"HammerCLIForemanOpenscap::ScapContent",
|
23
25
|
"hammer_cli_foreman_openscap/scap_content")
|
24
26
|
|
25
|
-
HammerCLI::MainCommand.lazy_subcommand("tailoring-file", _("Manipulate Tailoring files
|
27
|
+
HammerCLI::MainCommand.lazy_subcommand("tailoring-file", _("Manipulate Tailoring files"),
|
26
28
|
"HammerCLIForemanOpenscap::TailoringFile",
|
27
29
|
"hammer_cli_foreman_openscap/tailoring_file")
|
28
30
|
end
|
@@ -6,8 +6,16 @@ module HammerCLIForemanOpenscap
|
|
6
6
|
class ListCommand < HammerCLIForeman::ListCommand
|
7
7
|
output do
|
8
8
|
field :id, _("Id")
|
9
|
-
field :host, _("Host")
|
10
9
|
field :reported_at, _("Reported at")
|
10
|
+
from :host do
|
11
|
+
field :name, _("Host name")
|
12
|
+
end
|
13
|
+
from :openscap_proxy do
|
14
|
+
field :name, _("OpenSCAP proxy name")
|
15
|
+
end
|
16
|
+
from :policy do
|
17
|
+
field :name, _("Policy name")
|
18
|
+
end
|
11
19
|
field :passed, _("Passed")
|
12
20
|
field :failed, _("Failed")
|
13
21
|
field :othered, _("Othered")
|
@@ -17,33 +25,39 @@ module HammerCLIForemanOpenscap
|
|
17
25
|
|
18
26
|
class InfoCommand < HammerCLIForemanOpenscap::InfoCommand
|
19
27
|
output ListCommand.output_definition do
|
20
|
-
|
21
|
-
|
22
|
-
|
28
|
+
from :host do
|
29
|
+
field :id, _("Host Id")
|
30
|
+
end
|
31
|
+
from :openscap_proxy do
|
32
|
+
field :id, _("OpenSCAP proxy Id")
|
33
|
+
end
|
34
|
+
from :policy do
|
35
|
+
field :id, _("Policy Id")
|
36
|
+
end
|
23
37
|
HammerCLIForeman::References.taxonomies(self)
|
24
38
|
end
|
25
39
|
|
26
40
|
build_options
|
27
41
|
end
|
28
42
|
|
29
|
-
class DeleteCommand <
|
30
|
-
success_message _("
|
31
|
-
failure_message _("Could not delete the
|
43
|
+
class DeleteCommand < HammerCLIForemanOpenscap::DeleteCommand
|
44
|
+
success_message _("ARF report deleted")
|
45
|
+
failure_message _("Could not delete the ARF report")
|
32
46
|
|
33
47
|
build_options
|
34
48
|
end
|
35
49
|
|
36
50
|
class DownloadCommand < HammerCLIForemanOpenscap::DownloadCommand
|
37
|
-
success_message _("
|
38
|
-
failure_message _("Could not download the
|
51
|
+
success_message _("ARF report downloaded, saved to: ")
|
52
|
+
failure_message _("Could not download the ARF report")
|
39
53
|
|
40
54
|
build_options
|
41
55
|
end
|
42
56
|
|
43
57
|
class DownloadHtmlCommand < HammerCLIForemanOpenscap::DownloadCommand
|
44
58
|
action :download_html
|
45
|
-
success_message _("
|
46
|
-
failure_message _("Could not download the
|
59
|
+
success_message _("ARF report in HTML downloaded, saved to: ")
|
60
|
+
failure_message _("Could not download the ARF report in HTML")
|
47
61
|
|
48
62
|
def self.command_name(name = "download-html")
|
49
63
|
super(name)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'hammer_cli/i18n'
|
2
|
+
|
3
|
+
module HammerCLIForemanOpenscap
|
4
|
+
module I18n
|
5
|
+
|
6
|
+
class LocaleDomain < HammerCLI::I18n::LocaleDomain
|
7
|
+
|
8
|
+
def translated_files
|
9
|
+
Dir.glob(File.join(File.dirname(__FILE__), '../**/*.rb'))
|
10
|
+
end
|
11
|
+
|
12
|
+
def locale_dir
|
13
|
+
File.join(File.dirname(__FILE__), '../../locale')
|
14
|
+
end
|
15
|
+
|
16
|
+
def domain_name
|
17
|
+
'hammer_cli_foreman_openscap'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
HammerCLI::I18n.add_domain(HammerCLIForemanOpenscap::I18n::LocaleDomain.new)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module HammerCLIForemanOpenscap
|
2
2
|
class Searchables < HammerCLIForeman::Searchables
|
3
3
|
SEARCHABLES = {
|
4
|
-
:scap_content => [s("title", _("
|
4
|
+
:scap_content => [s("title", _("SCAP content title"))],
|
5
5
|
:arf_report => [],
|
6
6
|
:policy => [s_name(_("Policy name"))],
|
7
7
|
:tailoring_file => [s_name('Tailoring file name')]
|
@@ -16,12 +16,14 @@ module HammerCLIForemanOpenscap
|
|
16
16
|
output ListCommand.output_definition do
|
17
17
|
field :period, _("Period")
|
18
18
|
field :weekday, _("Weekday")
|
19
|
+
field :day_of_month, _("Day of month")
|
19
20
|
field :cron_line, _("Cron line")
|
20
|
-
field :scap_content_id, _("
|
21
|
-
field :scap_content_profile_id, _("
|
21
|
+
field :scap_content_id, _("SCAP content Id")
|
22
|
+
field :scap_content_profile_id, _("SCAP Content profile Id")
|
22
23
|
field :tailoring_file_id, _("Tailoring file Id")
|
23
24
|
field :tailoring_file_profile_id, _("Tailoring file profile Id")
|
24
25
|
HammerCLIForeman::References.taxonomies(self)
|
26
|
+
HammerCLIForeman::References.hostgroups(self)
|
25
27
|
end
|
26
28
|
build_options
|
27
29
|
end
|
@@ -12,17 +12,17 @@ module HammerCLIForemanOpenscap
|
|
12
12
|
end
|
13
13
|
|
14
14
|
class CreateCommand < HammerCLIForemanOpenscap::CreateWithScapFileCommand
|
15
|
-
success_message _("
|
16
|
-
failure_message _("Failed to create
|
15
|
+
success_message _("SCAP content successfully created")
|
16
|
+
failure_message _("Failed to create SCAP content")
|
17
17
|
|
18
|
-
scap_file_option _("
|
18
|
+
scap_file_option _("SCAP content file")
|
19
19
|
|
20
20
|
build_options
|
21
21
|
end
|
22
22
|
|
23
23
|
class DeleteCommand < HammerCLIForemanOpenscap::DeleteCommand
|
24
|
-
success_message _("
|
25
|
-
failure_message _("Could not delete
|
24
|
+
success_message _("SCAP content deleted")
|
25
|
+
failure_message _("Could not delete SCAP content")
|
26
26
|
|
27
27
|
build_options
|
28
28
|
end
|
@@ -32,7 +32,7 @@ module HammerCLIForemanOpenscap
|
|
32
32
|
field :created_at, _("Created at")
|
33
33
|
field :original_filename, _("Original filename")
|
34
34
|
|
35
|
-
collection :scap_content_profiles, _("
|
35
|
+
collection :scap_content_profiles, _("SCAP content profiles") do
|
36
36
|
field :id, _("Id")
|
37
37
|
field :profile_id, _("Profile id")
|
38
38
|
field :title, _("Title")
|
@@ -43,15 +43,22 @@ module HammerCLIForemanOpenscap
|
|
43
43
|
end
|
44
44
|
|
45
45
|
class UpdateCommand < HammerCLIForemanOpenscap::UpdateCommand
|
46
|
-
success_message _("
|
47
|
-
failure_message _("Could not update
|
46
|
+
success_message _("SCAP content updated")
|
47
|
+
failure_message _("Could not update SCAP content")
|
48
48
|
|
49
|
-
option "--scap-file", "SCAP_FILE", _("
|
49
|
+
option "--scap-file", "SCAP_FILE", _("SCAP content file"),
|
50
50
|
:attribute_name => :option_scap_file,
|
51
51
|
:format => HammerCLI::Options::Normalizers::File.new
|
52
52
|
build_options
|
53
53
|
end
|
54
54
|
|
55
|
+
class DownloadCommand < HammerCLIForemanOpenscap::DownloadXmlCommand
|
56
|
+
success_message _("SCAP content file downloaded, saved to: ")
|
57
|
+
failure_message _("Could not download the SCAP content file")
|
58
|
+
|
59
|
+
build_options
|
60
|
+
end
|
61
|
+
|
55
62
|
autoload_subcommands
|
56
63
|
end
|
57
64
|
end
|
data/locale/Makefile
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
#
|
2
|
+
# Makefile for PO merging and MO generation. More info in the README.
|
3
|
+
#
|
4
|
+
# make all-mo (default) - generate MO files
|
5
|
+
# make check - check translations using translate-tool
|
6
|
+
# make tx-update - download and merge translations from Transifex
|
7
|
+
# make clean - clean everything
|
8
|
+
#
|
9
|
+
DOMAIN = hammer_cli_foreman_openscap
|
10
|
+
VERSION = $(shell ruby -e 'require "rubygems";spec = Gem::Specification::load("../hammer_cli_foreman_openscap.gemspec");puts spec.version')
|
11
|
+
POTFILE = $(DOMAIN).pot
|
12
|
+
MOFILE = $(DOMAIN).mo
|
13
|
+
POFILES = $(shell find . -name '*.po')
|
14
|
+
MOFILES = $(patsubst %.po,%.mo,$(POFILES))
|
15
|
+
POXFILES = $(patsubst %.po,%.pox,$(POFILES))
|
16
|
+
|
17
|
+
%.mo: %.po
|
18
|
+
mkdir -p $(shell dirname $@)/LC_MESSAGES
|
19
|
+
msgfmt -o $(shell dirname $@)/LC_MESSAGES/$(MOFILE) $<
|
20
|
+
|
21
|
+
# Generate MO files from PO files
|
22
|
+
all-mo: $(MOFILES)
|
23
|
+
|
24
|
+
# Check for malformed strings
|
25
|
+
%.pox: %.po
|
26
|
+
msgfmt -c $<
|
27
|
+
pofilter --nofuzzy -t variables -t blank -t urls -t emails -t long -t newlines \
|
28
|
+
-t endwhitespace -t endpunc -t puncspacing -t options -t printf -t validchars --gnome $< > $@
|
29
|
+
cat $@
|
30
|
+
! grep -q msgid $@
|
31
|
+
|
32
|
+
check: $(POXFILES)
|
33
|
+
msgfmt -c ${POTFILE}
|
34
|
+
|
35
|
+
# Merge PO files
|
36
|
+
update-po:
|
37
|
+
for f in $(shell find ./ -name "*.po") ; do \
|
38
|
+
msgmerge -N --backup=none -U $$f ${POTFILE} ; \
|
39
|
+
done
|
40
|
+
|
41
|
+
# Unify duplicate translations
|
42
|
+
uniq-po:
|
43
|
+
for f in $(shell find ./ -name "*.po") ; do \
|
44
|
+
msguniq $$f -o $$f ; \
|
45
|
+
done
|
46
|
+
|
47
|
+
tx-pull:
|
48
|
+
tx pull -f
|
49
|
+
for f in $(POFILES) ; do \
|
50
|
+
sed -i 's/^\("Project-Id-Version: \).*$$/\1$(DOMAIN) $(VERSION)\\n"/' $$f; \
|
51
|
+
done
|
52
|
+
-git commit -a -m "i18n - extracting new, pulling from tx"
|
53
|
+
|
54
|
+
extract-strings:
|
55
|
+
bundle exec rake gettext:find
|
56
|
+
|
57
|
+
reset-po:
|
58
|
+
# merging po files is unnecessary when using transifex.com
|
59
|
+
git checkout -- ../locale/*/*po
|
60
|
+
|
61
|
+
tx-update: tx-pull extract-strings reset-po $(MOFILES)
|
62
|
+
# amend mo files
|
63
|
+
git add ../locale/*/LC_MESSAGES
|
64
|
+
git commit -a --amend -m "i18n - extracting new, pulling from tx"
|
65
|
+
-echo Changes commited!
|
data/locale/README.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Updating the translations
|
2
|
+
-------------------------
|
3
|
+
|
4
|
+
1. Check if there are any new languages with progress more than 50% on [transifex](https://www.transifex.com/projects/p/foreman/resource/hammer-cli-foreman-openscap/). If so, do the following for each of the new languages:
|
5
|
+
|
6
|
+
```
|
7
|
+
mkdir locale/<lang>
|
8
|
+
cp locale/hammer_cli_foreman_openscap.pot locale/<lang>/hammer_cli_foreman_discovery.po
|
9
|
+
```
|
10
|
+
2. Make sure you have `transifex-client` installed
|
11
|
+
|
12
|
+
3. Update the translations. From GIT repo root directory run:
|
13
|
+
|
14
|
+
```
|
15
|
+
make -C locale tx-update
|
16
|
+
```
|
17
|
+
|
18
|
+
It will download translations from transifex, generates `mo` files, updates strings in `pot` file and wraps all the changes in a new commit. Transifex automatically updates its strings when the commit is pushed to Github.
|
@@ -0,0 +1,204 @@
|
|
1
|
+
# English translations for hammer_cli_foreman_openscap package.
|
2
|
+
# Copyright (C) 2017 THE PACKAGE'S COPYRIGHT HOLDER
|
3
|
+
# This file is distributed under the same license as the hammer_cli_foreman_openscap package.
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2017.
|
5
|
+
#
|
6
|
+
msgid ""
|
7
|
+
msgstr ""
|
8
|
+
"Project-Id-Version: hammer_cli_foreman_openscap 0.1.4\n"
|
9
|
+
"Report-Msgid-Bugs-To: \n"
|
10
|
+
"PO-Revision-Date: 2017-09-08 15:57-0400\n"
|
11
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
12
|
+
"Language-Team: English\n"
|
13
|
+
"Language: en\n"
|
14
|
+
"MIME-Version: 1.0\n"
|
15
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
16
|
+
"Content-Transfer-Encoding: 8bit\n"
|
17
|
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
18
|
+
"\n"
|
19
|
+
|
20
|
+
msgid "Manipulate compliance reports"
|
21
|
+
msgstr ""
|
22
|
+
|
23
|
+
msgid "Manipulate policies"
|
24
|
+
msgstr ""
|
25
|
+
|
26
|
+
msgid "Manipulate SCAP contents"
|
27
|
+
msgstr ""
|
28
|
+
|
29
|
+
msgid "Manipulate Tailoring files"
|
30
|
+
msgstr ""
|
31
|
+
|
32
|
+
msgid "Id"
|
33
|
+
msgstr ""
|
34
|
+
|
35
|
+
msgid "Host"
|
36
|
+
msgstr ""
|
37
|
+
|
38
|
+
msgid "Reported at"
|
39
|
+
msgstr ""
|
40
|
+
|
41
|
+
msgid "Passed"
|
42
|
+
msgstr ""
|
43
|
+
|
44
|
+
msgid "Failed"
|
45
|
+
msgstr ""
|
46
|
+
|
47
|
+
msgid "Othered"
|
48
|
+
msgstr ""
|
49
|
+
|
50
|
+
msgid "Host Id"
|
51
|
+
msgstr ""
|
52
|
+
|
53
|
+
msgid "OpenSCAP proxy Id"
|
54
|
+
msgstr ""
|
55
|
+
|
56
|
+
msgid "OpenSCAP proxy name"
|
57
|
+
msgstr ""
|
58
|
+
|
59
|
+
msgid "ARF report deleted"
|
60
|
+
msgstr ""
|
61
|
+
|
62
|
+
msgid "Could not delete the ARF report"
|
63
|
+
msgstr ""
|
64
|
+
|
65
|
+
msgid "ARF report downloaded, saved to: "
|
66
|
+
msgstr ""
|
67
|
+
|
68
|
+
msgid "Could not download the ARF report"
|
69
|
+
msgstr ""
|
70
|
+
|
71
|
+
msgid "ARF report in HTML downloaded, saved to: "
|
72
|
+
msgstr ""
|
73
|
+
|
74
|
+
msgid "Could not download the ARF report in HTML"
|
75
|
+
msgstr ""
|
76
|
+
|
77
|
+
msgid "Path to directory where downloaded file will be saved"
|
78
|
+
msgstr ""
|
79
|
+
|
80
|
+
msgid "SCAP content title"
|
81
|
+
msgstr ""
|
82
|
+
|
83
|
+
msgid "Policy name"
|
84
|
+
msgstr ""
|
85
|
+
|
86
|
+
msgid "Name to search by"
|
87
|
+
msgstr ""
|
88
|
+
|
89
|
+
msgid "Name"
|
90
|
+
msgstr ""
|
91
|
+
|
92
|
+
msgid "Created at"
|
93
|
+
msgstr ""
|
94
|
+
|
95
|
+
msgid "Period"
|
96
|
+
msgstr ""
|
97
|
+
|
98
|
+
msgid "Weekday"
|
99
|
+
msgstr ""
|
100
|
+
|
101
|
+
msgid "Day of month"
|
102
|
+
msgstr ""
|
103
|
+
|
104
|
+
msgid "Cron line"
|
105
|
+
msgstr ""
|
106
|
+
|
107
|
+
msgid "SCAP content Id"
|
108
|
+
msgstr ""
|
109
|
+
|
110
|
+
msgid "SCAP Content profile Id"
|
111
|
+
msgstr ""
|
112
|
+
|
113
|
+
msgid "Tailoring file Id"
|
114
|
+
msgstr ""
|
115
|
+
|
116
|
+
msgid "Tailoring file profile Id"
|
117
|
+
msgstr ""
|
118
|
+
|
119
|
+
msgid "Policy has been deleted"
|
120
|
+
msgstr ""
|
121
|
+
|
122
|
+
msgid "Could not delete the policy"
|
123
|
+
msgstr ""
|
124
|
+
|
125
|
+
msgid "Policy created"
|
126
|
+
msgstr ""
|
127
|
+
|
128
|
+
msgid "Could not create the policy"
|
129
|
+
msgstr ""
|
130
|
+
|
131
|
+
msgid "Policy updated"
|
132
|
+
msgstr ""
|
133
|
+
|
134
|
+
msgid "Could not update the policy"
|
135
|
+
msgstr ""
|
136
|
+
|
137
|
+
msgid "Title"
|
138
|
+
msgstr ""
|
139
|
+
|
140
|
+
msgid "SCAP content successfully created"
|
141
|
+
msgstr ""
|
142
|
+
|
143
|
+
msgid "Failed to create SCAP content"
|
144
|
+
msgstr ""
|
145
|
+
|
146
|
+
msgid "SCAP content file"
|
147
|
+
msgstr ""
|
148
|
+
|
149
|
+
msgid "SCAP content deleted"
|
150
|
+
msgstr ""
|
151
|
+
|
152
|
+
msgid "Could not delete SCAP content"
|
153
|
+
msgstr ""
|
154
|
+
|
155
|
+
msgid "Original filename"
|
156
|
+
msgstr ""
|
157
|
+
|
158
|
+
msgid "SCAP content profiles"
|
159
|
+
msgstr ""
|
160
|
+
|
161
|
+
msgid "Profile id"
|
162
|
+
msgstr ""
|
163
|
+
|
164
|
+
msgid "SCAP content updated"
|
165
|
+
msgstr ""
|
166
|
+
|
167
|
+
msgid "Could not update SCAP content"
|
168
|
+
msgstr ""
|
169
|
+
|
170
|
+
msgid "SCAP content file downloaded, saved to: "
|
171
|
+
msgstr ""
|
172
|
+
|
173
|
+
msgid "Could not download the SCAP content file"
|
174
|
+
msgstr ""
|
175
|
+
|
176
|
+
msgid "Tailoring file successfully created"
|
177
|
+
msgstr ""
|
178
|
+
|
179
|
+
msgid "Failed to create Tailoring file"
|
180
|
+
msgstr ""
|
181
|
+
|
182
|
+
msgid "Tailoring file content"
|
183
|
+
msgstr ""
|
184
|
+
|
185
|
+
msgid "Tailoring file deleted"
|
186
|
+
msgstr ""
|
187
|
+
|
188
|
+
msgid "Could not delete Tailoring file"
|
189
|
+
msgstr ""
|
190
|
+
|
191
|
+
msgid "Tailoring file profiles"
|
192
|
+
msgstr ""
|
193
|
+
|
194
|
+
msgid "Tailoring file updated"
|
195
|
+
msgstr ""
|
196
|
+
|
197
|
+
msgid "Could not update Tailoring file"
|
198
|
+
msgstr ""
|
199
|
+
|
200
|
+
msgid "Tailoring file downloaded, saved to: "
|
201
|
+
msgstr ""
|
202
|
+
|
203
|
+
msgid "Could not download the Tailoring file"
|
204
|
+
msgstr ""
|
@@ -0,0 +1,281 @@
|
|
1
|
+
# SOME DESCRIPTIVE TITLE.
|
2
|
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3
|
+
# This file is distributed under the same license as the hammer_cli_foreman_openscap package.
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5
|
+
#
|
6
|
+
#, fuzzy
|
7
|
+
msgid ""
|
8
|
+
msgstr ""
|
9
|
+
"Project-Id-Version: hammer_cli_foreman_openscap 0.1.4\n"
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
11
|
+
"POT-Creation-Date: 2017-09-08 16:19-0400\n"
|
12
|
+
"PO-Revision-Date: 2017-09-08 16:19-0400\n"
|
13
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15
|
+
"Language: \n"
|
16
|
+
"MIME-Version: 1.0\n"
|
17
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
18
|
+
"Content-Transfer-Encoding: 8bit\n"
|
19
|
+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
20
|
+
|
21
|
+
#: ../lib/hammer_cli_foreman_openscap.rb:13
|
22
|
+
msgid "Manipulate compliance reports"
|
23
|
+
msgstr ""
|
24
|
+
|
25
|
+
#: ../lib/hammer_cli_foreman_openscap.rb:17
|
26
|
+
msgid "Manipulate policies"
|
27
|
+
msgstr ""
|
28
|
+
|
29
|
+
#: ../lib/hammer_cli_foreman_openscap.rb:21
|
30
|
+
msgid "Manipulate SCAP contents"
|
31
|
+
msgstr ""
|
32
|
+
|
33
|
+
#: ../lib/hammer_cli_foreman_openscap.rb:25
|
34
|
+
msgid "Manipulate Tailoring files"
|
35
|
+
msgstr ""
|
36
|
+
|
37
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:8
|
38
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:8
|
39
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:8
|
40
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:36
|
41
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:8
|
42
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:36
|
43
|
+
msgid "Id"
|
44
|
+
msgstr ""
|
45
|
+
|
46
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:9
|
47
|
+
msgid "Host"
|
48
|
+
msgstr ""
|
49
|
+
|
50
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:10
|
51
|
+
msgid "Reported at"
|
52
|
+
msgstr ""
|
53
|
+
|
54
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:11
|
55
|
+
msgid "Passed"
|
56
|
+
msgstr ""
|
57
|
+
|
58
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:12
|
59
|
+
msgid "Failed"
|
60
|
+
msgstr ""
|
61
|
+
|
62
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:13
|
63
|
+
msgid "Othered"
|
64
|
+
msgstr ""
|
65
|
+
|
66
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:20
|
67
|
+
msgid "Host Id"
|
68
|
+
msgstr ""
|
69
|
+
|
70
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:21
|
71
|
+
msgid "OpenSCAP proxy Id"
|
72
|
+
msgstr ""
|
73
|
+
|
74
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:22
|
75
|
+
msgid "OpenSCAP proxy name"
|
76
|
+
msgstr ""
|
77
|
+
|
78
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:30
|
79
|
+
msgid "ARF report deleted"
|
80
|
+
msgstr ""
|
81
|
+
|
82
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:31
|
83
|
+
msgid "Could not delete the ARF report"
|
84
|
+
msgstr ""
|
85
|
+
|
86
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:37
|
87
|
+
msgid "ARF report downloaded, saved to: "
|
88
|
+
msgstr ""
|
89
|
+
|
90
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:38
|
91
|
+
msgid "Could not download the ARF report"
|
92
|
+
msgstr ""
|
93
|
+
|
94
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:45
|
95
|
+
msgid "ARF report in HTML downloaded, saved to: "
|
96
|
+
msgstr ""
|
97
|
+
|
98
|
+
#: ../lib/hammer_cli_foreman_openscap/arf_report.rb:46
|
99
|
+
msgid "Could not download the ARF report in HTML"
|
100
|
+
msgstr ""
|
101
|
+
|
102
|
+
#: ../lib/hammer_cli_foreman_openscap/commands.rb:81
|
103
|
+
msgid "Path to directory where downloaded file will be saved"
|
104
|
+
msgstr ""
|
105
|
+
|
106
|
+
#: ../lib/hammer_cli_foreman_openscap/id_resolver.rb:4
|
107
|
+
msgid "SCAP content title"
|
108
|
+
msgstr ""
|
109
|
+
|
110
|
+
#: ../lib/hammer_cli_foreman_openscap/id_resolver.rb:6
|
111
|
+
msgid "Policy name"
|
112
|
+
msgstr ""
|
113
|
+
|
114
|
+
#: ../lib/hammer_cli_foreman_openscap/id_resolver.rb:10
|
115
|
+
msgid "Name to search by"
|
116
|
+
msgstr ""
|
117
|
+
|
118
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:9
|
119
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:9
|
120
|
+
msgid "Name"
|
121
|
+
msgstr ""
|
122
|
+
|
123
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:10
|
124
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:32
|
125
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:32
|
126
|
+
msgid "Created at"
|
127
|
+
msgstr ""
|
128
|
+
|
129
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:17
|
130
|
+
msgid "Period"
|
131
|
+
msgstr ""
|
132
|
+
|
133
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:18
|
134
|
+
msgid "Weekday"
|
135
|
+
msgstr ""
|
136
|
+
|
137
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:19
|
138
|
+
msgid "Day of month"
|
139
|
+
msgstr ""
|
140
|
+
|
141
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:20
|
142
|
+
msgid "Cron line"
|
143
|
+
msgstr ""
|
144
|
+
|
145
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:21
|
146
|
+
msgid "SCAP content Id"
|
147
|
+
msgstr ""
|
148
|
+
|
149
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:22
|
150
|
+
msgid "SCAP Content profile Id"
|
151
|
+
msgstr ""
|
152
|
+
|
153
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:23
|
154
|
+
msgid "Tailoring file Id"
|
155
|
+
msgstr ""
|
156
|
+
|
157
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:24
|
158
|
+
msgid "Tailoring file profile Id"
|
159
|
+
msgstr ""
|
160
|
+
|
161
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:32
|
162
|
+
msgid "Policy has been deleted"
|
163
|
+
msgstr ""
|
164
|
+
|
165
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:33
|
166
|
+
msgid "Could not delete the policy"
|
167
|
+
msgstr ""
|
168
|
+
|
169
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:40
|
170
|
+
msgid "Policy created"
|
171
|
+
msgstr ""
|
172
|
+
|
173
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:41
|
174
|
+
msgid "Could not create the policy"
|
175
|
+
msgstr ""
|
176
|
+
|
177
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:48
|
178
|
+
msgid "Policy updated"
|
179
|
+
msgstr ""
|
180
|
+
|
181
|
+
#: ../lib/hammer_cli_foreman_openscap/policy.rb:49
|
182
|
+
msgid "Could not update the policy"
|
183
|
+
msgstr ""
|
184
|
+
|
185
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:9
|
186
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:38
|
187
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:38
|
188
|
+
msgid "Title"
|
189
|
+
msgstr ""
|
190
|
+
|
191
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:15
|
192
|
+
msgid "SCAP content successfully created"
|
193
|
+
msgstr ""
|
194
|
+
|
195
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:16
|
196
|
+
msgid "Failed to create SCAP content"
|
197
|
+
msgstr ""
|
198
|
+
|
199
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:18
|
200
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:49
|
201
|
+
msgid "SCAP content file"
|
202
|
+
msgstr ""
|
203
|
+
|
204
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:24
|
205
|
+
msgid "SCAP content deleted"
|
206
|
+
msgstr ""
|
207
|
+
|
208
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:25
|
209
|
+
msgid "Could not delete SCAP content"
|
210
|
+
msgstr ""
|
211
|
+
|
212
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:33
|
213
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:33
|
214
|
+
msgid "Original filename"
|
215
|
+
msgstr ""
|
216
|
+
|
217
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:35
|
218
|
+
msgid "SCAP content profiles"
|
219
|
+
msgstr ""
|
220
|
+
|
221
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:37
|
222
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:37
|
223
|
+
msgid "Profile id"
|
224
|
+
msgstr ""
|
225
|
+
|
226
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:46
|
227
|
+
msgid "SCAP content updated"
|
228
|
+
msgstr ""
|
229
|
+
|
230
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:47
|
231
|
+
msgid "Could not update SCAP content"
|
232
|
+
msgstr ""
|
233
|
+
|
234
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:56
|
235
|
+
msgid "SCAP content file downloaded, saved to: "
|
236
|
+
msgstr ""
|
237
|
+
|
238
|
+
#: ../lib/hammer_cli_foreman_openscap/scap_content.rb:57
|
239
|
+
msgid "Could not download the SCAP content file"
|
240
|
+
msgstr ""
|
241
|
+
|
242
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:15
|
243
|
+
msgid "Tailoring file successfully created"
|
244
|
+
msgstr ""
|
245
|
+
|
246
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:16
|
247
|
+
msgid "Failed to create Tailoring file"
|
248
|
+
msgstr ""
|
249
|
+
|
250
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:18
|
251
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:49
|
252
|
+
msgid "Tailoring file content"
|
253
|
+
msgstr ""
|
254
|
+
|
255
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:24
|
256
|
+
msgid "Tailoring file deleted"
|
257
|
+
msgstr ""
|
258
|
+
|
259
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:25
|
260
|
+
msgid "Could not delete Tailoring file"
|
261
|
+
msgstr ""
|
262
|
+
|
263
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:35
|
264
|
+
msgid "Tailoring file profiles"
|
265
|
+
msgstr ""
|
266
|
+
|
267
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:46
|
268
|
+
msgid "Tailoring file updated"
|
269
|
+
msgstr ""
|
270
|
+
|
271
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:47
|
272
|
+
msgid "Could not update Tailoring file"
|
273
|
+
msgstr ""
|
274
|
+
|
275
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:57
|
276
|
+
msgid "Tailoring file downloaded, saved to: "
|
277
|
+
msgstr ""
|
278
|
+
|
279
|
+
#: ../lib/hammer_cli_foreman_openscap/tailoring_file.rb:58
|
280
|
+
msgid "Could not download the Tailoring file"
|
281
|
+
msgstr ""
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), './test_helper')
|
2
|
+
|
3
|
+
describe 'scap content' do
|
4
|
+
describe 'download' do
|
5
|
+
before do
|
6
|
+
@cmd = %w(scap-content download)
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should require --path for download" do
|
10
|
+
params = ["--id=42"]
|
11
|
+
|
12
|
+
expected_result = CommandExpectation.new
|
13
|
+
expected_result.expected_err =
|
14
|
+
['Could not download the SCAP content file:',
|
15
|
+
' Error: Option --path is required',
|
16
|
+
' ',
|
17
|
+
" See: 'hammer scap-content download --help'",
|
18
|
+
''].join("\n")
|
19
|
+
|
20
|
+
expected_result.expected_exit_code = HammerCLI::EX_USAGE
|
21
|
+
|
22
|
+
api_expects_no_call
|
23
|
+
result = run_cmd(@cmd + params)
|
24
|
+
assert_cmd(expected_result, result)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -19,7 +19,7 @@ describe HammerCLIForemanOpenscap::ArfReport do
|
|
19
19
|
context "output" do
|
20
20
|
let(:expected_record_count) { cmd.resource.call(:index).length }
|
21
21
|
it_should_print_n_records
|
22
|
-
it_should_print_columns ["Id", "Host", "
|
22
|
+
it_should_print_columns ["Id", "Reported at", "Host name", "OpenSCAP proxy name", "Policy name", "Passed", "Failed", "Othered"]
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -33,7 +33,7 @@ describe HammerCLIForemanOpenscap::ArfReport do
|
|
33
33
|
context "output" do
|
34
34
|
with_params ["--id=1"] do
|
35
35
|
it_should_print_n_records 1
|
36
|
-
it_should_print_columns ["Id", "Host", "
|
36
|
+
it_should_print_columns ["Id", "Reported at", "Host name", "OpenSCAP proxy name", "Policy name", "Passed", "Failed", "Othered", "Host Id", "OpenSCAP proxy Id", "Policy Id"]
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -43,6 +43,7 @@ describe HammerCLIForemanOpenscap::ArfReport do
|
|
43
43
|
|
44
44
|
context "parameters" do
|
45
45
|
it_should_accept "id", ["--id=1"]
|
46
|
+
it_should_fail_with "name", ["--name=something"]
|
46
47
|
end
|
47
48
|
end
|
48
49
|
|
data/test/unit/policy_test.rb
CHANGED
@@ -34,7 +34,9 @@ describe HammerCLIForemanOpenscap::Policy do
|
|
34
34
|
context "output" do
|
35
35
|
with_params ["--id=1"] do
|
36
36
|
it_should_print_n_records 1
|
37
|
-
it_should_print_columns ["Id", "Name", "Created at", "Period", "Weekday",
|
37
|
+
it_should_print_columns ["Id", "Name", "Created at", "Period", "Weekday",
|
38
|
+
"Day of month", "Cron line", "SCAP content Id",
|
39
|
+
"SCAP Content profile Id", "Hostgroups"]
|
38
40
|
end
|
39
41
|
end
|
40
42
|
end
|
@@ -49,7 +49,7 @@ describe HammerCLIForemanOpenscap::ScapContent do
|
|
49
49
|
context "output" do
|
50
50
|
with_params ["--id=1"] do
|
51
51
|
it_should_print_n_records 1
|
52
|
-
it_should_print_columns ["Id", "Title", "Created at", "Original filename", "
|
52
|
+
it_should_print_columns ["Id", "Title", "Created at", "Original filename", "SCAP content profiles", "Organizations"]
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hammer_cli_foreman_openscap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Foreman team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hammer_cli_foreman
|
@@ -38,17 +38,27 @@ files:
|
|
38
38
|
- lib/hammer_cli_foreman_openscap/commands.rb
|
39
39
|
- lib/hammer_cli_foreman_openscap/error.rb
|
40
40
|
- lib/hammer_cli_foreman_openscap/exception_handler.rb
|
41
|
+
- lib/hammer_cli_foreman_openscap/host.rb
|
42
|
+
- lib/hammer_cli_foreman_openscap/host_extensions.rb
|
43
|
+
- lib/hammer_cli_foreman_openscap/hostgroup.rb
|
44
|
+
- lib/hammer_cli_foreman_openscap/hostgroup_extensions.rb
|
45
|
+
- lib/hammer_cli_foreman_openscap/i18n.rb
|
41
46
|
- lib/hammer_cli_foreman_openscap/id_resolver.rb
|
42
47
|
- lib/hammer_cli_foreman_openscap/options/normalizers.rb
|
43
48
|
- lib/hammer_cli_foreman_openscap/policy.rb
|
44
49
|
- lib/hammer_cli_foreman_openscap/scap_content.rb
|
45
50
|
- lib/hammer_cli_foreman_openscap/tailoring_file.rb
|
46
51
|
- lib/hammer_cli_foreman_openscap/version.rb
|
52
|
+
- locale/Makefile
|
53
|
+
- locale/README.md
|
54
|
+
- locale/en/hammer_cli_foreman_openscap.po
|
55
|
+
- locale/hammer_cli_foreman_openscap.pot
|
47
56
|
- test/compliance_resource_mock.rb
|
48
57
|
- test/data/1.11/foreman_api.json
|
49
58
|
- test/data/1.14/foreman_api.json
|
50
59
|
- test/data/1.15/foreman_api.json
|
51
60
|
- test/data/tailoring.xml
|
61
|
+
- test/functional/scap_content_test.rb
|
52
62
|
- test/functional/tailoring_file_test.rb
|
53
63
|
- test/functional/test_helper.rb
|
54
64
|
- test/test_helper.rb
|
@@ -88,6 +98,7 @@ test_files:
|
|
88
98
|
- test/unit/policy_test.rb
|
89
99
|
- test/unit/arf_report_test.rb
|
90
100
|
- test/test_helper.rb
|
101
|
+
- test/functional/scap_content_test.rb
|
91
102
|
- test/functional/tailoring_file_test.rb
|
92
103
|
- test/functional/test_helper.rb
|
93
104
|
- test/data/1.14/foreman_api.json
|