Class: Engineyard::Local::Command::Start
- Inherits:
-
Base
- Object
- Vagrant::Command::Base
- Base
- Engineyard::Local::Command::Start
- Defined in:
- lib/engineyard-local/command/start.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#exec(*args) ⇒ Object
Wrap Vagrant’s :resume so that it checks to see if the instance is suspended first, and gives helpful output if it is not.
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
#exec(*args) ⇒ Object
Wrap Vagrant’s :resume so that it checks to see if the instance is suspended first, and gives helpful output if it is not.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/engineyard-local/command/start.rb', line 7 def exec(*args) with_target_vms do |vm| if vm.created? if ( vm.state == :saved ) vm.resume elsif ( vm.state == :running ) env.ui.info( insert_linebreaks( I18n.t( "eylocal.start.running" ) ) ) else env.ui.info( insert_linebreaks( I18n.t( "eylocal.start.not_startable" , :state => vm.state ) ) ) end else env.ui.info( I18n.t( "eylocal.start.not_created" ) ) end end end |