hammer_cli_foreman_openscap 0.1.7 → 0.1.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
- SHA1:
3
- metadata.gz: 177629d680563b580446da13e45d5dd71eb8d538
4
- data.tar.gz: '073782bba0b4c0f9ff39bceef7f7bf50621a2d06'
2
+ SHA256:
3
+ metadata.gz: 64d2c7a461eec7efe194ba92b6afc6e4883e945c662e73506ac698308af40430
4
+ data.tar.gz: 5476b1468e8cdebb472b955137c4a8b2b813da1098431fc52129a97740ef3310
5
5
  SHA512:
6
- metadata.gz: 35a33a284f3129e09337c422468930231ee20cb659ac88ca1b93e718a8c9bfe9a67580adc233e42bcd438932a5f9fc4d9129f958eba977728eb4f91dba0f2e69
7
- data.tar.gz: 540d4b5c507227fb331c2d158e5bc57aafbb06c6d0c5bf6904f2fb99f2e6155ce3ebe730d5694ab49bdda2c6144d9d3e8ca3bedfaaab08c26c81a2e8835e86b7
6
+ metadata.gz: 1532f04e1f7caf0bd90e0be25a75bbcf12a9852a03de7367973371de369021d55c283fd9e540652bcbeed686cb736b290a119b3e53fb692840a8186ef17a78e7
7
+ data.tar.gz: f713ab7dd82757a99761cc982fa2975fa09ef9f60eb4a32e9c9e4b8bae166a835fb34b70e5b56ed45a4c0789011684f1d308ffe5e97b6ac98411342307d20771
@@ -1,4 +1,5 @@
1
1
  require 'hammer_cli_foreman'
2
+ require 'hammer_cli_foreman/host'
2
3
  require 'hammer_cli_foreman_openscap/options/normalizers'
3
4
  require 'hammer_cli_foreman_openscap/id_resolver'
4
5
  require 'hammer_cli_foreman_openscap/commands'
@@ -6,6 +7,7 @@ require 'hammer_cli_foreman_openscap/error'
6
7
  require 'hammer_cli_foreman_openscap/exception_handler'
7
8
  require 'hammer_cli_foreman_openscap/hostgroup'
8
9
  require 'hammer_cli_foreman_openscap/host'
10
+ require 'hammer_cli_foreman_openscap/scap_content_profile'
9
11
 
10
12
  module HammerCLIForemanOpenscap
11
13
  require 'hammer_cli_foreman_openscap/version'
@@ -29,4 +31,12 @@ module HammerCLIForemanOpenscap
29
31
  HammerCLI::MainCommand.lazy_subcommand("tailoring-file", _("Manipulate Tailoring files"),
30
32
  "HammerCLIForemanOpenscap::TailoringFile",
31
33
  "hammer_cli_foreman_openscap/tailoring_file")
34
+
35
+ HammerCLI::MainCommand.lazy_subcommand("scap-content-profile", _("Manipulate Scap Content Profiles"),
36
+ "HammerCLIForemanOpenscap::ScapContentProfile",
37
+ "hammer_cli_foreman_openscap/scap_content_profile")
38
+
39
+ HammerCLIForeman::Host.lazy_subcommand(Host::PoliciesEnc.command_name, _('View policies ENC for host'),
40
+ "HammerCLIForemanOpenscap::Host::PoliciesEnc",
41
+ "hammer_cli_foreman_openscap/host")
32
42
  end
@@ -50,10 +50,11 @@ module HammerCLIForemanOpenscap
50
50
  option("--scap-file", "SCAP_FILE", description, opts, &block)
51
51
  end
52
52
 
53
- def request_params
54
- all_options['option_original_filename'] ||= self.class.declared_options.find { |opt| opt.attribute_name == "option_scap_file" }
53
+ def method_options(params)
54
+ opts = super params
55
+ opts[resource.singular_name]['original_filename'] ||= self.class.declared_options.find { |opt| opt.attribute_name == "option_scap_file" }
55
56
  .value_formatter.original_filename
56
- super
57
+ opts
57
58
  end
58
59
  end
59
60
 
@@ -87,7 +88,7 @@ module HammerCLIForemanOpenscap
87
88
  return
88
89
  end
89
90
  # get file name from header, remove leading and trailing quotes
90
- filename = response.headers[:content_disposition].match(/filename=(.*)/)[1].chop.reverse.chop.reverse
91
+ filename = response.headers[:content_disposition].match(/filename=(.*);/)[1].chop.reverse.chop.reverse
91
92
  path = option_path.dup
