right_chimp 2.2 → 2.2.1

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: deb10edd310b0e400ce12bafcc0592b52928cdb6
4
- data.tar.gz: d9a8ede4dfd0778475dbfcc26a38cacf55ada64b
3
+ metadata.gz: 98ed40eaf076ab7641a5a8d8fae25363bfb58428
4
+ data.tar.gz: 55957f53d165514a7ce2c205f5c2fd8633f54fad
5
5
  SHA512:
6
- metadata.gz: 8d74afffc79fc7acc94041edd181e8b8f2f2cc60b7747e00004d6814b0edb556d0acd01c6613457c2efc917eccac03107171b3a0bbb7d721b33d9862784193ff
7
- data.tar.gz: 1c2d8eeb42cb8e14245d767500cbd4dbff06b88e3a84e798ec84a3861d97639375fa6e08e838ac6086169f1a049601f3d6a1508aad014a9dade01e31be41e829
6
+ metadata.gz: 37e0b3980f158a0e0ef59ca1bb7ee808508e56c1d1e70b0ce31999e1fd16e3b37a4104c5fd09f5669290d8925d108be9be50fbc3f48a6b91656ebd1595e012b3
7
+ data.tar.gz: 08363318bf8ea6bda61ae086f9d132f55f7eb41c4751c62140c610d5b8971f5deb5d36c360ba99b0aa882c088294c2f20e6a21c2cbbc4e4332f4207ffb0590cc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- right_chimp (2.2)
4
+ right_chimp (2.2.1)
5
5
  highline (~> 1.7.2)
6
6
  nokogiri (~> 1.6.7.1)
7
7
  progressbar (~> 0.11.0)
@@ -73,4 +73,4 @@ DEPENDENCIES
73
73
  rspec
74
74
 
75
75
  BUNDLED WITH
76
- 1.13.2
76
+ 1.13.6
@@ -1,5 +1,5 @@
1
- #The Chimp class encapsulates the command-line program logic
2
1
  #
2
+ # The Chimp class encapsulates the command-line program logic
3
3
  module Chimp
4
4
  class Chimp
5
5
  attr_accessor :concurrency, :delay, :retry_count, :hold, :progress, :prompt,
@@ -63,7 +63,7 @@ module Chimp
63
63
  @template = nil
64
64
  @script = nil
65
65
  @ssh = nil
66
- @ssh_user = "rightscale"
66
+ @ssh_user = 'rightscale'
67
67
  @report = nil
68
68
  @inputs = {}
69
69
  @set_tags = []
@@ -276,14 +276,18 @@ module Chimp
276
276
  #Make an 1.5 call to extract name, by loading resource.
