Add mappers for synced folder client -> vagrant synced folder
This commit is contained in:
parent
4bb170fba3
commit
a3c3bb9cf1
@ -22,6 +22,7 @@ module VagrantPlugins
|
||||
Client::Project => Vagrant::Environment,
|
||||
Client::Target => Vagrant::Machine,
|
||||
Client::Terminal => Vagrant::UI::Remote,
|
||||
Client::SyncedFolder => Vagrant::Plugin::V2::SyncedFolder,
|
||||
}
|
||||
|
||||
include Util::HasLogger
|
||||
|
||||
@ -30,7 +30,7 @@ module VagrantPlugins
|
||||
end
|
||||
|
||||
# Build a synced folder client from a proto instance
|
||||
class SyncedFolderFromProto < Mapper
|
||||
class SyncedFolderClientFromProto < Mapper
|
||||
def initialize
|
||||
inputs = [].tap do |i|
|
||||
i << Input.new(type: SDK::Args::SyncedFolder)
|
||||
@ -64,6 +64,20 @@ module VagrantPlugins
|
||||
Client::SyncedFolder.load(proto, broker: broker)
|
||||
end
|
||||
end
|
||||
|
||||
# Build a synced folder from a synced folder client
|
||||
class SyncedFolderFromProto < Mapper
|
||||
def initialize
|
||||
inputs = [].tap do |i|
|
||||
i << Input.new(type: Client::SyncedFolder)
|
||||
end
|
||||
super(inputs: inputs, output: Vagrant::Plugin::V2::SyncedFolder, func: method(:converter))
|
||||
end
|
||||
|
||||
def converter(client)
|
||||
Vagrant::Plugin::V2::SyncedFolder.new(client)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user