opsworks_interactor 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/opsworks_interactor.rb +9 -15
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 109bbd26533d2195f0b4009fcbf2d4320392e8d3
4
- data.tar.gz: ae6604872078010fee3e41bf3e762b2d718d6446
3
+ metadata.gz: 62f1a9b712c88917063bf1d15779f12231602fc2
4
+ data.tar.gz: f2837796d701ce11d9bd6e859b759465de56b82d
5
5
  SHA512:
6
- metadata.gz: 523c2f58067eef4f9beab3bab3568c6fa35b26db9f7c1bd843fb85009f4fef7071e95fe913804538095c4d13d861037bd36fb048a8da9d179a3ee023312fcbab
7
- data.tar.gz: 55d8763865232ae3a2e8af488d6a7454e2921df3c82ea53bff21d099d89fcb43ccdbbb3e24e8ce2fbc30e0ee66e9236873e8e3fc290bb3331b29acb376f6026f
6
+ metadata.gz: b86bf385a08ccd2c49a329c52707b59558582c4d7dc8fea2d55547ce31dac2de2d77391b2a64ce227693692907e929851723ca881e72d1d7e8ea71bc257a5f03
7
+ data.tar.gz: b7cf663266bc0142a52b0670e0a6aed09839715986731b72da461ce2b8035e8376ac8589a8430a600456d2411f61f27f8c3253a7151681ceac03f5ab2aa48796
@@ -1,7 +1,6 @@
1
1
  require 'aws-sdk'
2
+ require 'timeout'
2
3
  class OpsworksInteractor
3
- Aws::Waiters::Errors::TimeoutError = Class.new(Aws::Waiters::Errors::WaiterFailed)
4
-
5
4
  begin
6
5
  require 'redis-semaphore'
7
6
  rescue LoadError
@@ -75,18 +74,13 @@ class OpsworksInteractor
75
74
  # Polls Opsworks for timeout seconds until deployment_id has completed
76
75
  def wait_until_deploy_completion(deployment_id, timeout)
77
76
  started_at = Time.now
78
-
79
- @opsworks_client.wait_until(
80
- :deployment_successful,
81
- deployment_ids: [deployment_id]
82
- ) do |w|
83
- # disable max attempts
84
- w.max_attempts = nil
85
- # poll for a time period, instead of a number of attempts
86
- before_wait do |_attempts, _response|
87
- if (Time.now - started_at) > timeout
88
- raise Aws::Waiters::Errors::TimeoutError
89
- end
77
+ Timeout::timeout(timeout) do
78
+ @opsworks_client.wait_until(
79
+ :deployment_successful,
80
+ deployment_ids: [deployment_id]
81
+ ) do |w|
82
+ # disable max attempts
83
+ w.max_attempts = nil
90
84
  end
91
85
  end
92
86
  end
@@ -115,7 +109,7 @@ class OpsworksInteractor
115
109
  instance_id: instance.instance_id
116
110
  )
117
111
  ensure
118
- attach_to_elbs(instance: instance, load_balancers: load_balancers) if load_blaancers
112
+ attach_to_elbs(instance: instance, load_balancers: load_balancers) if load_balancers
119
113
 
120
114
  log("=== Done deploying on #{instance.hostname} ===\n\n")
121
115
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsworks_interactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Davies