mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
VMs IP is no longer stored in machines data_dir. Cleanup
is no longer needed.
This commit is contained in:
parent
711b103ed4
commit
cee5bbecb4
@ -81,10 +81,8 @@ module VagrantPlugins
|
||||
b2.use Call, IsRunning do |env2, b3|
|
||||
next if !env2[:result]
|
||||
|
||||
# VM is running, halt it.. Cleanup running instance data. Now
|
||||
# only IP address is stored.
|
||||
# VM is running, halt it.
|
||||
b3.use HaltDomain
|
||||
b3.use CleanupDataDir
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -104,9 +102,6 @@ module VagrantPlugins
|
||||
b2.use ConnectLibvirt
|
||||
b2.use DestroyDomain
|
||||
b2.use DestroyNetworks
|
||||
|
||||
# Cleanup running instance data. Now only IP address is stored.
|
||||
b2.use CleanupDataDir
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -273,7 +268,6 @@ module VagrantPlugins
|
||||
autoload :HaltDomain, action_root.join("halt_domain")
|
||||
autoload :SuspendDomain, action_root.join("suspend_domain")
|
||||
autoload :ResumeDomain, action_root.join("resume_domain")
|
||||
autoload :CleanupDataDir, action_root.join("cleanup_data_dir")
|
||||
autoload :ReadState, action_root.join("read_state")
|
||||
autoload :ReadSSHInfo, action_root.join("read_ssh_info")
|
||||
autoload :TimedProvision, action_root.join("timed_provision")
|
||||
|
@ -1,22 +0,0 @@
|
||||
require 'log4r'
|
||||
|
||||
module VagrantPlugins
|
||||
module Libvirt
|
||||
module Action
|
||||
class CleanupDataDir
|
||||
def initialize(app, env)
|
||||
@logger = Log4r::Logger.new("vagrant_libvirt::action::cleanup_data_dir")
|
||||
@app = app
|
||||
end
|
||||
|
||||
def call(env)
|
||||
# Remove file holding IP address
|
||||
ip_file_path = env[:machine].data_dir + 'ip'
|
||||
File.delete(ip_file_path) if File.exists?(ip_file_path)
|
||||
|
||||
@app.call(env)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user