92
93
  path << '/' unless path.end_with? '/'
93
94
  raise HammerCLIForemanOpenscap::DownloadError.new "Cannot save file: #{path} does not exist" unless File.directory?(path)
@@ -1,2 +1,34 @@
1
1
  require 'hammer_cli_foreman/host'
2
2
  require 'hammer_cli_foreman_openscap/host_extensions'
3
+
4
+ module HammerCLIForemanOpenscap
5
+ class Host < HammerCLIForeman::Command
6
+ resource :hosts
7
+
8
+ class PoliciesEnc < HammerCLIForeman::ListCommand
9
+ command_name "policies-enc"
10
+ action :policies_enc
11
+
12
+ output do
13
+ field :id, _('Id')
14
+ field :profile_id, _('Profile Id')
15
+ field :content_path, _('Content path')
16
+ field :download_path, _('Content download path')
17
+ field :tailoring_path, _('Tailoring path')
18
+ field :tailoring_download_path, _('Tailoring download path')
19
+ field :monthday, _('Day of month')
20
+ field :hour, _('Hour')
21
+ field :minute, ('Minute')
22
+ field :month, _('Month')
23
+ field :week, _('Week')
24
+ end
25
+
26
+ def adapter
27
+ @context[:adapter] || :base
28
+ end
29
+
30
+ build_options
31
+ end
32
+ autoload_subcommands
33
+ end
34
+ end
@@ -52,6 +52,22 @@ module HammerCLIForemanOpenscap
52
52
  build_options
53
53
  end
54
54
 
55
+ class HostsCommand < HammerCLIForeman::AssociatedListSearchCommand
56
+ command_name 'hosts'
57
+ search_resource :hosts
58
+
59
+ def self.search_options_mapping
60
+ {
61
+ 'id' => 'compliance_policy_id',
62
+ 'name' => 'compliance_policy'
63
+ }
64
+ end
65
+
66
+ output HammerCLIForeman::Host::ListCommand.output_definition
67
+
68
+ build_options
69
+ end
70
+
55
71
  autoload_subcommands
56
72
  end
57
73
  end
@@ -7,6 +7,7 @@ module HammerCLIForemanOpenscap
7
7
  output do
8
8
  field :id, _("Id")
9
9
  field :title, _("Title")
10
+ field :digest, _("Digest")
10
11
  end
11
12
  build_options
12
13
  end
@@ -20,6 +21,25 @@ module HammerCLIForemanOpenscap
20
21
  build_options
21
22
  end
22
23
 
24
+ class BulkUpload < HammerCLIForemanOpenscap::CreateCommand
25
+ command_name "bulk-upload"
26
+ action :bulk_upload
27
+
28
+ success_message _('Scap Contents uploaded.')
29
+ failure_message _('Could not upload Scap Contents')
30
+
31
+ output do
32
+ field :errors, _('Errors'), Fields::List, :on_new_line => true, :separator => "\n"
33
+ collection :results, _('Uploaded Scap Contents') do
34
+ field :id, _("Id")
35
+ field :title, _("Title")
36
+ field :original_filename, _("Original Filename")
37
+ end
38
+ end
39
+
40
+ build_options
41
+ end
42
+
23
43
  class DeleteCommand < HammerCLIForemanOpenscap::DeleteCommand
24
44
  success_message _("SCAP content deleted")
25
45
  failure_message _("Could not delete SCAP content")
@@ -0,0 +1,29 @@
1
+ module HammerCLIForemanOpenscap
2
+ class ScapContentProfile < HammerCLIForeman::Command
3
+ resource :scap_content_profiles
4
+
5
+ class ListCommand < HammerCLIForeman::ListCommand
6
+ output do
7
+ field :id, _("Id")
8
+ field :title, _("Title")
9
+ field :profile_id, _("Profile Id")
10
+ from :scap_content do
11
+ field :id, _("Scap Content Id")
12
+ field :title, _("Scap Content Title")
13
+ end
14
+ from :tailoring_file do
15
+ field :id, _("Tailoring File Id")
16
+ field :name, _("Tailoring File Name")
17
+ end
18
+ end
19
+
20
+ def adapter
21
+ @context[:adapter] || :base
22
+ end
23
+
24
+ build_options
25
+ end
26
+
27
+ autoload_subcommands
28
+ end
29
+ end
@@ -1,5 +1,5 @@
1
1
  module HammerCLIForemanOpenscap
2
2
  def self.version
