hammer_cli_foreman_tasks 0.0.3 → 0.0.4

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: 714c7e02e10d7ca19a16ebed22e430dd42a1db99
4
- data.tar.gz: b6771ac5b22e44c109203fa4064217b695625983
3
+ metadata.gz: d182a6a9c8a0d4e1e1b7cf35c2c337c74837cc5e
4
+ data.tar.gz: be2862123efeece0f4d76b273380ae87d4e7d361
5
5
  SHA512:
6
- metadata.gz: cc9f7d5747be40b4246ca307a3bb3f10e8dc7de19cc72a4baab6196b905c500e3989638ca068365bdb8c38f83146feeea86c26d95de7147e4e594e876257d379
7
- data.tar.gz: 8ebc19af9dd0e8aeba3773ad11bf16e810525d072da63ad36a0560c84431456ded78d5816274e6cf6216b4684e222f2ce857f34f74f8f0c2363e8e28957501c0
6
+ metadata.gz: 4f7d47d2c5eaec1c18daab8208de068c4e9f9ae957e635b8b0841dcd7a1c3596c471787859236880ac72024a6b107327d54faff7077faa0d49e698ea366b818b
7
+ data.tar.gz: 1360456aba178ab4ba9d36f48f886f3760d46bf52c63d918faa06eef275bd3bc6529be55209158fe563c0bb588cc6abd93da563f6cb78121004a54b2fe6e6f6f
@@ -10,7 +10,7 @@ module HammerCLIForemanTasks
10
10
  end
11
11
 
12
12
  def load_task(id)
13
- self.class.resource(:foreman_tasks).call(:show, :id => id)
13
+ HammerCLIForeman.foreman_resource!(:foreman_tasks).call(:show, :id => id)
14
14
  end
15
15
 
16
16
  end
@@ -11,11 +11,7 @@ module HammerCLIForemanTasks
11
11
 
12
12
  def render
13
13
  update_task
14
- if task_pending?
15
- render_progress
16
- else
17
- render_result
18
- end
14
+ render_progress
19
15
  end
20
16
 
21
17
  private
@@ -24,7 +20,7 @@ module HammerCLIForemanTasks
24
20
  progress_bar do |bar|
25
21
  begin
26
22
  while true
27
- bar.show(:msg => "Task #{@task_id} progress", :done => @task['progress'].to_f, :total => 1)
23
+ bar.show(:msg => progress_message, :done => @task['progress'].to_f, :total => 1)
28
24
  if task_pending?
29
25
  sleep interval
30
26
  update_task
@@ -38,8 +34,11 @@ module HammerCLIForemanTasks
38
34
  end
39
35
  end
40
36
 
37
+ def progress_message
38
+ "Task #{@task_id} #{task_pending? ? @task['state'] : @task['result']}"
39
+ end
40
+
41
41
  def render_result
42
- puts "Task %{uuid}: %{result}" % { :uuid => @task_id, :result => @task['result'] }
43
42
  unless @task['humanized']['output'].to_s.empty?
44
43
  puts @task['humanized']['output']
45
44
  end
@@ -1,5 +1,5 @@
1
1
  module HammerCLIForemanTasks
2
2
  def self.version
3
- @version ||= Gem::Version.new('0.0.3')
3
+ @version ||= Gem::Version.new('0.0.4')
4
4
  end
5
5
  end
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.3
4
+ version: 0.0.4
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: 2014-05-27 00:00:00.000000000 Z
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: powerbar
@@ -54,7 +54,7 @@ files:
54
54
  - lib/hammer_cli_foreman_tasks/task.rb
55
55
  - lib/hammer_cli_foreman_tasks/task_progress.rb
56
56
  - lib/hammer_cli_foreman_tasks/version.rb
57
- homepage: https://github.com/iNecas/hammer-cli-foreman-tasks
57
+ homepage: https://github.com/theforeman/hammer-cli-foreman-tasks
58
58
  licenses:
59
59
  - GPL-3
60
60
  metadata: {}