Class: Engineyard::Local::Command::Terminate
- Inherits:
-
Base
- Object
- Vagrant::Command::Base
- Base
- Engineyard::Local::Command::Terminate
- Defined in:
- lib/engineyard-local/command/terminate.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #cached_data_path ⇒ Object
-
#exec(*args) ⇒ Object
Wrap Vagrant’s :destroy.
Methods inherited from Base
Methods inherited from Vagrant::Command::Base
Methods included from Helpers
#insert_linebreaks, #merge_run_options, #run
Constructor Details
This class inherits a constructor from Engineyard::Local::Command::Base
Instance Method Details
#cached_data_path ⇒ Object
19 20 21 |
# File 'lib/engineyard-local/command/terminate.rb', line 19 def cached_data_path "#{@env.root_path}/.ey_local_data" end |
#exec(*args) ⇒ Object
Wrap Vagrant’s :destroy
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/engineyard-local/command/terminate.rb', line 7 def exec(*args) with_target_vms do |vm| if vm.created? env.ui.info( I18n.t( "eylocal.terminate.destroying" ) ) vm.destroy File.unlink(cached_data_path) if FileTest.exist? cached_data_path else env.ui.info( I18n.t( "eylocal.terminate.not_created" ) ) end end end |