Skip to content

Commit f46b0aa

Browse files
committed
migrate UpdateHost action to use Updater class
1 parent 90fe715 commit f46b0aa

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
require 'vagrant-hostmanager/hosts_file'
1+
require 'vagrant-hostmanager/hosts_file/updater'
22
require 'vagrant-hostmanager/util'
33

44
module VagrantPlugins
55
module HostManager
66
module Action
77
class UpdateHost
8-
include HostsFile
98

109
def initialize(app, env)
1110
@app = app
12-
@global_env = env[:global_env]
13-
@provider = env[:provider]
14-
@config = Util.get_config(@global_env)
11+
12+
global_env = env[:global_env]
13+
@config = Util.get_config(global_env)
14+
@updater = HostsFile::Updater.new(global_env, env[:provider])
15+
1516
@logger = Log4r::Logger.new('vagrant::hostmanager::update_host')
1617
end
1718

1819
def call(env)
1920
if @config.hostmanager.manage_host?
2021
env[:ui].info I18n.t('vagrant_hostmanager.action.update_host')
21-
update_host
22+
@updater.update_host
2223
end
2324

2425
@app.call(env)
2526
end
2627
end
2728
end
2829
end
29-
end
30-
30+
end

0 commit comments

Comments
 (0)