hammer_cli_foreman_remote_execution 0.0.6 → 0.1.0

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: f879c32ae742ceb90ab61bbc02322b2a44416df7
4
- data.tar.gz: a66b9ac45d9714ebc8350d7ec51074d6f2eb860f
2
+ SHA256:
3
+ metadata.gz: 90b139880b77689e075db7ec8c87bad033251dd69cd5449c3551727cd1530d3b
4
+ data.tar.gz: aab12510bea01268618f5540d1401149e09c03490e6ca3ce74d19a1337d43267
5
5
  SHA512:
6
- metadata.gz: 81171fd1db3da7eec1d8e25ebcf59df15dca78981a74f09decb181b8fdd500f844a07a84f8cfe2ec0b1ab7612643dadedabaebb9ec9dfd81224ae5bb007f8052
7
- data.tar.gz: c9153fc2750b9f9653e9655370f2547dc8880fb5c5746be9914ab9764091f3edd6f7f4172b302c9007ba384595827fa5605d7975ef71d21090ba41d518370b31
6
+ metadata.gz: c8e4c4a787ee43ff7792e3d3bc74b5be6a4c05adb3c27eb28854a9d8002ec4792f207ecc7c70e0a4a1e4897df5d2a284964a8672705582d7a7f26158ed82f554
7
+ data.tar.gz: 14ef2c8226dcc2ea55aa560b0861bc292a8760fd570defaaca6ac0a144f3b82ead27f3d8420e7e4a4cf66dd515812e161297fcb9726765398372de36b99c0eab
data/.travis.yml CHANGED
@@ -6,3 +6,5 @@ rvm:
6
6
  - 2.2.0
7
7
  - 2.3.0
8
8
  sudo: false
9
+ before_install:
10
+ - gem update bundler
data/.tx/config ADDED
@@ -0,0 +1,8 @@
1
+ [main]
2
+ host = https://www.transifex.com
3
+
4
+ [foreman.hammer_cli_foreman_tasks]
5
+ file_filter = locale/<lang>/hammer-cli-foreman-remote-execution.edit.po
6
+ source_file = locale/hammer-cli-foreman-remote-exectution.pot
7
+ source_lang = en
8
+ type = PO
@@ -2,6 +2,12 @@ module HammerCLIForemanRemoteExecution
2
2
  class JobInvocation < HammerCLIForeman::Command
3
3
  resource :job_invocations
4
4
 
5
+ module WithoutNameOption
6
+ def create_option_builder
7
+ HammerCLI::Apipie::OptionBuilder.new(resource, resource.action(action), :require_options => false)
8
+ end
9
+ end
10
+
5
11
  class ListCommand < HammerCLIForeman::ListCommand
6
12
  output do
7
13
  field :id, _('ID')
@@ -22,6 +28,7 @@ module HammerCLIForemanRemoteExecution
22
28
  end
23
29
 
24
30
  class InfoCommand < HammerCLIForeman::InfoCommand
31
+ extend WithoutNameOption
25
32
  output ListCommand.output_definition do
26
33
  field :job_category, _('Job Category')
27
34
  field :mode, _('Mode')
@@ -34,10 +41,6 @@ module HammerCLIForemanRemoteExecution
34
41
  JobInvocation.extend_data(invocation)
35
42
  end
36
43
 
37
- def self.create_option_builder
38
- HammerCLI::Apipie::OptionBuilder.new(resource, resource.action(action), :require_options => false)
39
- end
40
-
41
44
  build_options do |o|
42
45
  o.expand(:none)
43
46
  end
@@ -58,17 +61,39 @@ module HammerCLIForemanRemoteExecution
58
61
  puts line['output']
59
62
  since = line['timestamp']
60
63
  end
64
+ since
65
+ end
61
66
 
62
- if output['refresh'] && !option_async?
63
- sleep 1
64
- print_data(resource.call(action, request_params.merge(:since => since), request_headers, request_options))
67
+ def execute
68
+ data = get_output
69
+ if data['delayed']
70
+ puts _('The job is scheduled to start at %{timestamp}') % { :timestamp => data['start_at'] }
71
+ return HammerCLI::EX_OK if option_async?
65
72
  end
73
+ since = print_data(data)
74
+
75
+ output_loop(data, since)
76
+ return HammerCLI::EX_OK
66
77
  end
67
78
 
68
79
  build_options do |o|
69
80
  o.expand(:all).except(:job_invocations)
70
81
  o.without(:since)
71
82
  end
