lib/vagrant-libvirt/plugin.rb in vagrant-libvirt-0.9.0 vs lib/vagrant-libvirt/plugin.rb in vagrant-libvirt-0.10.0

- old
+ new

@@ -4,12 +4,11 @@ require 'vagrant' rescue LoadError raise 'The Vagrant Libvirt plugin must be run within Vagrant.' end -# compatibility fix to define constant not available Vagrant <1.6 -::Vagrant::MachineState::NOT_CREATED_ID ||= :not_created +require 'vagrant-libvirt/util/compat' module VagrantPlugins module ProviderLibvirt class Plugin < Vagrant.plugin('2') name 'libvirt' @@ -25,11 +24,11 @@ provider('libvirt', parallel: true, box_optional: true) do require_relative 'provider' Provider end - action_hook(:remove_libvirt_image) do |hook| + action_hook(*(Util::Compat.action_hook_args(:remove_libvirt_image, :box_remove))) do |hook| require_relative 'action' hook.after Vagrant::Action::Builtin::BoxRemove, Action.remove_libvirt_image end guest_capability('linux', 'mount_9p_shared_folder') do @@ -47,9 +46,14 @@ end provider_capability(:libvirt, :public_address) do require_relative 'cap/public_address' Cap::PublicAddress + end + + provider_capability(:libvirt, :snapshot_list) do + require_relative 'cap/snapshots' + Cap::Snapshots end # lower priority than nfs or rsync # https://github.com/vagrant-libvirt/vagrant-libvirt/pull/170 synced_folder('9p', 4) do