Class: Chef::Provisioning::AWSDriver::AWSProvider

Inherits:
Chef::Provider::LWRPBase
  • Object
show all
Defined in:
lib/chef/provisioning/aws_driver/aws_provider.rb

Defined Under Namespace

Classes: StatusTimeoutError

Constant Summary collapse

AWSResource =
Chef::Provisioning::AWSDriver::AWSResource

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#purgingObject (readonly)

Returns the value of attribute purging.



152
153
154
# File 'lib/chef/provisioning/aws_driver/aws_provider.rb', line 152

def purging
  @purging
end

Class Method Details

.retry_with_backoff(*retry_on) ⇒ Object

Retry a block with an doubling backoff time (maximum wait of 10 seconds).

Parameters:

  • retry_on (Exception)

    An exception to retry on, defaults to RuntimeError



289
290
291
292
293
294
295
# File 'lib/chef/provisioning/aws_driver/aws_provider.rb', line 289

def self.retry_with_backoff(*retry_on)
  retry_on ||= [RuntimeError]
  Retryable.retryable(:tries => 10, :sleep => lambda { |n| [2**n, 16].min }, :on => retry_on) do |retries, exception|
    Chef::Log.debug("Current exception in retry_with_backoff is #{exception.inspect}")
    yield
  end
end

Instance Method Details

#action_handlerObject



22
23
24
# File 'lib/chef/provisioning/aws_driver/aws_provider.rb', line 22

def action_handler
  @action_handler ||= Chef::Provisioning::ChefProviderActionHandler.new(self)
end

#converge_by(*args, &block) ⇒ Object

Return the damned value from the block, not whatever weirdness converge_by normally returns.



39
40
41
42
43
44
45
# File 'lib/chef/provisioning/aws_driver/aws_provider.rb', line 39

def converge_by(*args, &block)
  result = nil
  super(*args) do
    result = block.call
  end
  result
end

#regionObject



31
32
33
# File 'lib/chef/provisioning/aws_driver/aws_provider.rb', line 31

def region
  new_resource.driver.region
end

#whyrun_supported?Boolean

All these need to implement whyrun

Returns:

  • (Boolean)


27
28
29
# File 'lib/chef/provisioning/aws_driver/aws_provider.rb', line 27

def whyrun_supported?
  true
end