83
+
84
+ private
85
+
86
+ def output_loop(data, since = nil)
87
+ while data['refresh'] && !option_async? do
88
+ sleep 1
89
+ data = get_output(since)
90
+ since = print_data(data)
91
+ end
92
+ end
93
+
94
+ def get_output(since = nil)
95
+ resource.call(action, request_params.merge(:since => since), request_headers, request_options)
96
+ end
72
97
  end
73
98
 
74
99
  class CreateCommand < HammerCLIForeman::CreateCommand
@@ -135,6 +160,29 @@ module HammerCLIForemanRemoteExecution
135
160
  end
136
161
  end
137
162
 
163
+ class CancelCommand < HammerCLIForeman::Command
164
+ extend WithoutNameOption
165
+
166
+ action :cancel
167
+ command_name 'cancel'
168
+ desc _('Cancel the job')
169
+ success_message _('Job invocation %{id} cancelled')
170
+ failure_message _('Could not cancel the job invocation')
171
+
172
+ build_options { |o| o.expand(:none) }
173
+ end
174
+
175
+ class RerunCommand < HammerCLIForeman::CreateCommand
176
+ extend WithoutNameOption
177
+
178
+ action :rerun
179
+ command_name 'rerun'
180
+ desc _('Rerun the job')
181
+ success_message _('Job invocation was rerun as %{id}')
182
+
183
+ build_options { |o| o.expand(:none) }
184
+ end
185
+
138
186
  def self.extend_data(invocation)
139
187
  if invocation['targeting'] && invocation['targeting']['hosts']
140
188
  invocation['hosts'] = "\n" + invocation['targeting']['hosts'].map { |host| " - #{host['name']}" }.join("\n")
@@ -1,5 +1,5 @@
1
1
  module HammerCLIForemanRemoteExecution
2
2
  def self.version
3
- @version ||= Gem::Version.new '0.0.6'
3
+ @version ||= Gem::Version.new '0.1.0'
4
4
  end
5
5
  end
