Add capability methods for remote server

This commit is contained in:
sophia 2021-10-21 12:58:44 -05:00 committed by Paul Hinze
parent 168c307aef
commit b58b77ef0b
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
2 changed files with 26 additions and 1 deletions

View File

@ -371,7 +371,8 @@ module Vagrant
end
def synced_folders
self.class.synced_folders(self)
# self.class.synced_folders(self)
client.synced_folders
end
def to_proto

View File

@ -14,6 +14,7 @@ module Vagrant
end
def _initialize(machine, synced_folder_type)
@client = nil#TODO!
self
end
@ -54,6 +55,29 @@ module Vagrant
def cleanup(machine, opts)
client.cleanup(machine.to_proto, opts)
end
# Executes the capability with the given name, optionally passing more
# arguments onwards to the capability. If the capability returns a value,
# it will be returned.
#
# @param [Symbol] cap_name Name of the capability
def capability(cap_name, *args)
@logger.debug("running remote host capability #{cap_name} with args #{args}")
client.capability(cap_name, *args)
end
# Tests whether the given capability is possible.
#
# @param [Symbol] cap_name Capability name
# @return [Boolean]
def capability?(cap_name)
@logger.debug("checking for remote host capability #{cap_name}")
client.has_capability?(cap_name)
end
def to_proto
client.proto
end
end
end
end