Class: VagrantPlugins::ProviderOpenStack::Action::Delete
- Inherits:
-
Object
- Object
- VagrantPlugins::ProviderOpenStack::Action::Delete
- Defined in:
- lib/vagrant-openstack/action/delete.rb
Overview
This action reads the state of the machine and puts it in the ‘:machine_state_id` key in the environment.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ Delete
constructor
A new instance of Delete.
Constructor Details
#initialize(app, env) ⇒ Delete
Returns a new instance of Delete.
9 10 11 12 |
# File 'lib/vagrant-openstack/action/delete.rb', line 9 def initialize(app, env) @app = app @logger = Log4r::Logger.new("vagrant_openstack::action::delete") end |
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/vagrant-openstack/action/delete.rb', line 14 def call(env) os = env[:os_connection] server = os.servers.get(env[:machine].id) env[:ui].info(I18n.t("vagrant_openstack.deleting")) server.destroy env[:machine].id = nil @app.call(env) end |