Class: Chef::Resource::FogKeyPair

Inherits:
LWRPBase
  • Object
show all
Defined in:
lib/chef/resource/fog_key_pair.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ FogKeyPair

Returns a new instance of FogKeyPair.



6
7
8
9
# File 'lib/chef/resource/fog_key_pair.rb', line 6

def initialize(*args)
  super
  @provisioner = ChefMetal.enclosing_provisioner
end

Instance Method Details

#after(&block) ⇒ Object

Proc that runs after the resource completes. Called with (resource, private_key, public_key)



31
32
33
# File 'lib/chef/resource/fog_key_pair.rb', line 31

def after(&block)
  block ? @after = block : @after
end

#after_createdObject



11
12
13
14
# File 'lib/chef/resource/fog_key_pair.rb', line 11

def after_created
  # Make the credentials usable
  provisioner.key_pairs[name] = self
end