handle new keystone and quantum connection errors

This commit is contained in:
Vladimir Kuklin 2013-03-13 04:54:33 +04:00
parent f34ca27c2d
commit 48deaf2c30
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ class Puppet::Provider::Keystone < Puppet::Provider
rv = keystone('--token', admin_token, '--endpoint', admin_endpoint, args)
break
rescue Exception => e
if e.message =~ /(\(HTTP\s+400\))|(\[Errno 111\]\s+Connection\s+refused)/
if e.message =~ /(\(HTTP\s+400\))|(\[Errno 111\]\s+Connection\s+refused)|(503\s+Service\s+Unavailable)|(Max\s+retries\s+exceeded)/
notice("Can't connect to keystone backend. Waiting for retry...")
retries -= 1
sleep 2

View File

@ -108,7 +108,7 @@ class Puppet::Provider::Quantum < Puppet::Provider
rv = quantum('--os-tenant-name', q['admin_tenant_name'], '--os-username', q['admin_user'], '--os-password', q['admin_password'], '--os-auth-url', auth_endpoint, args)
break
rescue Exception => e
if e.message =~ /(\(HTTP\s+400\))|(\[Errno 111\]\s+Connection\s+refused)|(503\s+Service\s+Unavailable)/
if e.message =~ /(\(HTTP\s+400\))|(\[Errno 111\]\s+Connection\s+refused)|(503\s+Service\s+Unavailable)|(Max\s+retries\s+exceeded)/
notice("Can't connect to quantum backend. Waiting for retry...")
retries -= 1
sleep 2