Raise timeout and disable retry for openstack create

Create commands run a risk of creating duplicate resources,
breaking deployment. They should only be run once and with a
single attempt.

Changes for openstack command behavior:
* list/show - unchanged
* create - 1 try (was 6), 60s timeout (was 10 per try)

Change-Id: I33da8be45a70c0e1a2848d258d0e46f822c4e5d9
Closes-Bug: #1496036
This commit is contained in:
Matthew Mosesohn 2015-09-15 19:20:15 +03:00
parent f2eef7717b
commit 0623b4daad
1 changed files with 6 additions and 1 deletions

View File

@ -14,7 +14,12 @@ class Puppet::Provider::Openstack < Puppet::Provider
commands :openstack_cmd => 'openstack'
def self.openstack(*args)
timeout_time = 10
if(args[1] == 'create')
timeout_time = 60
else
timeout_time = 10
end
begin
Timeout.timeout(timeout_time) do
openstack_cmd *args