Update clients to subclass Client
This commit is contained in:
parent
c413335e14
commit
6e16a8835c
@ -1,11 +1,7 @@
|
||||
module VagrantPlugins
|
||||
module CommandServe
|
||||
module Client
|
||||
class Basis
|
||||
prepend Util::ClientSetup
|
||||
prepend Util::HasLogger
|
||||
prepend Util::HasMapper
|
||||
|
||||
class Client
|
||||
class Basis < Client
|
||||
# return [Sdk::Args::DataDir::Basis]
|
||||
def data_dirs
|
||||
resp = client.data_dir(Empty.new)
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
module VagrantPlugins
|
||||
module CommandServe
|
||||
module Client
|
||||
class Box
|
||||
prepend Util::ClientSetup
|
||||
prepend Util::HasLogger
|
||||
|
||||
class Client
|
||||
class Box < Client
|
||||
# @return [Bool] check allowed
|
||||
def automatic_update_check_allowed
|
||||
res = client.automatic_update_check_allowed(Empty.new)
|
||||
@ -33,7 +30,8 @@ module VagrantPlugins
|
||||
|
||||
# @param [String] path
|
||||
def repackage(path)
|
||||
client.repackage(SDK::Args::Path.new(path: path.to_s))
|
||||
path = Pathname.new(path.to_s)
|
||||
client.repackage(mapper.map(path, to: SDK::Args::Path))
|
||||
end
|
||||
|
||||
# @return [String] path
|
||||
@ -79,7 +77,7 @@ module VagrantPlugins
|
||||
res = client.compare(box)
|
||||
res.result
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
module VagrantPlugins
|
||||
module CommandServe
|
||||
module Client
|
||||
class BoxCollection
|
||||
prepend Util::ClientSetup
|
||||
prepend Util::HasLogger
|
||||
|
||||
class Client
|
||||
class BoxCollection < Client
|
||||
# @return [Vagrant::Box] box added
|
||||
def add(path, name, version, force=false, metadata_url=nil, providers=[])
|
||||
logger.debug("adding box at path #{path}")
|
||||
|
||||
@ -1,12 +1,7 @@
|
||||
module VagrantPlugins
|
||||
module CommandServe
|
||||
module Client
|
||||
class PluginManager
|
||||
|
||||
prepend Util::ClientSetup
|
||||
prepend Util::HasLogger
|
||||
prepend Util::HasMapper
|
||||
|
||||
class Client
|
||||
class PluginManager < Client
|
||||
def list_plugins(types=[])
|
||||
resp = client.list_plugins(
|
||||
SDK::PluginManager::PluginsRequest.new(
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
module VagrantPlugins
|
||||
module CommandServe
|
||||
module Client
|
||||
class Project
|
||||
prepend Util::ClientSetup
|
||||
prepend Util::HasLogger
|
||||
|
||||
class Client
|
||||
class Project < Client
|
||||
# return [VagrantPlugins::CommandServe::Client::BoxCollection]
|
||||
def boxes
|
||||
BoxCollection.load(
|
||||
|
||||
@ -1,12 +1,7 @@
|
||||
require "google/protobuf/well_known_types"
|
||||
|
||||
module VagrantPlugins
|
||||
module CommandServe
|
||||
module Client
|
||||
class StateBag
|
||||
prepend Util::ClientSetup
|
||||
prepend Util::HasLogger
|
||||
|
||||
class Client
|
||||
class StateBag < Client
|
||||
# @param [String]
|
||||
# @return [String]
|
||||
def get(key)
|
||||
|
||||
@ -2,14 +2,10 @@ require "time"
|
||||
|
||||
module VagrantPlugins
|
||||
module CommandServe
|
||||
module Client
|
||||
class Target
|
||||
|
||||
class Client
|
||||
class Target < Client
|
||||
autoload :Machine, Vagrant.source_root.join("plugins/commands/serve/client/target/machine").to_s
|
||||
|
||||
prepend Util::ClientSetup
|
||||
prepend Util::HasLogger
|
||||
|
||||
STATES = [
|
||||
:UNKNOWN,
|
||||
:PENDING,
|
||||
|
||||
@ -1,15 +1,11 @@
|
||||
module VagrantPlugins
|
||||
module CommandServe
|
||||
module Client
|
||||
class Client
|
||||
# Machine is a specialization of a generic Target
|
||||
# and is how legacy Vagrant willl interact with
|
||||
# targets
|
||||
class Target
|
||||
class Machine < Target
|
||||
|
||||
prepend Util::ClientSetup
|
||||
prepend Util::HasLogger
|
||||
|
||||
# @return [String] resource identifier for this target
|
||||
def ref
|
||||
SDK::Ref::Target::Machine.new(resource_id: resource_id)
|
||||
@ -97,7 +93,7 @@ module VagrantPlugins
|
||||
client.set_state(req)
|
||||
end
|
||||
|
||||
# Synced folder for machine
|
||||
# Synced folder for machine
|
||||
#
|
||||
# @return [List<[Client::SyncedFolder, Map<String, String>]>]
|
||||
def synced_folders
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
module VagrantPlugins
|
||||
module CommandServe
|
||||
module Client
|
||||
class TargetIndex
|
||||
|
||||
prepend Util::ClientSetup
|
||||
prepend Util::HasLogger
|
||||
|
||||
class Client
|
||||
class TargetIndex < Client
|
||||
# @param [string]
|
||||
# @return [Boolean] true if delete is successful
|
||||
def delete(ident)
|
||||
|
||||
@ -1,14 +1,7 @@
|
||||
# TODO(spox): why do we need this?!
|
||||
require_relative "../util.rb"
|
||||
|
||||
module VagrantPlugins
|
||||
module CommandServe
|
||||
module Client
|
||||
class Terminal
|
||||
|
||||
prepend Util::ClientSetup
|
||||
prepend Util::HasLogger
|
||||
|
||||
class Client
|
||||
class Terminal < Client
|
||||
# @return [String] name of proto class
|
||||
def self.sdk_alias
|
||||
"TerminalUI"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user