3
- @version ||= Gem::Version.new '0.1.7'
3
+ @version ||= Gem::Version.new '0.1.12'
4
4
  end
5
5
  end
@@ -3,10 +3,9 @@
3
3
  # This file is distributed under the same license as the hammer_cli_foreman_openscap package.
4
4
  # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
5
  #
6
- #, fuzzy
7
6
  msgid ""
8
7
  msgstr ""
9
- "Project-Id-Version: hammer_cli_foreman_openscap 0.1.4\n"
8
+ "Project-Id-Version: hammer_cli_foreman_openscap 0.1.10\n"
10
9
  "Report-Msgid-Bugs-To: \n"
11
10
  "PO-Revision-Date: 2017-09-08 16:19-0400\n"
12
11
  "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>, 2017\n"
@@ -29,13 +28,26 @@ msgstr ""
29
28
  msgid "Manipulate Tailoring files"
30
29
  msgstr ""
31
30
 
31
+ msgid "Manipulate Scap Content Profiles"
32
+ msgstr ""
33
+
34
+ msgid "View policies ENC for host"
35
+ msgstr ""
36
+
32
37
  msgid "Id"
33
38
  msgstr ""
34
39
 
35
- msgid "Host"
40
+ msgid "Reported at"
41
+ msgstr ""
42
+
43
+ #, fuzzy
44
+ msgid "Host name"
36
45
  msgstr "Hostitel"
37
46
 
38
- msgid "Reported at"
47
+ msgid "OpenSCAP proxy name"
48
+ msgstr ""
49
+
50
+ msgid "Policy name"
39
51
  msgstr ""
40
52
 
41
53
  msgid "Passed"
@@ -53,7 +65,7 @@ msgstr ""
53
65
  msgid "OpenSCAP proxy Id"
54
66
  msgstr ""
55
67
 
56
- msgid "OpenSCAP proxy name"
68
+ msgid "Policy Id"
57
69
  msgstr ""
58
70
 
59
71
  msgid "ARF report deleted"
@@ -77,10 +89,37 @@ msgstr ""
77
89
  msgid "Path to directory where downloaded file will be saved"
78
90
  msgstr ""
79
91
 
80
- msgid "SCAP content title"
92
+ msgid "Profile Id"
81
93
  msgstr ""
82
94
 
83
- msgid "Policy name"
95
+ msgid "Content path"
96
+ msgstr ""
97
+
98
+ msgid "Content download path"
99
+ msgstr ""
100
+
101
+ msgid "Tailoring path"
102
+ msgstr ""
103
+
104
+ msgid "Tailoring download path"
105
+ msgstr ""
106
+
107
+ msgid "Day of month"
108
+ msgstr ""
109
+
110
+ msgid "Hour"
111
+ msgstr ""
112
+
113
+ msgid "Month"
114
+ msgstr ""
115
+
116
+ msgid "Week"
117
+ msgstr ""
118
+
119
+ msgid "OpenSCAP Proxy"
120
+ msgstr ""
121
+
122
+ msgid "SCAP content title"
84
123
  msgstr ""
85
124
 
86
125
  msgid "Name to search by"
@@ -98,9 +137,6 @@ msgstr ""
98
137
  msgid "Weekday"
99
138
  msgstr ""
100
139
 
101
- msgid "Day of month"
102
- msgstr ""
103
-
104
140
  msgid "Cron line"
105
141
  msgstr ""
106
142
 
@@ -116,6 +152,9 @@ msgstr ""
116
152
  msgid "Tailoring file profile Id"
117
153
  msgstr ""
118
154
 
155
+ msgid "Deployment option"
156
+ msgstr ""
157
+
119
158
  msgid "Policy has been deleted"
120
159
  msgstr ""
121
160
 
@@ -173,6 +212,18 @@ msgstr ""
173
212
  msgid "Could not download the SCAP content file"
174
213
  msgstr ""
175
214
 
215
+ msgid "Scap Content Id"
216
+ msgstr ""
217
+
218
+ msgid "Scap Content Title"
219
+ msgstr ""
220
+
221
+ msgid "Tailoring File Id"
222
+ msgstr ""
223
+
224
+ msgid "Tailoring File Name"
225
+ msgstr ""
226
+
176
227
  msgid "Tailoring file successfully created"
177
228
  msgstr ""
178
229
 
@@ -3,10 +3,9 @@
3
3
  # This file is distributed under the same license as the hammer_cli_foreman_openscap package.
4
4
  # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
5
  #
6
- #, fuzzy
7
6
  msgid ""
