Skip to content

Commit

Permalink
Merge pull request ManageIQ#193 from billfitzgerald0120/timetolive_float
Browse files Browse the repository at this point in the history
Fixed calculation for Ansible playbook service max TTL.
  • Loading branch information
gmcculloug authored Oct 5, 2017
2 parents 5cc73ae + db4c6ef commit ae2736d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 ae2736d

Please sign in to comment.