@@ -0,0 +1,93 @@
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_tasks package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: hammer_cli_foreman_tasks 0.0.9\n"
10
+ "Report-Msgid-Bugs-To: \n"
11
+ "PO-Revision-Date: 2016-02-18 10:36-0500\n"
12
+ "Last-Translator: Wiederoder <stefanwiederoder@googlemail.com>, 2017\n"
13
+ "Language-Team: German (https://www.transifex.com/foreman/teams/114/de/)\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Language: de\n"
18
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
+
20
+ msgid "ID"
21
+ msgstr "ID"
22
+
23
+ msgid "Cron line"
24
+ msgstr "Cron-Zeile"
25
+
26
+ msgid "End time"
27
+ msgstr "Endzeit"
28
+
29
+ msgid "Iteration"
30
+ msgstr "Wiederholung"
31
+
32
+ msgid "State"
33
+ msgstr "Status"
34
+
35
+ msgid "Recurring logic cancelled."
36
+ msgstr "Wiederholungslogik abgebrochen."
37
+
38
+ msgid "Could not cancel the recurring logic."
39
+ msgstr "Wiederholungslogik konnte nicht abgebrochen werden."
40
+
41
+ msgid "Recurring logic related actions."
42
+ msgstr "Aktionen im Zusammenhang mit Wiederholungslogik"
43
+
44
+ msgid "Show the progress of the task"
45
+ msgstr "Fortschritt der Aufgabe anzeigen"
46
+
47
+ msgid "Name"
48
+ msgstr "Name"
49
+
50
+ msgid "Owner"
51
+ msgstr "Besitzer"
52
+
53
+ msgid "Started at"
54
+ msgstr "Gestartet um"
55
+
56
+ msgid "Ended at"
57
+ msgstr "Beendet um"
58
+
59
+ msgid "Result"
60
+ msgstr "Ergebnis"
61
+
62
+ msgid "Task action"
63
+ msgstr "Aufgabenaktion"
64
+
65
+ msgid "Task errors"
66
+ msgstr "Aufgabenfehler"
67
+
68
+ msgid "Resume all tasks paused in error state"
69
+ msgstr "Alle in Fehler-Status angehaltenen Aufgaben fortsetzen"
70
+
71
+ msgid "Total tasks found paused in error state"
72
+ msgstr "Alle in Fehler-Status gefundenen Aufgaben "
73
+
74
+ msgid "Total tasks resumed"
75
+ msgstr "Insgesamt fortgesetzte Aufgaben"
76
+
77
+ msgid "Resumed tasks"
78
+ msgstr "Fortgesetzte Aufgaben"
79
+
80
+ msgid "Task identifier"
81
+ msgstr "Aufgabenbezeichner"
82
+
83
+ msgid "Total tasks failed to resume"
84
+ msgstr "Gesamtzahl der Aufgaben, die nicht fortgesetzt werden konnten"
85
+
86
+ msgid "Failed tasks"
87
+ msgstr "Fehlgeschlagene Aufgaben"
88
+
89
+ msgid "Total tasks skipped"
90
+ msgstr "Insgesamt übersprungene Aufgaben"
91
+
92
+ msgid "Skipped tasks"
93
+ msgstr "Übersprungene Aufgaben"
@@ -0,0 +1,93 @@
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_tasks package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: hammer_cli_foreman_tasks 0.0.9\n"
10
+ "Report-Msgid-Bugs-To: \n"
11
+ "PO-Revision-Date: 2016-02-18 10:36-0500\n"
12
+ "Last-Translator: Carmela Rubiños <carmela.rubinos@gmail.com>, 2017\n"
13
+ "Language-Team: Spanish (https://www.transifex.com/foreman/teams/114/es/)\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Language: es\n"
18
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
+
20
+ msgid "ID"
21
+ msgstr "ID"
22
+
23
+ msgid "Cron line"
24
+ msgstr "Línea Cron"
25
+
26
+ msgid "End time"
27
+ msgstr "Hora de finalización"
28
+
29
+ msgid "Iteration"
30
+ msgstr "Iteración"
31
+
32
+ msgid "State"
33
+ msgstr "Estado"
34
+
35
+ msgid "Recurring logic cancelled."
36
+ msgstr "Lógica recurrente cancelada"
37
+
38
+ msgid "Could not cancel the recurring logic."
39
+ msgstr "No se pudo cancelar la lógica recurrente."
40
+
41
+ msgid "Recurring logic related actions."
42
+ msgstr "Acciones relacionadas con la lógica recurrente"
43
+
44
+ msgid "Show the progress of the task"
45
+ msgstr "Mostrar el progreso de la tarea"
46
+
47
+ msgid "Name"
48
+ msgstr "Nombre"
49
+
50
+ msgid "Owner"
51
+ msgstr "Propietario"
52
+
53
+ msgid "Started at"
54
+ msgstr "Iniciado el"
55
+
56
+ msgid "Ended at"
57
+ msgstr "Finalizada el"
58
+
59
+ msgid "Result"
60
+ msgstr "Resultado:"
61
+
62
+ msgid "Task action"
63
+ msgstr "Acción de la tarea"
64
+
65
+ msgid "Task errors"
66
+ msgstr "Errores de la tarea"
67
+
68
+ msgid "Resume all tasks paused in error state"
69
+ msgstr "Reanudar todas las tareas en pausa en estado de error"
70
+
71
+ msgid "Total tasks found paused in error state"
72
+ msgstr "Total de tareas encontradas en pausa en estado de error"
73
+
74
+ msgid "Total tasks resumed"
75
+ msgstr "Total de tareas reanudadas"
76
+
77
+ msgid "Resumed tasks"
78
+ msgstr "Tareas reanudadas"
79
+
80
+ msgid "Task identifier"
81
+ msgstr "Identificador de tareas"
82
+
83
+ msgid "Total tasks failed to resume"
84
+ msgstr "Total de tareas que no se pudieron reanudar"
85
+
86
+ msgid "Failed tasks"
87
+ msgstr "Tareas con error"
88
+
89
+ msgid "Total tasks skipped"
90
+ msgstr "Total de tareas omitidas"
91
+
92
+ msgid "Skipped tasks"
93
+ msgstr "Tareas omitidas"
@@ -0,0 +1,93 @@
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_tasks package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: hammer_cli_foreman_tasks 0.0.9\n"
10
+ "Report-Msgid-Bugs-To: \n"
11
+ "PO-Revision-Date: 2016-02-18 10:36-0500\n"
12
+ "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>, 2017\n"
13
+ "Language-Team: French (https://www.transifex.com/foreman/teams/114/fr/)\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Language: fr\n"
18
+ "Plural-Forms: nplurals=2; plural=(n > 1);\n"
19
+
20
+ msgid "ID"
21
+ msgstr "ID"
22
+
23
+ msgid "Cron line"
24
+ msgstr "Ligne de cron"
25
+
26
+ msgid "End time"
27
+ msgstr "Heure de fin"
28
+
29
+ msgid "Iteration"
30
+ msgstr "Itération"
31
+
32
+ msgid "State"
33
+ msgstr "État "
34
+
35
+ msgid "Recurring logic cancelled."
36
+ msgstr "Logique récurrente annulée."
37
+
38
+ msgid "Could not cancel the recurring logic."
39
+ msgstr "N'a pas pu annuler la logique récurrente."
40
+
41
+ msgid "Recurring logic related actions."
42
+ msgstr "Actions liées à la logique récurrente."
43
+
44
+ msgid "Show the progress of the task"
45
+ msgstr "Afficher le progrès de la tâche"
46
+
47
+ msgid "Name"
48
+ msgstr "Nom"
49
+
50
+ msgid "Owner"
51
+ msgstr "Propriétaire"
52
+
53
+ msgid "Started at"
54
+ msgstr "Démarré à"
55
+
56
+ msgid "Ended at"
57
+ msgstr "Terminé à"
58
+
59
+ msgid "Result"
60
+ msgstr "Résultat"
61
+
62
+ msgid "Task action"
63
+ msgstr "Action de tâche"
64
+
65
+ msgid "Task errors"
66
+ msgstr "Erreurs de tâche"
67
+
68
+ msgid "Resume all tasks paused in error state"
69
+ msgstr "Reprendre toutes les tâches en attente avec des erreurs"
70
+
71
+ msgid "Total tasks found paused in error state"
72
+ msgstr "Total des tâches mises en attente avec des erreurs"
73
+
74
+ msgid "Total tasks resumed"
75
+ msgstr "Totals des tâches terminées"
76
+
77
+ msgid "Resumed tasks"
78
+ msgstr "Tâches terminées"
79
+
80
+ msgid "Task identifier"
81
+ msgstr "Identificateur de tâche"
82
+
83
+ msgid "Total tasks failed to resume"
84
+ msgstr "Total des tâches qui n'ont pas pu être terminées"
85
+
86
+ msgid "Failed tasks"
87
+ msgstr "Tâches ayant échoué"
88
+
89
+ msgid "Total tasks skipped"
90
+ msgstr "Total des tâches évitées"
91
+
92
+ msgid "Skipped tasks"
93
+ msgstr "Tâches évitées"
@@ -0,0 +1,93 @@
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_tasks package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: hammer_cli_foreman_tasks 0.0.9\n"
10
+ "Report-Msgid-Bugs-To: \n"
11
+ "PO-Revision-Date: 2016-02-18 10:36-0500\n"
12
+ "Last-Translator: Dominic Cleal <dominic@cleal.org>, 2017\n"
13
+ "Language-Team: Italian (https://www.transifex.com/foreman/teams/114/it/)\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Language: it\n"
18
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
+
20
+ msgid "ID"
21
+ msgstr "ID"
22
+
23
+ msgid "Cron line"
24
+ msgstr ""
25
+
26
+ msgid "End time"
27
+ msgstr ""
28
+
29
+ msgid "Iteration"
30
+ msgstr ""
31
+
32
+ msgid "State"
33
+ msgstr "Stato"
34
+
35
+ msgid "Recurring logic cancelled."
36
+ msgstr ""
37
+
38
+ msgid "Could not cancel the recurring logic."
39
+ msgstr ""
40
+
41
+ msgid "Recurring logic related actions."
42
+ msgstr ""
43
+
44
+ msgid "Show the progress of the task"
45
+ msgstr ""
46
+
47
+ msgid "Name"
48
+ msgstr "Nome"
49
+
50
+ msgid "Owner"
51
+ msgstr "Proprietario"
52
+
53
+ msgid "Started at"
54
+ msgstr ""
55
+
56
+ msgid "Ended at"
57
+ msgstr ""
58
+
59
+ msgid "Result"
60
+ msgstr "Risultato"
61
+
62
+ msgid "Task action"
63
+ msgstr ""
64
+
65
+ msgid "Task errors"
66
+ msgstr ""
67
+
68
+ msgid "Resume all tasks paused in error state"
69
+ msgstr ""
70
+
71
+ msgid "Total tasks found paused in error state"
72
+ msgstr ""
73
+
74
+ msgid "Total tasks resumed"
75
+ msgstr ""
76
+
77
+ msgid "Resumed tasks"
78
+ msgstr ""
79
+
80
+ msgid "Task identifier"
81
+ msgstr ""
82
+
83
+ msgid "Total tasks failed to resume"
84
+ msgstr ""
85
+
86
+ msgid "Failed tasks"
87
+ msgstr ""
88
+
89
+ msgid "Total tasks skipped"
90
+ msgstr ""
91
+
92
+ msgid "Skipped tasks"
93
+ msgstr ""