lib/vagrant-skytap/action.rb in vagrant-skytap-0.2.10 vs lib/vagrant-skytap/action.rb in vagrant-skytap-0.3.0

- old
+ new

@@ -169,43 +169,32 @@ end # This action is called to SSH into the machine. def self.action_ssh Vagrant::Action::Builder.new.tap do |b| - b.use action_fetch_environment - b.use Call, ExistenceCheck do |env1, b1| - case result = env1[:result] - when :missing_environment, :missing_vm, :no_vms - b1.use MessageNotCreated - else - b1.use SSHExec - end - end + b.use CheckCreated + b.use CheckRunning + b.use SSHExec end end def self.action_ssh_run Vagrant::Action::Builder.new.tap do |b| - b.use action_fetch_environment - b.use Call, ExistenceCheck do |env1, b1| - case result = env1[:result] - when :missing_environment, :missing_vm, :no_vms - b1.use MessageNotCreated - else - b1.use SSHRun - end - end + b.use CheckCreated + b.use CheckRunning + b.use SSHRun end end # Note: Provision and SyncedFolders perform actions before and after # calling the next middleware in the sequence. Both require that # the machine be booted before those calls return. This requirement # can be satisfied by putting the WaitForCommunicator middleware # later in the sequence. def self.action_prepare_boot Vagrant::Action::Builder.new.tap do |b| + b.use GetHostVM b.use PrepareNFSSettings b.use PrepareNFSValidIds b.use Provision b.use SyncedFolderCleanup b.use SyncedFolders @@ -256,10 +245,11 @@ end def self.action_update_hardware Vagrant::Action::Builder.new.tap do |b| b.use StoreExtraData + b.use GetHostVM b.use SetUpVm b.use Call, IsStopped do |env, b1| if env[:result] b1.use UpdateHardware b1.use SetHostname @@ -340,17 +330,20 @@ # The autoload farm action_root = Pathname.new(File.expand_path("../action", __FILE__)) autoload :StoreExtraData, action_root.join("store_extra_data") autoload :AddVmToEnvironment, action_root.join("add_vm_to_environment") + autoload :CheckCreated, action_root.join("check_created") + autoload :CheckRunning, action_root.join("check_running") autoload :ClearForwardedPorts, action_root.join("clear_forwarded_ports") autoload :ComposeEnvironment, action_root.join("compose_environment") autoload :CreateEnvironment, action_root.join("create_environment") autoload :DeleteEnvironment, action_root.join("delete_environment") autoload :DeleteVm, action_root.join("delete_vm") autoload :ExistenceCheck, action_root.join("existence_check") autoload :FetchEnvironment, action_root.join("fetch_environment") autoload :ForwardPorts, action_root.join("forward_ports") + autoload :GetHostVM, action_root.join("get_host_vm") autoload :InitializeAPIClient, action_root.join("initialize_api_client") autoload :InitialState, action_root.join("initial_state") autoload :IsParallelized, action_root.join("is_parallelized") autoload :IsRunning, action_root.join("is_running") autoload :IsStopped, action_root.join("is_stopped")