Class: Kitchen::Driver::Rax
- Inherits:
-
Base
- Object
- Base
- Kitchen::Driver::Rax
- Defined in:
- lib/kitchen/driver/rax.rb
Instance Attribute Summary collapse
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
- #create(state) ⇒ Object
- #destroy(state) ⇒ Object
-
#initialize(config) ⇒ Rax
constructor
A new instance of Rax.
Constructor Details
#initialize(config) ⇒ Rax
Returns a new instance of Rax.
35 36 37 38 |
# File 'lib/kitchen/driver/rax.rb', line 35 def initialize(config) super Fog.timeout = config[:wait_for].to_i end |
Instance Attribute Details
#state ⇒ Object
Returns the value of attribute state.
12 13 14 |
# File 'lib/kitchen/driver/rax.rb', line 12 def state @state end |
Instance Method Details
#create(state) ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/kitchen/driver/rax.rb', line 40 def create(state) info("Creating a new Rackspace instance.") server = Kitchen::Driver::Cloud.create_server(instance, config) wait_for_build_completion(server, state, config) check_winrm_connectivity(instance, state[:hostname], state[:password]) rescue Fog::Errors::Error, Excon::Errors::Error => ex raise ActionFailed, ex. end |
#destroy(state) ⇒ Object
49 50 51 52 53 |
# File 'lib/kitchen/driver/rax.rb', line 49 def destroy(state) return if state[:server_id].nil? state = Kitchen::Driver::Cloud.delete_server(instance, config, state) info("Rackspace instance <#{state[:server_id]}> destroyed.") end |