8
7
  msgstr ""
9
- "Project-Id-Version: hammer_cli_foreman_openscap 0.1.4\n"
8
+ "Project-Id-Version: hammer_cli_foreman_openscap 0.1.10\n"
10
9
  "Report-Msgid-Bugs-To: \n"
11
10
  "PO-Revision-Date: 2017-09-08 16:19-0400\n"
12
11
  "Last-Translator: Dominic Cleal <dominic@cleal.org>, 2017\n"
@@ -29,15 +28,28 @@ msgstr ""
29
28
  msgid "Manipulate Tailoring files"
30
29
  msgstr ""
31
30
 
31
+ msgid "Manipulate Scap Content Profiles"
32
+ msgstr ""
33
+
34
+ msgid "View policies ENC for host"
35
+ msgstr ""
36
+
32
37
  msgid "Id"
33
38
  msgstr "ID"
34
39
 
35
- msgid "Host"
36
- msgstr "Host"
37
-
38
40
  msgid "Reported at"
39
41
  msgstr "Berichtet am"
40
42
 
43
+ #, fuzzy
44
+ msgid "Host name"
45
+ msgstr "Host"
46
+
47
+ msgid "OpenSCAP proxy name"
48
+ msgstr ""
49
+
50
+ msgid "Policy name"
51
+ msgstr "Name der Richtlinie"
52
+
41
53
  msgid "Passed"
42
54
  msgstr "Erfolgreich"
43
55
 
@@ -53,8 +65,9 @@ msgstr ""
53
65
  msgid "OpenSCAP proxy Id"
54
66
  msgstr ""
55
67
 
56
- msgid "OpenSCAP proxy name"
57
- msgstr ""
68
+ #, fuzzy
69
+ msgid "Policy Id"
70
+ msgstr "Name der Richtlinie"
58
71
 
59
72
  msgid "ARF report deleted"
60
73
  msgstr ""
@@ -77,11 +90,39 @@ msgstr ""
77
90
  msgid "Path to directory where downloaded file will be saved"
78
91
  msgstr ""
79
92
 
80
- msgid "SCAP content title"
93
+ #, fuzzy
94
+ msgid "Profile Id"
95
+ msgstr "ID"
96
+
97
+ msgid "Content path"
81
98
  msgstr ""
82
99
 
83
- msgid "Policy name"
84
- msgstr "Name der Richtlinie"
100
+ msgid "Content download path"
101
+ msgstr ""
102
+
103
+ msgid "Tailoring path"
104
+ msgstr ""
105
+
106
+ msgid "Tailoring download path"
107
+ msgstr ""
108
+
109
+ msgid "Day of month"
110
+ msgstr ""
111
+
112
+ msgid "Hour"
113
+ msgstr ""
114
+
115
+ msgid "Month"
116
+ msgstr ""
117
+
118
+ msgid "Week"
119
+ msgstr ""
120
+
121
+ msgid "OpenSCAP Proxy"
122
+ msgstr ""
123
+
124
+ msgid "SCAP content title"
125
+ msgstr ""
85
126
 
86
127
  msgid "Name to search by"
87
128
  msgstr "Zu suchender Name"
@@ -98,9 +139,6 @@ msgstr ""
98
139
  msgid "Weekday"
99
140
  msgstr ""
100
141
 
101
- msgid "Day of month"
102
- msgstr ""
103
-
104
142
  msgid "Cron line"
105
143
  msgstr "Cron-Zeile"
106
144
 
@@ -116,6 +154,9 @@ msgstr ""
116
154
  msgid "Tailoring file profile Id"
117
155
  msgstr ""
118
156
 
157
+ msgid "Deployment option"
158
+ msgstr ""
159
+
119
160
  msgid "Policy has been deleted"
120
161
  msgstr ""
121
162
 
@@ -173,6 +214,22 @@ msgstr ""
173
214
  msgid "Could not download the SCAP content file"
174
215
  msgstr ""
175
216
 
217
+ #, fuzzy
218
+ msgid "Scap Content Id"
219
+ msgstr "ID"
220
+
221
+ #, fuzzy
222
+ msgid "Scap Content Title"
223
+ msgstr "Titel"
224
+
225
+ #, fuzzy
226
+ msgid "Tailoring File Id"
227
+ msgstr "ID"
228
+
229
+ #, fuzzy
230
+ msgid "Tailoring File Name"
231
+ msgstr "Name"
232
+
176
233
  msgid "Tailoring file successfully created"
177
234
  msgstr ""
178
235