277
277
  Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call : client.resource(#{s.params['right_script']['href'].scan(/=(.*)/).last.last})"
278
278
  begin
279
+ tries ||= 3
279
280
  the_name = Connection.client.resource(s.params['right_script']['href'].scan(/=(.*)/).last.last).name
280
281
  rescue
281
- Log.error "[#{Chimp.get_job_uuid}] Failed to make 1.5 call for rightscript href"
282
+ Log.error "[#{Chimp.get_job_uuid}] Failed to make 1.5 call for rightscript href (retrying)"
283
+ sleep 30
284
+ retry unless (tries -= 1).zero?
285
+ Log.error "[#{Chimp.get_job_uuid}] Failed to make 1.5 call for rightscript href (giving up)"
282
286
  end
283
287
  s.params['right_script']['name'] = the_name
284
- @executable=s
288
+ @executable = s
285
289
  else
286
- #If its not an url, go ahead try to locate it in the ST"
290
+ # If its not an url, go ahead try to locate it in the ST"
287
291
  @executable = detect_right_script(@server_template, @script)
288
292
  end
289
293
  else
@@ -592,8 +596,16 @@ module Chimp
592
596
  names.each do |array_name|
593
597
  # Find if arrays exist, if not raise warning.
594
598
  # One API call per array
595
- Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.server_arrays.index(:filter => [#{array_name}])"
596
- result = Connection.client.server_arrays.index(:filter => ["name==#{array_name}"])
599
+ begin
600
+ Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.server_arrays.index(:filter => [#{array_name}])"
601
+ tries ||= 3
602
+ result = Connection.client.server_arrays.index(:filter => ["name==#{array_name}"])
603
+ rescue
604
+ Log.error "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.server_arrays.index failed (retrying)."
605
+ sleep 30
606
+ retry unless (tries -= 1).zero?
607
+ Log.error "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.server_arrays.index failed (giving up)."
608
+ end
597
609
  # Result is an array with all the server arrays
598
610
  if result.size != 0
599
611
  if @exact
@@ -729,9 +741,12 @@ module Chimp
729
741
  st.each do |s|
730
742
  Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.resource(#{s[1]['href']})"
731
743
  begin
732
- temp=Connection.client.resource(s[1]['href'])
744
+ tries ||= 3
745
+ temp = Connection.client.resource(s[1]['href'])
733
746
  rescue
734
747
  Log.error "[#{Chimp.get_job_uuid}] Failed to load href for ST"
748
+ sleep 30
749
+ retry unless (tries -= 1).zero?
735
750
  end
736
751
  temp.runnable_bindings.index.each do |x|
737
752
  # Look for first match
@@ -812,18 +827,22 @@ module Chimp
812
827
  # "href"=>"/api/server_templates/351930003"} ]
813
828
  Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.resource (ST)"
814
829
  begin
815
- temp=Connection.client.resource(s[1]['href'])
830
+ tries ||= 3
831
+ temp = Connection.client.resource(s[1]['href'])
816
832
  Log.debug "[#{Chimp.get_job_uuid}] API 1.5 call client.resource (ST) complete"
817
833
  temp.runnable_bindings.index.each do |x|
818
834
  # only add the operational ones
819
- if x.sequence == "operational"
835
+ if x.sequence == 'operational'
820
836
  name = x.raw['right_script']['name']
821
837
  op_scripts.push([name, x])
822
838
  end
823
839
  end
824
840
  rescue Exception => e
825
- Log.error "[#{Chimp.get_job_uuid}] API 1.5 call client.resource (ST) failed"
841
+ Log.error "[#{Chimp.get_job_uuid}] API 1.5 call client.resource (ST) failed (retrying)"
826
842
  Log.error "[#{Chimp.get_job_uuid}] #{e.message}"
843
+ sleep 30
844
+ retry unless (tries -= 1).zero?
845
+ Log.error "[#{Chimp.get_job_uuid}] API 1.5 call client.resource (ST) failed (giving up)"
827
846
  end
828
847
  end
829
848
 
@@ -902,10 +921,14 @@ module Chimp
902
921
  # This will be useful for later on when we need to run scripts
903
922
  Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.resource (SERVER) for task creation"
904
923
  begin
924
+ tries ||= 3
905
925
  s.object = Connection.client.resource(server['href'])
906
926
  Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.resource (SERVER) for task creation COMPLETE"
907
927
  rescue
908
- Log.error "[#{Chimp.get_job_uuid}] Failed to load server href via API1.5 for task creation"
928
+ Log.error "[#{Chimp.get_job_uuid}] Failed to load server href via API1.5 for task creation (retrying)"
929
+ sleep 30
930
+ retry unless (tries -= 1).zero?
931
+ Log.error "[#{Chimp.get_job_uuid}] Failed to load server href via API1.5 for task creation (giving up)"
909
932
  end
910
933
 
911
934
  e = nil
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module Chimp
2
- VERSION = '2.2'
2
+ VERSION = '2.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_chimp
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.2'
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - RightScale Operations
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-26 00:00:00.000000000 Z
11
+ date: 2016-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -147,25 +147,25 @@ files:
147
147
  - docker/Dockerfile
148
148
  - docker/right_chimp.sh
149
149
  - lib/right_chimp.rb
150
- - lib/right_chimp/Chimp.rb
151
- - lib/right_chimp/Log.rb
150
+ - lib/right_chimp/chimp.rb
152
151
  - lib/right_chimp/daemon/chimp_daemon.rb
153
152
  - lib/right_chimp/daemon/chimp_daemon_client.rb
154
- - lib/right_chimp/exec/Executor.rb
155
153
  - lib/right_chimp/exec/exec_array.rb
156
154
  - lib/right_chimp/exec/exec_callback.rb
157
155
  - lib/right_chimp/exec/exec_noop.rb
158
156
  - lib/right_chimp/exec/exec_report.rb
159
157
  - lib/right_chimp/exec/exec_rightscript.rb
160
158
  - lib/right_chimp/exec/exec_ssh.rb
159
+ - lib/right_chimp/exec/executor.rb
161
160
  - lib/right_chimp/id_manager.rb
161
+ - lib/right_chimp/log.rb
162
162
  - lib/right_chimp/queue/chimp_queue.rb
163
163
  - lib/right_chimp/queue/execution_group.rb
164
164
  - lib/right_chimp/queue/queue_worker.rb
165
- - lib/right_chimp/resources/Connection.rb
166
- - lib/right_chimp/resources/Executable.rb
167
- - lib/right_chimp/resources/Server.rb
168
- - lib/right_chimp/resources/Task.rb
165
+ - lib/right_chimp/resources/connection.rb
166
+ - lib/right_chimp/resources/executable.rb
167
+ - lib/right_chimp/resources/server.rb
168
+ - lib/right_chimp/resources/task.rb
169
169
  - lib/right_chimp/templates/all_jobs.erb
170
170
  - lib/right_chimp/templates/default.css
171
171
  - lib/right_chimp/templates/greenscreen.css