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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/right_chimp/{Chimp.rb → chimp.rb} +35 -12
- data/lib/right_chimp/exec/{Executor.rb → executor.rb} +0 -0
- data/lib/right_chimp/{Log.rb → log.rb} +0 -0
- data/lib/right_chimp/resources/{Connection.rb → connection.rb} +0 -0
- data/lib/right_chimp/resources/{Executable.rb → executable.rb} +0 -0
- data/lib/right_chimp/resources/{Server.rb → server.rb} +0 -0
- data/lib/right_chimp/resources/{Task.rb → task.rb} +0 -0
- data/lib/right_chimp/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98ed40eaf076ab7641a5a8d8fae25363bfb58428
|
4
|
+
data.tar.gz: 55957f53d165514a7ce2c205f5c2fd8633f54fad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37e0b3980f158a0e0ef59ca1bb7ee808508e56c1d1e70b0ce31999e1fd16e3b37a4104c5fd09f5669290d8925d108be9be50fbc3f48a6b91656ebd1595e012b3
|
7
|
+
data.tar.gz: 08363318bf8ea6bda61ae086f9d132f55f7eb41c4751c62140c610d5b8971f5deb5d36c360ba99b0aa882c088294c2f20e6a21c2cbbc4e4332f4207ffb0590cc
|
data/Gemfile.lock
CHANGED
@@ -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 =
|
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
|
-
|
596
|
-
|
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
|
-
|
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
|
-
|
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 ==
|
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
|
File without changes
|
File without changes
|
data/lib/right_chimp/version.rb
CHANGED
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:
|
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-
|
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/
|
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/
|
166
|
-
- lib/right_chimp/resources/
|
167
|
-
- lib/right_chimp/resources/
|
168
|
-
- lib/right_chimp/resources/
|
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
|