Skip to content

Commit

Permalink
Merge pull request #193 from billfitzgerald0120/timetolive_float
Browse files Browse the repository at this point in the history
Fixed calculation for Ansible playbook service max TTL.
(cherry picked from commit ae2736d)

https://bugzilla.redhat.com/show_bug.cgi?id=1501524
  • Loading branch information
gmcculloug authored and simaishi committed Nov 13, 2017
1 parent 7485943 commit 0d4b929
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Expand Up @@ -53,7 +53,7 @@ def retry_interval
max_retry_count = @handle.root['ae_state_max_retries']
return if ttl.zero? || max_retry_count.zero?

interval = ttl / max_retry_count
interval = ttl / max_retry_count.to_f
if interval > MIN_RETRY_INTERVAL
@handle.log('info', "Setting retry interval to #{interval} time to live #{ttl} / #{max_retry_count}")
@handle.root['ae_retry_interval'] = interval.minutes
Expand Down
Expand Up @@ -94,9 +94,9 @@
Spec::Support::MiqAeMockObject.new('service' => svc_service, 'service_action' => 'Provision', 'ae_state_max_retries' => 100)
end

context "600 ttl, 100 retries eq interval 6" do
let(:ae_retry_interval) { 6.minutes }
let(:ttl) { 600 }
context "650 ttl, 100 retries eq interval 6.5" do
let(:ae_retry_interval) { 6.5.minutes }
let(:ttl) { 650 }
it_behaves_like "#ttl"
end

Expand All @@ -117,9 +117,9 @@
Spec::Support::MiqAeMockObject.new('service' => svc_service, 'service_action' => 'Retirement', 'ae_state_max_retries' => 100)
end

context "600 ttl, 100 retries eq interval 6" do
let(:ae_retry_interval) { 6.minutes }
let(:ttl) { 600 }
context "650 ttl, 100 retries eq interval 6.5" do
let(:ae_retry_interval) { 6.5.minutes }
let(:ttl) { 650 }
it_behaves_like "#ttl"
end

Expand Down

0 comments on commit 0d4b929

Please sign in to comment.