lib/vagrant-parallels/action.rb in vagrant-parallels-0.0.4.dev vs lib/vagrant-parallels/action.rb in vagrant-parallels-0.0.4

- old
+ new

@@ -74,12 +74,13 @@ next if !env2[:result] b3.use Resume end b2.use Call, GracefulHalt, :stopped, :running do |env2, b3| - next if !env2[:result] - b3.use ForcedHalt + if !env2[:result] + b3.use ForcedHalt + end end else b2.use MessageNotCreated end end @@ -87,10 +88,26 @@ end # This action packages the virtual machine into a single box file. def self.action_package Vagrant::Action::Builder.new.tap do |b| + b.use CheckParallels + b.use Call, Created do |env1, b2| + if !env1[:result] + b2.use MessageNotCreated + next + end + + b2.use SetupPackageFiles + b2.use CheckAccessible + b2.use action_halt + #b2.use ClearForwardedPorts + b2.use ClearSharedFolders + b2.use Export + b2.use PackageConfigFiles + b2.use Package + end end end # This action just runs the provisioners on the machine. def self.action_provision @@ -137,20 +154,18 @@ # This is the action that is primarily responsible for resuming # suspended machines. def self.action_resume Vagrant::Action::Builder.new.tap do |b| - Vagrant::Action::Builder.new.tap do |b| - b.use CheckParallels - b.use Call, Created do |env, b2| - if env[:result] - b2.use CheckAccessible - b2.use EnvSet, :port_collision_repair => false - b2.use Resume - else - b2.use MessageNotCreated - end + b.use CheckParallels + b.use Call, Created do |env, b2| + if env[:result] + b2.use CheckAccessible + b2.use EnvSet, :port_collision_repair => false + b2.use Resume + else + b2.use MessageNotCreated end end end end @@ -247,33 +262,37 @@ end b.use action_start end end + #autoload :PrepareNFSSettings, File.expand_path("../action/prepare_nfs_settings", __FILE__) autoload :Boot, File.expand_path("../action/boot", __FILE__) autoload :CheckAccessible, File.expand_path("../action/check_accessible", __FILE__) autoload :CheckCreated, File.expand_path("../action/check_created", __FILE__) autoload :CheckGuestTools, File.expand_path("../action/check_guest_tools", __FILE__) autoload :CheckParallels, File.expand_path("../action/check_parallels", __FILE__) autoload :CheckRunning, File.expand_path("../action/check_running", __FILE__) autoload :ClearNetworkInterfaces, File.expand_path("../action/clear_network_interfaces", __FILE__) autoload :ClearSharedFolders, File.expand_path("../action/clear_shared_folders", __FILE__) autoload :Created, File.expand_path("../action/created", __FILE__) autoload :Destroy, File.expand_path("../action/destroy", __FILE__) + autoload :Export, File.expand_path("../action/export", __FILE__) autoload :ForcedHalt, File.expand_path("../action/forced_halt", __FILE__) autoload :Import, File.expand_path("../action/import", __FILE__) autoload :IsPaused, File.expand_path("../action/is_paused", __FILE__) autoload :IsRunning, File.expand_path("../action/is_running", __FILE__) autoload :IsSaved, File.expand_path("../action/is_saved", __FILE__) autoload :MatchMACAddress, File.expand_path("../action/match_mac_address", __FILE__) autoload :MessageAlreadyRunning, File.expand_path("../action/message_already_running", __FILE__) autoload :MessageNotCreated, File.expand_path("../action/message_not_created", __FILE__) autoload :MessageNotRunning, File.expand_path("../action/message_not_running", __FILE__) autoload :MessageWillNotDestroy, File.expand_path("../action/message_will_not_destroy", __FILE__) - #autoload :PrepareNFSSettings, File.expand_path("../action/prepare_nfs_settings", __FILE__) + autoload :Package, File.expand_path("../action/package", __FILE__) + autoload :PackageConfigFiles, File.expand_path("../action/package_config_files", __FILE__) autoload :PruneNFSExports, File.expand_path("../action/prune_nfs_exports", __FILE__) autoload :RegisterTemplate, File.expand_path("../action/register_template", __FILE__) autoload :Resume, File.expand_path("../action/resume", __FILE__) + autoload :SetupPackageFiles, File.expand_path("../action/setup_package_files", __FILE__) autoload :ShareFolders, File.expand_path("../action/share_folders", __FILE__) autoload :Suspend, File.expand_path("../action/suspend", __FILE__) autoload :UnregisterTemplate, File.expand_path("../action/unregister_template", __FILE__) end