hammer_cli_foreman_tasks 0.0.10 → 0.0.11
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
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 239c97cd594485719d3350f4713a4d6b8f642390
|
4
|
+
data.tar.gz: 566eddb498134730b3e53c8e0436bad0ae157c42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e512e3f463d8e29bb92a21b8557cd1a7e40e32ff9256a60bc95c5cd2e1bc236517f4b04aeba36c5a16584a7f0abea899301c4a6d57a861dde91b145ce0500af
|
7
|
+
data.tar.gz: e0dda4e0fc7d32511ff7aa1794029b178ba0e36f5e8c849e1d4813ff040e8cdcb0705ac9680bbf86d052caab76ecc9a9b1da1b0ee91960494a7b68b8fef87b70
|
@@ -4,9 +4,9 @@ module HammerCLIForemanTasks
|
|
4
4
|
# render the progress of the task using polling to the task API
|
5
5
|
def task_progress(task_or_id)
|
6
6
|
task_id = task_or_id.is_a?(Hash) ? task_or_id['id'] : task_or_id
|
7
|
-
TaskProgress.new(task_id) { |id| load_task(id) }
|
8
|
-
|
9
|
-
|
7
|
+
task_progress = TaskProgress.new(task_id) { |id| load_task(id) }
|
8
|
+
task_progress.render
|
9
|
+
task_progress.success?
|
10
10
|
end
|
11
11
|
|
12
12
|
def load_task(id)
|
@@ -14,6 +14,10 @@ module HammerCLIForemanTasks
|
|
14
14
|
render_progress
|
15
15
|
end
|
16
16
|
|
17
|
+
def success?
|
18
|
+
!%w(error warning).include?(@task['result'])
|
19
|
+
end
|
20
|
+
|
17
21
|
private
|
18
22
|
|
19
23
|
def render_progress
|
@@ -40,7 +44,7 @@ module HammerCLIForemanTasks
|
|
40
44
|
|
41
45
|
def render_result
|
42
46
|
puts @task['humanized']['output'] unless @task['humanized']['output'].to_s.empty?
|
43
|
-
STDERR.puts @task['humanized']['errors'].join("\n") unless @task['humanized']['errors'].
|
47
|
+
STDERR.puts "Error: #{@task['humanized']['errors'].join("\n")}" unless @task['humanized']['errors'].empty?
|
44
48
|
end
|
45
49
|
|
46
50
|
def update_task
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hammer_cli_foreman_tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: powerbar
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
89
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.6.12
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: Foreman CLI plugin for showing tasks information for resoruces and users
|