hammer_cli_foreman_remote_execution 0.1.1 → 0.2.2
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/.travis.yml +3 -3
- data/.tx/config +1 -1
- data/hammer_cli_foreman_remote_execution.gemspec +1 -1
- data/lib/hammer_cli_foreman_remote_execution.rb +2 -0
- data/lib/hammer_cli_foreman_remote_execution/interface_extensions.rb +30 -0
- data/lib/hammer_cli_foreman_remote_execution/job_invocation.rb +65 -20
- data/lib/hammer_cli_foreman_remote_execution/subnet_extensions.rb +16 -0
- data/lib/hammer_cli_foreman_remote_execution/version.rb +1 -1
- data/locale/README.md +2 -2
- data/locale/de/hammer-cli-foreman-remote-execution.po +217 -48
- data/locale/en/hammer-cli-foreman-remote-execution.po +49 -1
- data/locale/es/hammer-cli-foreman-remote-execution.po +217 -48
- data/locale/fr/hammer-cli-foreman-remote-execution.po +217 -48
- data/locale/it/hammer-cli-foreman-remote-execution.po +197 -29
- data/locale/ja/hammer-cli-foreman-remote-execution.po +217 -48
- data/locale/ko/hammer-cli-foreman-remote-execution.po +217 -48
- data/locale/pt_BR/hammer-cli-foreman-remote-execution.po +217 -48
- data/locale/ru/hammer-cli-foreman-remote-execution.po +217 -48
- data/locale/zh_CN/hammer-cli-foreman-remote-execution.po +217 -48
- data/locale/zh_TW/hammer-cli-foreman-remote-execution.po +217 -48
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00e0ed2d507a59921d5e74fea3c867a905275f3cfe08dead49f16ac2c65c270a
|
4
|
+
data.tar.gz: 13b14ae95a38f37186d530c94693cb169ae242302b14fd7cc8a6aa3f78c13863
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0779211fbcabdcba9288f5f79ea652f60f6deb8fc0f25d36a16dd7293df196224d2c263e967a2b0cd30c384cea02f2bcb107cee773862befd6563ea0f287641a'
|
7
|
+
data.tar.gz: ac9781413c16f4af51d31896adb1328ed64e112b68dff79159db3409bdf183086a4ec4f50abd8c6d39fed3f6e01fb18a44d3ec9c16e4dadab980905bf9bf7aed
|
data/.travis.yml
CHANGED
data/.tx/config
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
[main]
|
2
2
|
host = https://www.transifex.com
|
3
3
|
|
4
|
-
[foreman.
|
4
|
+
[foreman.hammer-cli-foreman-remote-execution]
|
5
5
|
file_filter = locale/<lang>/hammer-cli-foreman-remote-execution.edit.po
|
6
6
|
source_file = locale/hammer-cli-foreman-remote-exectution.pot
|
7
7
|
source_lang = en
|
@@ -16,6 +16,6 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.test_files = `git ls-files test`.split("\n")
|
17
17
|
s.extra_rdoc_files = `git ls-files doc`.split("\n") + Dir['README*', 'LICENSE']
|
18
18
|
|
19
|
-
s.add_dependency 'hammer_cli_foreman', '>= 0.1.3', '<
|
19
|
+
s.add_dependency 'hammer_cli_foreman', '>= 0.1.3', '< 4.0.0'
|
20
20
|
s.add_dependency 'hammer_cli_foreman_tasks', '~> 0.0.3'
|
21
21
|
end
|
@@ -9,6 +9,8 @@ module HammerCLIForemanRemoteExecution
|
|
9
9
|
require 'hammer_cli_foreman_remote_execution/template_input'
|
10
10
|
require 'hammer_cli_foreman_remote_execution/foreign_input_set'
|
11
11
|
require 'hammer_cli_foreman_remote_execution/remote_execution_feature'
|
12
|
+
require 'hammer_cli_foreman_remote_execution/interface_extensions'
|
13
|
+
require 'hammer_cli_foreman_remote_execution/subnet_extensions'
|
12
14
|
|
13
15
|
def self.exception_handler_class
|
14
16
|
HammerCLIForeman::ExceptionHandler
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'hammer_cli_foreman/interface'
|
4
|
+
|
5
|
+
module HammerCLIForemanRemoteExecution
|
6
|
+
class InterfaceExtensionsInfo < ::HammerCLI::CommandExtensions
|
7
|
+
output do |definition|
|
8
|
+
definition.append do
|
9
|
+
field :execution, _('Execution'), Fields::Boolean
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
module InterfaceExtensionsList
|
15
|
+
def format_type(nic)
|
16
|
+
type = super(nic)
|
17
|
+
if nic['execution']
|
18
|
+
if nic['primary'] || nic['provision']
|
19
|
+
type[-1] = ', '+_('execution') +')'
|
20
|
+
else
|
21
|
+
type += ' ('+_('execution') +')'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
type
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
::HammerCLIForeman::Interface.singleton_class.prepend InterfaceExtensionsList
|
29
|
+
::HammerCLIForeman::Interface::InfoCommand.extend_with(InterfaceExtensionsInfo.new)
|
30
|
+
end
|
@@ -8,18 +8,25 @@ module HammerCLIForemanRemoteExecution
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
11
|
+
module BaseOutput
|
12
|
+
def self.included(base)
|
13
|
+
base.output do
|
14
|
+
field :id, _('ID')
|
15
|
+
field :description, _('Description')
|
16
|
+
field :status_label, _('Status')
|
17
|
+
field :succeeded, _('Success')
|
18
|
+
field :failed, _('Failed')
|
19
|
+
field :pending, _('Pending')
|
20
|
+
field :total, _('Total')
|
21
|
+
field :start_at, _('Start')
|
22
|
+
field :randomized_ordering, _('Randomized ordering')
|
23
|
+
field :inputs, _('Inputs'), nil, :hide_blank => true
|
24
|
+
end
|
22
25
|
end
|
26
|
+
end
|
27
|
+
|
28
|
+
class ListCommand < HammerCLIForeman::ListCommand
|
29
|
+
include BaseOutput
|
23
30
|
|
24
31
|
def extend_data(invocation)
|
25
32
|
JobInvocation.extend_data(invocation)
|
@@ -30,20 +37,56 @@ module HammerCLIForemanRemoteExecution
|
|
30
37
|
|
31
38
|
class InfoCommand < HammerCLIForeman::InfoCommand
|
32
39
|
extend WithoutNameOption
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
40
|
+
include BaseOutput
|
41
|
+
option '--show-inputs', :flag, _('Show the complete input of the job')
|
42
|
+
option '--show-host-status', :flag, _('Show job status for the hosts')
|
43
|
+
|
44
|
+
extend_output_definition do |definition|
|
45
|
+
definition.insert(:before, :total) do
|
46
|
+
field :missing, _('Missing')
|
47
|
+
end
|
48
|
+
definition.append do
|
49
|
+
field :job_category, _('Job Category')
|
50
|
+
field :mode, _('Mode')
|
51
|
+
field :cron_line, _('Cron line')
|
52
|
+
field :recurring_logic_id, _('Recurring logic ID')
|
53
|
+
field :hosts, _('Hosts')
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def adapter
|
58
|
+
if option_id
|
59
|
+
:yaml
|
60
|
+
else
|
61
|
+
:base
|
62
|
+
end
|
39
63
|
end
|
40
64
|
|
41
65
|
def extend_data(invocation)
|
66
|
+
if option_show_inputs?
|
67
|
+
invocation['template_invocations']&.each do |template|
|
68
|
+
input_values = template['template_invocation_input_values']
|
69
|
+
values_for_host = {}
|
70
|
+
input_values&.each do |input_value|
|
71
|
+
values_for_host[input_value['template_input_name']] = input_value['value']
|
72
|
+
end
|
73
|
+
hosts = invocation.dig('targeting', 'hosts')
|
74
|
+
host_index = hosts&.index { |h| h['id'] == template['host_id'] }
|
75
|
+
invocation['targeting']['hosts'][host_index][:inputs] = values_for_host if host_index
|
76
|
+
end
|
77
|
+
end
|
42
78
|
JobInvocation.extend_data(invocation)
|
43
79
|
end
|
44
80
|
|
45
81
|
build_options do |o|
|
46
82
|
o.expand(:none)
|
83
|
+
o.without(:host_status)
|
84
|
+
end
|
85
|
+
|
86
|
+
def request_params
|
87
|
+
params = super
|
88
|
+
params[:host_status] = true if option_show_host_status?
|
89
|
+
params
|
47
90
|
end
|
48
91
|
end
|
49
92
|
|
@@ -186,10 +229,12 @@ module HammerCLIForemanRemoteExecution
|
|
186
229
|
|
187
230
|
def self.extend_data(invocation)
|
188
231
|
if (targeting = invocation['targeting']) && invocation['targeting']['hosts']
|
189
|
-
invocation['randomized_ordering'] = targeting['randomized_ordering']
|
190
|
-
|
191
|
-
|
232
|
+
invocation['randomized_ordering'] = targeting['randomized_ordering'] || false
|
233
|
+
|
234
|
+
hosts = targeting['hosts'].map do |host|
|
235
|
+
{ 'Name' => host['name'], 'Job status' => host['job_status'], 'Inputs' => host[:inputs] }.compact
|
192
236
|
end
|
237
|
+
invocation['hosts'] = hosts
|
193
238
|
end
|
194
239
|
|
195
240
|
if invocation['recurrence']
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'hammer_cli_foreman/subnet'
|
2
|
+
|
3
|
+
module HammerCLIForemanRemoteExecution
|
4
|
+
class SubnetExtensions < ::HammerCLI::CommandExtensions
|
5
|
+
output do |definition|
|
6
|
+
definition.insert(:after, _("Smart Proxies"))do
|
7
|
+
collection :remote_execution_proxies, _('Remote execution proxies'), :numbered => false do
|
8
|
+
field :id, _('Id')
|
9
|
+
field :name, _('Name')
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
::HammerCLIForeman::Subnet::InfoCommand.extend_with(SubnetExtensions.new)
|
16
|
+
end
|
data/locale/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
Updating the translations
|
2
2
|
-------------------------
|
3
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/). If so, do the following for each of the new languages:
|
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-remote-execution/). If so, do the following for each of the new languages:
|
5
5
|
|
6
6
|
```
|
7
7
|
mkdir locale/<lang>
|
8
|
-
cp locale/hammer-cli-foreman.pot locale/<lang>/hammer-cli-foreman.po
|
8
|
+
cp locale/hammer-cli-foreman-remote-execution.pot locale/<lang>/hammer-cli-foreman-remote-execution.po
|
9
9
|
```
|
10
10
|
2. Make sure you have `transifex-client` installed
|
11
11
|
|
@@ -3,10 +3,9 @@
|
|
3
3
|
# This file is distributed under the same license as the hammer_cli_foreman_tasks package.
|
4
4
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5
5
|
#
|
6
|
-
#, fuzzy
|
7
6
|
msgid ""
|
8
7
|
msgstr ""
|
9
|
-
"Project-Id-Version:
|
8
|
+
"Project-Id-Version: hammer-cli-foreman-remote-execution 0.2.0\n"
|
10
9
|
"Report-Msgid-Bugs-To: \n"
|
11
10
|
"PO-Revision-Date: 2016-02-18 10:36-0500\n"
|
12
11
|
"Last-Translator: Wiederoder <stefanwiederoder@googlemail.com>, 2017\n"
|
@@ -17,77 +16,247 @@ msgstr ""
|
|
17
16
|
"Language: de\n"
|
18
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
19
18
|
|
19
|
+
msgid "Manage foreign input sets"
|
20
|
+
msgstr ""
|
21
|
+
|
20
22
|
msgid "ID"
|
21
23
|
msgstr "ID"
|
22
24
|
|
25
|
+
#, fuzzy
|
26
|
+
msgid "Target template ID"
|
27
|
+
msgstr "ID"
|
28
|
+
|
29
|
+
msgid "Target template name"
|
30
|
+
msgstr ""
|
31
|
+
|
32
|
+
msgid "Name"
|
33
|
+
msgstr "Name"
|
34
|
+
|
35
|
+
msgid "Include all"
|
36
|
+
msgstr ""
|
37
|
+
|
38
|
+
msgid "Include"
|
39
|
+
msgstr ""
|
40
|
+
|
41
|
+
msgid "Exclude"
|
42
|
+
msgstr ""
|
43
|
+
|
44
|
+
msgid "Foreign input set updated"
|
45
|
+
msgstr ""
|
46
|
+
|
47
|
+
msgid "Could not update the input set"
|
48
|
+
msgstr ""
|
49
|
+
|
50
|
+
msgid "Foreign input set created"
|
51
|
+
msgstr ""
|
52
|
+
|
53
|
+
msgid "Could not create the input set"
|
54
|
+
msgstr ""
|
55
|
+
|
56
|
+
msgid "Foreign input set deleted"
|
57
|
+
msgstr ""
|
58
|
+
|
59
|
+
msgid "Could not delete the input set"
|
60
|
+
msgstr ""
|
61
|
+
|
62
|
+
msgid "Description"
|
63
|
+
msgstr ""
|
64
|
+
|
65
|
+
#, fuzzy
|
66
|
+
msgid "Status"
|
67
|
+
msgstr "Status"
|
68
|
+
|
69
|
+
msgid "Success"
|
70
|
+
msgstr ""
|
71
|
+
|
72
|
+
msgid "Failed"
|
73
|
+
msgstr ""
|
74
|
+
|
75
|
+
msgid "Pending"
|
76
|
+
msgstr ""
|
77
|
+
|
78
|
+
msgid "Total"
|
79
|
+
msgstr ""
|
80
|
+
|
81
|
+
#, fuzzy
|
82
|
+
msgid "Start"
|
83
|
+
msgstr "Status"
|
84
|
+
|
85
|
+
msgid "Job Category"
|
86
|
+
msgstr ""
|
87
|
+
|
88
|
+
msgid "Mode"
|
89
|
+
msgstr ""
|
90
|
+
|
23
91
|
msgid "Cron line"
|
24
92
|
msgstr "Cron-Zeile"
|
25
93
|
|
26
|
-
|
27
|
-
|
94
|
+
#, fuzzy
|
95
|
+
msgid "Recurring logic ID"
|
96
|
+
msgstr "ID"
|
28
97
|
|
29
|
-
msgid "
|
30
|
-
msgstr "
|
98
|
+
msgid "Hosts"
|
99
|
+
msgstr ""
|
31
100
|
|
32
|
-
msgid "
|
33
|
-
msgstr "
|
101
|
+
msgid "View the output for a host"
|
102
|
+
msgstr ""
|
34
103
|
|
35
|
-
msgid "
|
36
|
-
msgstr "
|
104
|
+
msgid "Do not wait for job to complete, shows current output only"
|
105
|
+
msgstr ""
|
37
106
|
|
38
|
-
msgid "
|
39
|
-
msgstr "
|
107
|
+
msgid "The job is scheduled to start at %{timestamp}"
|
108
|
+
msgstr ""
|
40
109
|
|
41
|
-
msgid "
|
42
|
-
msgstr "
|
110
|
+
msgid "Job invocation %{id} created"
|
111
|
+
msgstr ""
|
43
112
|
|
44
|
-
msgid "
|
45
|
-
msgstr "
|
113
|
+
msgid "Schedule the execution for a later time"
|
114
|
+
msgstr ""
|
46
115
|
|
47
|
-
msgid "
|
48
|
-
msgstr "
|
116
|
+
msgid "Execution should be cancelled if it cannot be started before --start-at"
|
117
|
+
msgstr ""
|
118
|
+
|
119
|
+
msgid "Create a recurring execution"
|
120
|
+
msgstr ""
|
121
|
+
|
122
|
+
msgid "Perform no more executions after this time, used with --cron-line"
|
123
|
+
msgstr ""
|
124
|
+
|
125
|
+
msgid "Specify inputs from command line"
|
126
|
+
msgstr ""
|
127
|
+
|
128
|
+
msgid "Read input values from files"
|
129
|
+
msgstr ""
|
130
|
+
|
131
|
+
msgid "Dynamic search queries are evaluated at run time"
|
132
|
+
msgstr ""
|
133
|
+
|
134
|
+
msgid "Cancel the job"
|
135
|
+
msgstr ""
|
136
|
+
|
137
|
+
msgid "Job invocation %{id} cancelled"
|
138
|
+
msgstr ""
|
139
|
+
|
140
|
+
msgid "Could not cancel the job invocation"
|
141
|
+
msgstr ""
|
142
|
+
|
143
|
+
msgid "Rerun the job"
|
144
|
+
msgstr ""
|
145
|
+
|
146
|
+
msgid "Job invocation was rerun as %{id}"
|
147
|
+
msgstr ""
|
148
|
+
|
149
|
+
msgid "Manage job invocations"
|
150
|
+
msgstr ""
|
151
|
+
|
152
|
+
msgid "Provider"
|
153
|
+
msgstr ""
|
154
|
+
|
155
|
+
msgid "Type"
|
156
|
+
msgstr ""
|
157
|
+
|
158
|
+
msgid "Inputs"
|
159
|
+
msgstr ""
|
160
|
+
|
161
|
+
msgid "View job template content"
|
162
|
+
msgstr ""
|
163
|
+
|
164
|
+
msgid "Path to a file that contains the template"
|
165
|
+
msgstr ""
|
166
|
+
|
167
|
+
msgid "Job template created"
|
168
|
+
msgstr ""
|
169
|
+
|
170
|
+
msgid "Could not create the job template"
|
171
|
+
msgstr ""
|
172
|
+
|
173
|
+
msgid "Path to a file that contains the template - must include ERB metadata"
|
174
|
+
msgstr ""
|
175
|
+
|
176
|
+
msgid "Job template imported"
|
177
|
+
msgstr ""
|
178
|
+
|
179
|
+
msgid "Could not import the job template"
|
180
|
+
msgstr ""
|
181
|
+
|
182
|
+
msgid "Export a template including all metadata"
|
183
|
+
msgstr ""
|
49
184
|
|
50
|
-
msgid "
|
51
|
-
msgstr "
|
185
|
+
msgid "Job template updated"
|
186
|
+
msgstr ""
|
52
187
|
|
53
|
-
msgid "
|
54
|
-
msgstr "
|
188
|
+
msgid "Could not update the job template"
|
189
|
+
msgstr ""
|
55
190
|
|
56
|
-
msgid "
|
57
|
-
msgstr "
|
191
|
+
msgid "Job template deleted"
|
192
|
+
msgstr ""
|
58
193
|
|
59
|
-
msgid "
|
60
|
-
msgstr "
|
194
|
+
msgid "Could not delete the job template"
|
195
|
+
msgstr ""
|
61
196
|
|
62
|
-
msgid "
|
63
|
-
msgstr "
|
197
|
+
msgid "Manage job templates"
|
198
|
+
msgstr ""
|
64
199
|
|
65
|
-
msgid "
|
66
|
-
|
200
|
+
msgid ""
|
201
|
+
"Comma-separated list of key=file, where file is a path to a text file to be re"
|
202
|
+
"ad"
|
203
|
+
msgstr ""
|
67
204
|
|
68
|
-
|
69
|
-
|
205
|
+
#, fuzzy
|
206
|
+
msgid ""
|
207
|
+
"Cron line format 'a b c d e', where:\n"
|
208
|
+
" a. is minute (range: 0-59)\n"
|
209
|
+
" b. is hour (range: 0-23)\n"
|
210
|
+
" c. is day of month (range: 1-31)\n"
|
211
|
+
" d. is month (range: 1-12)\n"
|
212
|
+
" e. is day of week (range: 0-6)"
|
213
|
+
msgstr "Cron-Zeile"
|
70
214
|
|
71
|
-
msgid "
|
72
|
-
msgstr "
|
215
|
+
msgid "Manage remote execution features"
|
216
|
+
msgstr ""
|
73
217
|
|
74
|
-
msgid "
|
75
|
-
msgstr "
|
218
|
+
msgid "Job template name"
|
219
|
+
msgstr ""
|
76
220
|
|
77
|
-
msgid "
|
78
|
-
msgstr "
|
221
|
+
msgid "Label"
|
222
|
+
msgstr ""
|
79
223
|
|
80
|
-
|
81
|
-
|
224
|
+
#, fuzzy
|
225
|
+
msgid "Job template ID"
|
226
|
+
msgstr "ID"
|
82
227
|
|
83
|
-
msgid "
|
84
|
-
msgstr "
|
228
|
+
msgid "Remote execution feature updated"
|
229
|
+
msgstr ""
|
85
230
|
|
86
|
-
msgid "
|
87
|
-
msgstr "
|
231
|
+
msgid "Could not update the remote execution feature"
|
232
|
+
msgstr ""
|
88
233
|
|
89
|
-
msgid "
|
90
|
-
msgstr "
|
234
|
+
msgid "Manage template inputs"
|
235
|
+
msgstr ""
|
91
236
|
|
92
|
-
msgid "
|
93
|
-
msgstr "
|
237
|
+
msgid "Input type"
|
238
|
+
msgstr ""
|
239
|
+
|
240
|
+
msgid "Fact name"
|
241
|
+
msgstr ""
|
242
|
+
|
243
|
+
msgid "Variable name"
|
244
|
+
msgstr ""
|
245
|
+
|
246
|
+
msgid "Puppet parameter name"
|
247
|
+
msgstr ""
|
248
|
+
|
249
|
+
msgid "Options"
|
250
|
+
msgstr ""
|
251
|
+
|
252
|
+
msgid "Template input created"
|
253
|
+
msgstr ""
|
254
|
+
|
255
|
+
msgid "Could not create the template input"
|
256
|
+
msgstr ""
|
257
|
+
|
258
|
+
msgid "Template input deleted"
|
259
|
+
msgstr ""
|
260
|
+
|
261
|
+
msgid "Could not delete the template input"
|
262
|
+
msgstr ""
|