Commit graph

1228 commits

Author SHA1 Message Date
Chris Roberts
c7d13e62c7
Ensure output of mapper to unpack funcspec is a proto 2022-04-25 12:26:02 -05:00
Chris Roberts
6a1c5f1c7f
Add default map list for blind mappings. Unpack funcspec before map. 2022-04-25 12:26:02 -05:00
Chris Roberts
ed7f1fcd1e
Start adding Hash like methods to state bag 2022-04-25 12:26:02 -05:00
Chris Roberts
3cc92280f8
Update mappers to include maps from funcspec value to proto 2022-04-25 12:26:02 -05:00
sophia
2513d21054
Return 0 when no boxes are installed
Previously the cli returned 1 for `vagrant box list` if there
are no installed boxes. This is somewhat misleading since the
command completes without an error, it should return 0
2022-04-25 12:26:02 -05:00
Chris Roberts
675bea93cc
Persist cache for thread 2022-04-25 12:26:01 -05:00
Chris Roberts
796d2f2578
Simplify direct mappers 2022-04-25 12:26:01 -05:00
Chris Roberts
100ad1330d
Remove automatic caching and add short circuits 2022-04-25 12:26:01 -05:00
Chris Roberts
c75c20692c
Cache environment and allow mapping without UI 2022-04-25 12:26:01 -05:00
Chris Roberts
ce3f18ada1
Add machine to_proto mapper and update from target 2022-04-25 12:26:01 -05:00
Chris Roberts
b7c04b4ecc
Add project caching in mapper 2022-04-25 12:26:01 -05:00
Chris Roberts
c3fb475abe
Remove target from String mapper 2022-04-25 12:26:00 -05:00
Chris Roberts
d95147bd6f
Re-enable terminal extraction from project 2022-04-25 12:26:00 -05:00
Chris Roberts
3aa4e1bab4
Add mapping for pathnames 2022-04-25 12:26:00 -05:00
Chris Roberts
a0797da229
Argument is only invalid if nil and expected type is not NilClass 2022-04-25 12:26:00 -05:00
Chris Roberts
4b14221be4
Full extract all nested values when mapping 2022-04-25 12:26:00 -05:00
Chris Roberts
74d6dafccf
Use custom Array and Hash mapping 2022-04-25 12:26:00 -05:00
Chris Roberts
0e8ded18aa
Add significant weight to non-direct type matches 2022-04-25 12:26:00 -05:00
Chris Roberts
4e60160797
Update module loading in clients 2022-04-25 12:26:00 -05:00
Chris Roberts
b327dbe7d8
Add resource_id method to project client 2022-04-25 12:26:00 -05:00
Chris Roberts
b8ed8a495f
Map directly to Any value 2022-04-25 12:26:00 -05:00
Chris Roberts
b195772160
Update capability platform service and host/guest usages
Update default arguments to be a map instead of an array so
    expected result values can be provided. Add new method for
    handling arguments so custom adjustments can be applied before
    calling the capability. Add custom argument adjustments to
    guest service to provide machine if one is not given.
2022-04-25 12:25:59 -05:00
Chris Roberts
faac057cca
Build arguments for command via mapper directly 2022-04-25 12:25:59 -05:00
Chris Roberts
f903b0ee31
Provide an alias to the args for consistency 2022-04-25 12:25:59 -05:00
Chris Roberts
63e253b506
Update cacher to use monitor mixin 2022-04-25 12:25:59 -05:00
Chris Roberts
4a97d86b78
Initial updates for direct to any mapping 2022-04-25 12:25:59 -05:00
Chris Roberts
7f937ea544
Add autoload for types 2022-04-25 12:25:58 -05:00
Chris Roberts
1d16a57d64
Include mapper within host client 2022-04-25 12:25:58 -05:00
Chris Roberts
6135b412d3
Increase edge weight when types do not match 2022-04-25 12:25:58 -05:00
Chris Roberts
909bd68126
Adjust edge weights and connect subtypes 2022-04-25 12:25:58 -05:00
Chris Roberts
1d4c57222f
Validate path starts with source and ends with destination 2022-04-25 12:25:58 -05:00
Chris Roberts
870c5f6808
Updates to existing mappers 2022-04-25 12:25:58 -05:00
Chris Roberts
33bb2ff608
Generate any mappers for any known proto types 2022-04-25 12:25:58 -05:00
Chris Roberts
af13724f56
Adjust wrapper type generated mappers 2022-04-25 12:25:58 -05:00
Chris Roberts
68ed3ba1d9
Add any unpacking. Filter blind maps. 2022-04-25 12:25:58 -05:00
Chris Roberts
2712046a9d
Add mapper for direct type to proto 2022-04-25 12:25:58 -05:00
Chris Roberts
917ac04ef1
Add expected types for funcspec maps 2022-04-25 12:25:58 -05:00
Chris Roberts
8310e1bf95
Loaders for types 2022-04-25 12:25:57 -05:00
Chris Roberts
757b97b882
Create a types namespace and add direct type 2022-04-25 12:25:57 -05:00
Chris Roberts
22e34e87e9
Include a #to_proto method for all clients 2022-04-25 12:25:57 -05:00
sophia
7aaeaf2e46
Update protos 2022-04-25 12:25:57 -05:00
sophia
cb458e707a
Ensure path is a string 2022-04-25 12:25:57 -05:00
sophia
d95b563e86
Ensure 0 is returned for successful command 2022-04-25 12:25:57 -05:00
sophia
cec195cecb
Remove boxes from db when deleting 2022-04-25 12:25:56 -05:00
sophia
c5de0d88f7
Add box from ruby 2022-04-25 12:25:56 -05:00
sophia
c50ca3a991
Assume no box found if find returns an error 2022-04-25 12:25:56 -05:00
sophia
69b15f7140
Return list of box info when requesting all boxes 2022-04-25 12:25:56 -05:00
sophia
f71aa68a69
Get box collection from vagrant-go 2022-04-25 12:25:56 -05:00
sophia
fd0df0865c
Add box collection client 2022-04-25 12:25:56 -05:00
sophia
80f3549716
Initialize remote box with client 2022-04-25 12:25:54 -05:00
sophia
085e30053e
Load box from machine 2022-04-25 12:25:53 -05:00
sophia
99694b210b
Add mappers for box proto to client 2022-04-25 12:25:53 -05:00
sophia
235cafddcc
Add box client 2022-04-25 12:25:53 -05:00
Chris Roberts
3f4e446798
Support mapping to unknown destination type 2022-04-25 12:25:50 -05:00
Chris Roberts
5c6587f688
Allow matching mapper input directly on type 2022-04-25 12:25:50 -05:00
Chris Roberts
d1974d9a00
Remove implementations no longer required 2022-04-25 12:25:50 -05:00
Chris Roberts
481d7185a7
Use graph functions for searching and expanding path 2022-04-25 12:25:50 -05:00
Chris Roberts
a6367553c8
When building graph, set weight on vertices 2022-04-25 12:25:50 -05:00
Chris Roberts
482bf15d57
Rebuild graph on top of RGL 2022-04-25 12:25:50 -05:00
Chris Roberts
0a20c9d665
Update weighted vertex to be a decorator 2022-04-25 12:25:50 -05:00
Chris Roberts
2bdfd8b810
Update output format for vertex string methods 2022-04-25 12:25:50 -05:00
sophia
7e0fcc0a24
Define synced folder service endpoints 2022-04-25 12:25:49 -05:00
sophia
08d4438ae1
Start Synced folder service 2022-04-25 12:25:49 -05:00
sophia
c6070c69db
Rename cap command 'target' to 'target-guest'
the target name is already used by the go cli
2022-04-25 12:24:49 -05:00
sophia
4251b2ff7c
Get first level parent from ruby plugins 2022-04-25 12:24:48 -05:00
Chris Roberts
7cc07642a5
Use project for host capabilities 2022-04-25 12:24:47 -05:00
Chris Roberts
e6952621d3
Provide bind address in output and log active port 2022-04-25 12:24:47 -05:00
Chris Roberts
c6c7455c8e
Clean up and add some logging output 2022-04-25 12:24:47 -05:00
Chris Roberts
6be33f1f84
Add seed methods to capability client and adjust capability request 2022-04-25 12:24:46 -05:00
Chris Roberts
049c777f69
Use logger utility 2022-04-25 12:24:46 -05:00
Chris Roberts
defd8c9073
Add todo note on capability service seed methods 2022-04-25 12:24:46 -05:00
Chris Roberts
8cd6b5a05b
Initialize logger in method and remove initialize override 2022-04-25 12:24:46 -05:00
Chris Roberts
ec669645ad
Use reader to access logger 2022-04-25 12:24:46 -05:00
Chris Roberts
b7b7fdb9c6
Disable target option on cap command 2022-04-25 12:24:46 -05:00
Chris Roberts
5052e1b9bf
Convert proto list to array using #to_a 2022-04-25 12:24:45 -05:00
Chris Roberts
fa27dc5c4f
Add some logging output from service setup 2022-04-25 12:24:45 -05:00
Chris Roberts
2b146d4179
Host service always wants statebag 2022-04-25 12:24:45 -05:00
Chris Roberts
d25f61e3ef
Force name to string type before downcasing 2022-04-25 12:24:45 -05:00
Chris Roberts
f99911b3ec
Add seed(s) endpoints to capability services 2022-04-25 12:24:45 -05:00
Chris Roberts
4331b09421
Include default args in spec and add readers 2022-04-25 12:24:45 -05:00
Chris Roberts
ca1c1f2042
Add #ui to project client 2022-04-25 12:24:44 -05:00
Chris Roberts
2d2a503f95
Decode value when loading proto 2022-04-25 12:24:44 -05:00
Chris Roberts
48c0c96798
Update namespace for machine 2022-04-25 12:24:44 -05:00
Chris Roberts
d88a1e1346
Load all mappers and support extra args for funcspec processing 2022-04-25 12:24:44 -05:00
Chris Roberts
e94de03560
Include mapper and broker for handling funcspec args 2022-04-25 12:24:44 -05:00
Chris Roberts
d37f2ff6fe
Split out mappers implementation to namespaced file 2022-04-25 12:24:44 -05:00
Chris Roberts
d81d505e8a
Add internal tools utilzing graph 2022-04-25 12:24:44 -05:00
Chris Roberts
0a26c040f7
Add a graph implementation and typed vertices 2022-04-25 12:24:44 -05:00
Chris Roberts
87848eec67
Define internal module and add loaders 2022-04-25 12:24:44 -05:00
Chris Roberts
6d682ab7eb
Add simple stack implementation 2022-04-25 12:24:44 -05:00
Chris Roberts
66f8643ae3
Add more mappers 2022-04-25 12:24:43 -05:00
Chris Roberts
c4da3b0cbd
Rename capabilities mapper and convert to symbol 2022-04-25 12:24:43 -05:00
Chris Roberts
eb5969dac0
Add new mappers 2022-04-25 12:24:43 -05:00
Chris Roberts
908135c21e
Fix method name for accessing capability name on message 2022-04-25 12:24:43 -05:00
Chris Roberts
4e35028e3f
Some small mapper adjustments and loaders 2022-04-25 12:24:43 -05:00
Chris Roberts
75b9950ae4
Update capability to request and handle direct args 2022-04-25 12:24:43 -05:00
Chris Roberts
f06b1a0990
Allow capability platform service module to setup all other required modules 2022-04-25 12:24:43 -05:00
Chris Roberts
2a4eba8435
Be more prescriptive on super usage to make Ruby 2.6 happy 2022-04-25 12:24:43 -05:00
Chris Roberts
35277eff21
Remove machine autoload from client top level 2022-04-25 12:24:43 -05:00
Chris Roberts
9909701544
Update references to machine to nest under target 2022-04-25 12:24:42 -05:00
Chris Roberts
3941438ab3
Make machine path represent namespacing 2022-04-25 12:24:42 -05:00
Chris Roberts
c53c84182a
Nest machine within target namespace to match scopes 2022-04-25 12:24:42 -05:00
Chris Roberts
f24b211746
Provide override to lookup TerminalUI for our Terminal client 2022-04-25 12:24:42 -05:00
Chris Roberts
71ce491197
Allow name lookup overrides for proto integration 2022-04-25 12:24:42 -05:00
Chris Roberts
4420feb9cf
Disable cacher usage until mapper is updated 2022-04-25 12:24:42 -05:00
Chris Roberts
84d2dc1c60
Always extend connector when prepending the client setup module 2022-04-25 12:24:42 -05:00
Chris Roberts
2cd54c6079
Update client implementation module usage 2022-04-25 12:24:42 -05:00
Chris Roberts
fd18051b0d
Update module usage within service implementations 2022-04-25 12:24:42 -05:00
Chris Roberts
0401f9cad4
Check super method to be called and force no arguments if none expected
This fixes an issue with Ruby 2.6 where `super` usage when no
    arguments are passed results in an argument error
2022-04-25 12:24:42 -05:00
Chris Roberts
e89d344770
Extract utility modules into isolated files and add more utils 2022-04-25 12:24:41 -05:00
sophia
58ffe630a2
Pass statebag to host detect function 2022-04-25 12:24:41 -05:00
sophia
ca824644a5
Add tests for host service 2022-04-25 12:24:41 -05:00
sophia
dbb9188f87
Use mappers to get NamedCapability argument 2022-04-25 12:24:41 -05:00
sophia
177b06eb22
Add TODOs for extracting capability args 2022-04-25 12:24:41 -05:00
sophia
14d17dfd9d
Return capability execution result 2022-04-25 12:24:41 -05:00
sophia
a23da9bc64
Log ruby detect endpoint 2022-04-25 12:24:41 -05:00
sophia
5892c47ead
Extract common capability platform service for host and guest plugins 2022-04-25 12:24:41 -05:00
sophia
881502654b
Create statebag ruby client 2022-04-25 12:24:40 -05:00
sophia
a2ade36a74
Setup host client so that a golang based host may be used 2022-04-25 12:24:39 -05:00
sophia
0016baef36
Use mappers to extract string funcspec arguments 2022-04-25 12:24:39 -05:00
sophia
434e613856
Test has capability 2022-04-25 12:24:39 -05:00
sophia
04222f0eb6
Define initialize function to be compatible with ruby 2.6 2022-04-25 12:24:39 -05:00
sophia
7477455380
Get parents from guest plugin 2022-04-25 12:24:39 -05:00
sophia
29f14c98b7
Get parents chain from guest plugin 2022-04-25 12:24:38 -05:00
sophia
da64ea69d1
Execute capabilities 2022-04-25 12:24:38 -05:00
sophia
f74037e71d
Try accepting many arguments as protobuf any messages 2022-04-25 12:24:38 -05:00
sophia
dc5b13f930
Save point: get guest capablity function parameters 2022-04-25 12:24:38 -05:00
sophia
19dafb3d85
Add service to check guest for capabilities 2022-04-25 12:24:38 -05:00
Chris Roberts
dc32d6e9a0
Clean up constant aliases and set at top level for everyone 2022-04-25 12:24:38 -05:00
Chris Roberts
ce29c48931
Use mapper when loading funcspec arguments in services 2022-04-25 12:24:38 -05:00
Chris Roberts
fc88c8d580
Add basic mappers for client types 2022-04-25 12:24:38 -05:00
Chris Roberts
c0304101f4
Add a helper utility for setting up the mapper 2022-04-25 12:24:38 -05:00
Chris Roberts
65f733a288
Add a basic mappers implementation 2022-04-25 12:24:37 -05:00
sophia
42796be551
Get machine from project for guest service 2022-04-25 12:24:37 -05:00
sophia
8efc8542b7
Rename guest client 'capability method to match the client interface 2022-04-25 12:24:37 -05:00
sophia
5d46b93a99
Each component client stores their proto 2022-04-25 12:24:37 -05:00
sophia
83a080521e
Add to_proto to machine in order to pass machine protos around to other plugins 2022-04-25 12:24:37 -05:00
sophia
827b50db77
Get client from machine go impl 2022-04-25 12:24:36 -05:00
sophia
3067fe7dba
Add remote guest 2022-04-25 12:24:36 -05:00
sophia
34e7105193
Add guest client 2022-04-25 12:24:36 -05:00
sophia
d196b8635c
Detect Ruby guest plugin 2022-04-25 12:24:36 -05:00
sophia
a1fca2fde8
Add guest server for using Ruby based guest plugins 2022-04-25 12:24:36 -05:00
sophia
ca3d76ca7d
Use project client to populate environment options 2022-04-25 12:24:36 -05:00
sophia
685d555999
Flush out project client 2022-04-25 12:24:36 -05:00
Chris Roberts
82549f5579
Use updated Remote UI class name 2022-04-25 12:24:35 -05:00
Chris Roberts
04c1897869
Update terminal client to add message style 2022-04-25 12:24:34 -05:00
Chris Roberts
3583259fc9
Organizing clients and matching up with core interfaces 2022-04-25 12:24:34 -05:00
Chris Roberts
71d5195fb3
Get provider name from target client 2022-04-25 12:24:33 -05:00
Chris Roberts
61bb2328f3
Remove param documentation from method 2022-04-25 12:24:32 -05:00
Chris Roberts
59116a6773
Fix constant name for identifier 2022-04-25 12:24:32 -05:00
Chris Roberts
073acefea9
Update proto loads and method names 2022-04-25 12:24:32 -05:00
Chris Roberts
1f67fdfb11
Move methods and rename to match interface 2022-04-25 12:24:32 -05:00
Chris Roberts
d2ed78861e
Fix namespace for entry 2022-04-25 12:24:32 -05:00
Chris Roberts
341619fbfd
Use connector module for client loading 2022-04-25 12:24:30 -05:00
Chris Roberts
d458a177f3
Add target client and subclass machine from target 2022-04-25 12:24:30 -05:00
Chris Roberts
d48ec9ace2
Update index autoload entry and target autoload 2022-04-25 12:24:30 -05:00
Chris Roberts
4143abd82d
Remove settings no longer used 2022-04-25 12:24:30 -05:00
Chris Roberts
363a1f30c1
Add module for connection helper 2022-04-25 12:24:30 -05:00
Chris Roberts
a180e8441c
Rename to target index and update 2022-04-25 12:24:30 -05:00
sophia
10a1f1011b
Get datadir for machine and project 2022-04-25 12:24:29 -05:00
sophia
68aa184bee
Get local data path from project 2022-04-25 12:24:28 -05:00
sophia
f722b15661
Remove references to SDK from remote machine index 2022-04-25 12:24:28 -05:00
sophia
f761af3c55
Move client creation into client module 2022-04-25 12:24:28 -05:00
sophia
c71eb9ea0e
UQuery machine index by uuid 2022-04-25 12:24:28 -05:00
sophia
47a0a2d7d2
Record machine client in machine index entry 2022-04-25 12:24:27 -05:00
sophia
6eea1b0afd
Add endpoint for getting all machines from the index 2022-04-25 12:24:27 -05:00
sophia
8808ef353e
Clean up logging 2022-04-25 12:24:27 -05:00
sophia
01fc2926c9
Save machine index entries remotely 2022-04-25 12:24:27 -05:00
sophia
81913d1042
debug target object in machine index 2022-04-25 12:24:27 -05:00
sophia
991f7db5c5
Find target in index 2022-04-25 12:24:27 -05:00
sophia
3bda8b24ef
Save point: Get a target successfully from target index 2022-04-25 12:24:26 -05:00
sophia
6dae3576a3
Get project ref 2022-04-25 12:24:26 -05:00
sophia
1ea5b2ba91
Save point: use target ref to retrieve info from target index 2022-04-25 12:24:26 -05:00
sophia
f3210fff4c
Fill in Ruby machine index client 2022-04-25 12:24:26 -05:00
sophia
7de0fe1bd8
Get machine index remote service setup 2022-04-25 12:24:26 -05:00
sophia
c123335456
Save point: connect to machine index service 2022-04-25 12:24:26 -05:00
sophia
c124a583d7
Add machine index client 2022-04-25 12:24:26 -05:00
Chris Roberts
9e514cc8c1
Remove target from spec 2022-04-25 12:24:25 -05:00
Chris Roberts
ff973e380c
When a machine cannot be loaded, raise exception 2022-04-25 12:24:23 -05:00
Chris Roberts
798e33f6bb
Update synced folder constant name 2022-04-25 12:24:21 -05:00
sophia
a128d98dea
Move to_proto to config classes 2022-04-25 12:24:21 -05:00
sophia
0e40c2eb97
to_proto save point 2022-04-25 12:24:20 -05:00
sophia
ada96f13a3
Upload targets found in Vagrantfile 2022-04-25 12:24:20 -05:00
sophia
85271c616e
Collect config defined by community plugins 2022-04-25 12:24:20 -05:00
sophia
7f9702a095
Successfully parse vagrantfile 2022-04-25 12:24:19 -05:00
sophia
4460faa862
Kind of manually parse vagrantfile for provisioners 2022-04-25 12:24:17 -05:00
sophia
c4f0420d72
Parse Vagrantfile to proto 2022-04-25 12:24:17 -05:00
sophia
21dec58ba6
Update vagrantfile parsing for vagrantfile proto changes 2022-04-25 12:24:17 -05:00
sophia
053be35242
Parse Vagrantfiles 2022-04-25 12:24:16 -05:00
Chris Roberts
a8ef49b4fe
Add missing methods for host interface 2022-04-25 12:24:12 -05:00
Chris Roberts
9379f1beb3
Properly handle direct plugin connection without broker 2022-04-25 12:24:12 -05:00
sophia
434cc89a95
Get rid of extra subcommand help message
The available subcommands are displayed using the option parser
in the vagrant client
2022-04-25 12:24:11 -05:00
sophia
e86dc5958a
Clean up debugging cruft 2022-04-25 12:24:09 -05:00
sophia
5ecb1cdc26
Get/set machine id 2022-04-25 12:24:09 -05:00
sophia
fc8fe0a106
Make status work 2022-04-25 12:24:09 -05:00
sophia
340c2d7b19
Save point: load target from project 2022-04-25 12:24:09 -05:00
sophia
b7ce9a8601
Specialize target to machine 2022-04-25 12:24:09 -05:00
sophia
87bd08ef12
Attempt to specialize target to machine 2022-04-25 12:24:09 -05:00
Chris Roberts
9f829e8cb2
Request project when executing command 2022-04-25 12:24:08 -05:00
Chris Roberts
1b0214debc
Being implementing project client in ruby runtime 2022-04-25 12:24:08 -05:00
Chris Roberts
ab1d9ab80f
Provider broker via actual method. Fix scope of exception logger. 2022-04-25 12:24:07 -05:00
Chris Roberts
d6e732cde3
Provide broker when loading terminal UI 2022-04-25 12:24:07 -05:00
Chris Roberts
83d5dd6d26
Pass current broker instance to terminal when loading 2022-04-25 12:24:07 -05:00
Chris Roberts
af2a98907d
Minimum and maximum ports are based on the default range 2022-04-25 12:24:07 -05:00
Chris Roberts
ae9119ad18
Don't pass arguments to parent class on initialization. Broker not a singleton. 2022-04-25 12:24:07 -05:00
Chris Roberts
ef7c6f58b7
Start adding updates for machine client setup 2022-04-25 12:24:05 -05:00
Chris Roberts
3d000609ec
Update autoload definition for terminal client 2022-04-25 12:24:05 -05:00
Chris Roberts
bb7a3b36eb
Add options to define bind address and range of ports for use 2022-04-25 12:24:05 -05:00
Chris Roberts
d34d70442b
Rename terminal client file 2022-04-25 12:24:05 -05:00
Chris Roberts
7dd331d53e
Update method name for generating a new terminal client 2022-04-25 12:24:05 -05:00
Chris Roberts
356c37fd73
Isolate utility modules. Includes broker and logging helper modules. 2022-04-25 12:24:04 -05:00
Chris Roberts
742f94c9e0
Add modules to services and update exception logger usage 2022-04-25 12:24:04 -05:00
Chris Roberts
b6a0ed111a
Expand broker functionality to include server implementation 2022-04-25 12:24:04 -05:00
sophia
de649b2154
Update protos 2022-04-25 12:24:03 -05:00
Chris Roberts
2f0dcda7e8
Check that the result is something that can be used as an exit code 2022-04-25 12:24:03 -05:00
Chris Roberts
c69710329f
Update message access to use spec 2022-04-25 12:24:02 -05:00
sophia
b4f0ef56df
Remove command metadata from service info 2022-04-25 12:24:02 -05:00
sophia
0e618a4fd1
Execute command with subcommand info 2022-04-25 12:24:02 -05:00
sophia
fd29c9df7c
Clean up ruby command service 2022-04-25 12:24:02 -05:00
sophia
5dd5ec84ee
Allow ruby errors to be caught by exception logger 2022-04-25 12:24:02 -05:00
sophia
9f51d87038
Update ruby execute func for new proto 2022-04-25 12:24:02 -05:00
sophia
7fb193f4a2
Add dummy endpoint for subcommands 2022-04-25 12:24:01 -05:00
sophia
3c491fafdd
Register subcommands with subcommands passed as part of command info 2022-04-25 12:24:01 -05:00
sophia
0414be7cf7
Don't get synopsis for subcommands 2022-04-25 12:24:01 -05:00
sophia
261fa5bbae
Fixes for command info message 2022-04-25 12:24:00 -05:00
sophia
06b1caedf8
Register all subcommands 2022-04-25 12:24:00 -05:00
sophia
c676768674
Get subcommands one level deep 2022-04-25 12:24:00 -05:00
sophia
65d990efc9
Start gatching subcommands to register 2022-04-25 12:24:00 -05:00
sophia
072e06ca79
Get list of subcommands 2022-04-25 12:24:00 -05:00
sophia
1f432350ea
Add dummy endpoint for subcommands 2022-04-25 12:24:00 -05:00
sophia
893e37711e
Setup dummy env 2022-04-25 12:24:00 -05:00
sophia
5498c22983
Get help and flags for subcommands 2022-04-25 12:24:00 -05:00
Chris Roberts
62ca9faa43
Use connection ID from broker for terminal UI setup 2022-04-25 12:23:59 -05:00
Chris Roberts
e64f07b109
Include the broker streamer service to handled services 2022-04-25 12:23:58 -05:00
Chris Roberts
63f0b61ed6
Add simple broker implementation for use within Ruby runtime 2022-04-25 12:23:58 -05:00
sophia
edcb9e08bd
Get help and flags for subcommands 2022-04-25 12:23:58 -05:00
sophia
633528318d
Get help from ui output 2022-04-25 12:23:58 -05:00
sophia
0c1e44f553
Get help from commands that have subcommands 2022-04-25 12:23:58 -05:00
sophia
c3ee750db1
Add gogo 2022-04-25 12:23:57 -05:00
sophia
20fbe05c23
Log exceptions from grpc services to file 2022-04-25 12:23:57 -05:00
sophia
8e1e08b9ee
Remove logger 2022-04-25 12:23:57 -05:00
Chris Roberts
55d57595c4
Check lookup for not found error and allow it to fall through 2022-04-25 12:23:56 -05:00
Chris Roberts
f2ef8110bb
Accept command arguments and pass them when executing internal commands 2022-04-25 12:23:56 -05:00
Chris Roberts
64ccbe9121
Updates for ID and state handling 2022-04-25 12:23:56 -05:00
Chris Roberts
4d0959e10c
Match up constant with proto changes. Use reader for client. 2022-04-25 12:23:56 -05:00
Chris Roberts
93f3c70dd0
Update load path modifications and requires for new proto path 2022-04-25 12:23:56 -05:00
Chris Roberts
9a9331ed4d
Add the machine client back in here isolate by resource id 2022-04-25 12:23:56 -05:00
Chris Roberts
548a0339df
Update name and use constant alias 2022-04-25 12:23:56 -05:00
Chris Roberts
28ebbce108
Update to use the service info helper 2022-04-25 12:23:55 -05:00
Chris Roberts
afa31bff58
Provide client and service loader files
The service also includes a service info helper class that
    can wrap requests and extract execution context of request.
    This includes the vagrant service endpoint for connecting
    a client back to the service and the scope of the request.
    It also provides a helper for creating and reusing clients.
2022-04-25 12:23:55 -05:00
Chris Roberts
ac34b3bcdc
Clean up requires, use autoload, set vagrant in server mode 2022-04-25 12:23:55 -05:00
Chris Roberts
7350b85902
Implement enough of the command service to get things working.
Also updates the UI setup so that we can properly get the
    output streaming back to us.
2022-04-25 12:23:55 -05:00
sophia
854a2a4022
Just get the flag names 2022-04-25 12:23:55 -05:00
Chris Roberts
dc64d85adf
Extract option building to standalone method. Update help to use method. 2022-04-25 12:23:54 -05:00
Chris Roberts
11df6c7ae1
Store option parser instance and then extract flags from the result 2022-04-25 12:23:54 -05:00
sophia
1109d89616
Collect flag information 2022-04-25 12:23:54 -05:00
sophia
43e4e968ef
Make help message work 2022-04-25 12:23:54 -05:00
sophia
cadcbe82f7
Hard code less 2022-04-25 12:23:54 -05:00
sophia
078a091709
Start replacing machine variables with calls to core service 2022-04-25 12:23:54 -05:00
sophia
4c26f5b384
Make machine with ui 2022-04-25 12:23:54 -05:00
sophia
fd74318bf5
Pass ui to machine 2022-04-25 12:23:54 -05:00
sophia
c99348413a
Make ui class for interacting with terminal ui service 2022-04-25 12:23:53 -05:00
sophia
b80f19a49d
Add terminal ui to provider 2022-04-25 12:23:53 -05:00
sophia
ea64673e9f
Add terminal client 2022-04-25 12:23:53 -05:00
sophia
f68d470dc9
Fixes from rebase 2022-04-25 12:23:53 -05:00
sophia
3c360722df
Allow communicator to use plugin config 2022-04-25 12:23:53 -05:00
sophia
ad74f18719
Add communicators 2022-04-25 12:23:53 -05:00
sophia
0b1df4593e
Get some more information about Vagrantfile 2022-04-25 12:23:53 -05:00
sophia
8f034b24e2
Parse vagrantfile 2022-04-25 12:23:53 -05:00
sophia
f995a96b09
Setup parse vagrantfile endpoint 2022-04-25 12:23:53 -05:00
Chris Roberts
9071e39782
Remove plugin service. Use internal service instead. 2022-04-25 12:23:52 -05:00
Chris Roberts
8a9c2fe772
Remove internal service as plugin service provides same implementation 2022-04-25 12:23:52 -05:00
Chris Roberts
ae6639d301
Clean up plugin loading and compact registration 2022-04-25 12:23:52 -05:00
Chris Roberts
f915922f7d
Remove generated proto files from within plugin subdirectory 2022-04-25 12:23:52 -05:00
Chris Roberts
851955e1d4
Add command service 2022-04-25 12:23:52 -05:00
Chris Roberts
addf420ca2
Add some helper methods and some adjustments to serve setup 2022-04-25 12:23:52 -05:00
sophia
a268afb945
Setup a batch action for bringin up a machine 2022-04-25 12:23:52 -05:00
sophia
d7f92f9d87
Some update for sdk changes 2022-04-25 12:23:52 -05:00
sophia
7ff0d11582
Move protos into Vagrant module 2022-04-25 12:23:52 -05:00
sophia
773c4bd910
Return an ActionResp 2022-04-25 12:23:52 -05:00
sophia
41f3af51af
Return a result from an up action 2022-04-25 12:23:51 -05:00
sophia
e56013a6b4
Slightly better log location 2022-04-25 12:23:51 -05:00
sophia
a25381b03a
Get the associated requested provider 2022-04-25 12:23:51 -05:00
sophia
7a612698a5
Transform a machine arg to an instance of Vagrant::Machine 2022-04-25 12:23:51 -05:00
sophia
a806a47a1a
Decode incoming machine arg 2022-04-25 12:23:51 -05:00
sophia
a11f5a4dbf
Move proto files into more globally accessible spot 2022-04-25 12:23:51 -05:00
sophia
82e3dd55ad
Setup machine client 2022-04-25 12:23:51 -05:00
sophia
fdcae6e13a
Get a machine instance for action up 2022-04-25 12:23:51 -05:00
sophia
7438d2d7e7
Get to run action up 2022-04-25 12:23:51 -05:00
sophia
6d397a072d
Add provider service 2022-04-25 12:23:51 -05:00
sophia
8cccefb8aa
Add plugin protos 2022-04-25 12:23:51 -05:00
sophia
244bb335c8
Get all plugins 2022-04-25 12:23:50 -05:00
sophia
5a92ba0186
Return list of plugins 2022-04-25 12:23:50 -05:00
sophia
cd04e4385f
Return list of installed plugins 2022-04-25 12:23:50 -05:00
sophia
c02baa9219
Start server as vagrant command 2022-04-25 12:23:50 -05:00
Thilak Somasundaram
9c0c3acbae Fix sentense:
"that are you are using" to "that you are using"
2022-01-14 18:30:24 -08:00
Ikko Ashimine
3ccbb3d24b
Fix typo in command.rb
separater -> separator
2021-09-15 02:20:26 +09:00
Chris Roberts
32757d56e1
Merge pull request #12304 from grahamhub/issue-12191
implement --info flag for package cmd #12191
2021-06-29 13:07:47 -07:00
Chris Roberts
218f8323fb Return original when access token is not removed
When scrubbing box urls of access token parameters, only return
    the processed URL if the access token was removed. If it was not
    removed, return the original URL string. This prevents issues with
    local file URLs being parsed and replaced with invalid paths.

    Fixes: #12340 #12350 #12320
2021-06-11 16:59:35 -07:00
grahamhub
bfa73b06c6 cli: implement --info flag for package #12191 2021-04-15 00:28:41 -05:00
grahamhub
8ecf0fb0d8 specify correct dir for info.json #12191 2021-04-14 16:18:48 -05:00
Chris Roberts
cf51c18ad8 Update authentication middleware access token handling
Replace the `VAGRANT_ALLOW_PARAM_AUTH_TOKEN` environment variable
    with `VAGRANT_SERVER_ACCESS_TOKEN_BY_URL` and update the behavior
    when the environment variable is set to add the access token as
    a query parameter and disable the addition of the authentication
    header.

    Fixes #12080
2021-03-24 17:24:47 -07:00
Chris Roberts
fd4da92245 Check file size prior to upload and automatically adjust options
When uploading box file, check if the size is greater than
    5GB. If the size is larger and the direct to storage option
    is enabled, disable the option due to current 5GB restriction
    on direct uploads.
2021-03-23 15:11:32 -07:00
Chris Roberts
60323fdd6c
Merge pull request #12235 from chrisroberts/api-notify-ups
Prevent notification on default store, fix client end point
2021-03-17 13:57:47 -07:00
Chris Roberts
16e91e4ba2 Do not convert value to allow nil value to pass through 2021-03-17 13:08:43 -07:00
Chris Roberts
d580fbbee2 Use the server url helper method within the client
Some client setup locations where not using the custom helper
    method for the vagrant server URL value so they have been
    updated. The api path is also appended if it is not set for
    custom server URLs
2021-03-15 17:17:10 -07:00
Chris Roberts
867d65b079 Remove access token parameter if found on URL 2021-03-15 15:17:48 -07:00
Chris Roberts
51382a0d0a Deprecate hook and disable access token parameter by default
This sets the `authenticate_box_url` hook as deprecated and also
    disables the cloud auth middleware from adding an access token
    as a URL parameter by default. An environment variable has been
    added which can be used for re-enabling the access token URL
    parameter behavior if required for some legacy system which does
    not support the authorization header.
2021-03-15 14:46:46 -07:00
sophia
a2fdbc5625 Don't count not created machines as declined when destroying 2021-02-22 16:14:16 -06:00
Chris Roberts
4253f27901 Prevent printing token warning more than once
Mark warning of double tokens set when initially print to prevent
the warning from being shown multiple times during a single run.
2020-11-03 13:47:53 -08:00
Chris Roberts
8b0790168b Check for filter versions and break up box output 2020-10-30 09:26:07 -07:00
Chris Roberts
baa24af179 Remove all unused code related to the deprecated login command 2020-10-30 09:26:07 -07:00
Chris Roberts
78d309a09b Update cloud command to use refactored library implementation
This PR is dependent on the 2.1.0 release of the vagrant_cloud
library. It updates the `cloud` command to use the new interface
for interacting with the Vagrant Cloud API. It also adds support
for direct to backend storage uploads, and defaults to this
method.

Also included is a bit of cleanup refactoring, addition of method
documentation, and fixing up some small issues around custom username
usage within the internal client for authentication.
2020-10-30 09:26:07 -07:00
sophia
dfb0c3dde1 Add ability to specify target for cap command 2020-10-14 17:34:40 -05:00
Sophia Castellarin
70d37e8a9c
Merge pull request #11835 from soapy1/remove-url-token
Download a box by setting auth headers
2020-09-22 15:35:30 -05:00
Nandor Kiss
cc3cdfe452 --force instead of --yes. 2020-09-22 20:13:30 +02:00
Nandor Kiss
59d398c405 --yes at vagrant cloud version release command. 2020-09-16 22:25:41 +02:00
sophia
d6a88f666f Add some docstrings and logging 2020-09-15 15:01:01 -05:00
sophia
fffc555faf Add tests for new hook 2020-08-21 10:54:43 -05:00
sophia
0d1635303f Sperate hook for authenticating url and adding headers for authentication 2020-08-18 17:42:59 -05:00
sophia
f440012b30 Scrub token from logs 2020-08-18 10:51:42 -05:00
sophia
b5f6df9ec0 Download a box by setting auth headers 2020-08-18 10:13:39 -05:00
Sophia Castellarin
cb1ade9332
Merge pull request #11523 from soapy1/install-autocomplete-cmd
Install zsh autocomplete
2020-07-23 13:59:36 -05:00
sophia
1a758d839b Option to gracefully destroy vm 2020-05-29 15:36:40 -04:00
sophia
75de83db9e Simplify some install operations 2020-05-29 15:10:13 -04:00
sophia
4169ea6e57 Allow users to choose which shells to install 2020-05-29 15:10:13 -04:00
Sophia Castellarin
1adfe8bbaa Fix some typos 2020-05-29 15:10:13 -04:00
sophia
9e2b7fb690 Autocomplete command 2020-05-29 15:10:13 -04:00
Chris Roberts
4546d804b1 Add support for configuring SSH connect timeout
Retains the original default value of 15 seconds for SSH connect
timeout. Allows users to modify this timeout via SSH communicator
option. Enforces integer values for timeout and validates custom
values are greater than 0.
2020-04-20 14:23:21 -07:00
comet
fa43afb57b
update 2020-01-27 17:04:23 -06:00
Brian Cain
bcf4d5a210
Fixes #11228: Allow to force check for box updates
Prior to this commit, if a user had recently checked for updates, there
was no way to force Vagrant to re-check without manually deleting a
state file in the local `.vagrant` data dir. This commit fixes that by
giving users the ability to force check for updates for a given box with
a flag to the `vagrant box outdated` command.
2019-12-03 11:42:55 -08:00
Brian Cain
06799402ed
Fixup: Ensure Gem::Version.new does not receive nil value
This commit fixes an issue where Gem::Version.new could recieve a nil
value if no addtional box updates are available. For some versions of
ruby, this is actually an error case. This commit fixes that by
converting it to an integer to prevent an exception.

Issue reference: https://github.com/rubygems/rubygems/issues/2359
2019-11-14 14:51:29 -08:00
Jeff Bonhag
0e68f02dc9
Fixes #11163: Get latest version for provider (#11192)
This commit changes the behavior of `vagrant box outdated --global` so
it gets the latest version for the current machine's provider, rather
than the latest version for any provider.
2019-11-13 17:33:15 -05:00
Brian Cain
145f04893c
Fixes #11137: Fixup how cloud publish handles its arguments
Prior to this commit, if a user didn't supply a box file on disk or a
box url, Vagrant would crash and display a stacktrace with an invalid
file. This commit fixes that by adding some extra handling around the
arguments supplied to the publish command.
2019-11-07 10:19:52 -08:00
Brian Cain
f998e535ce
Fixes #11139: Skip machines that haven't been created for snapshot save
This commit fixes the original #11027 fix, which assumed that the
hyper-v provider just wasn't properly getting a VM id when it listed
snapshots. In reality, it was just that if you invoke the
`with_target_vm` method with no arguments, it runs on the entire environment.
This meant that the capability snapshot_list attempted to be invoked on
machines that didn't exist yet, which is the original cause for why the
list_snapshot method did not recieve a vm ID. This commit fixes that by
simply skipping the machine if it does not yet exist.
2019-10-24 13:33:25 -07:00
Chris Roberts
cc23905142 Add support for providing box checksums to Vagrant Cloud 2019-10-08 11:23:48 -07:00
Brian Cain
66ec57a637
Fixes #11027: Ensure VM id is passed to list snapshots
Prior to this commit, if you tried to save a snapshot without giving it
a name, the hyper-v driver would not properly obtain a vm id to save a
snapshot on, resulting in an error. This commit updates the command
snapshot save to hold onto the machines ID in argv rather than `pop` it
off, so that the hyperv driver can obtain the guests id when saving a
snapshot.
2019-10-01 13:33:39 -07:00
Brian Cain
5210e9d82b
Update flag from used to active 2019-09-05 15:46:43 -07:00
Brian Cain
e19f54457d
Fixes #10908: Preserve in-use boxes when force flag is used with prune
Prior to this commit, `vagrant box prune --force` would not prompt a
user to prune Vagrant boxes, even if that box was in use. There was no
way to prune boxes, ignore the prompt, but keep in-use boxes. This
commit adds a new flag that can be combined with `--force`, that will
keep in-use boxes but prune older boxes without prompting the user.
2019-09-04 15:54:11 -07:00
Greg J Preece
2f818c0e23 Removing unneeded .send() calls in machine output. 2019-06-04 21:35:37 -07:00
Greg J Preece
731f249c50 Machine ID output should be 7 characters. 2019-05-29 11:10:33 -07:00
Greg J Preece
c6a6fd34a3 Adding machine-readable output to global-status 2019-05-29 10:48:38 -07:00
Brian Cain
93497b8ca3
Merge pull request #10829 from briancain/box-update-continue
Continue updating environment boxes if metadata not found
2019-05-08 09:32:58 -07:00
Brian Cain
e2d017b219
Continue updating environment boxes if metadata not found
Prior to this commit, if a user ran a `vagrant box update` on their
entire environment and one of the boxes did not have a metadata file,
the rest of the boxes in the update would be skipped. This commit fixes
that by ignoring those boxes and showng a warning, so that the rest of
the boxes could check for updates.
2019-05-08 09:04:45 -07:00
Brian Cain
ca232444e7
Separate snapshot names when listing snapshots
Prior to this commit, Vagrant would list all machine snapshots in a flat
list, without showing which snapshots were associated with which guests.
This commit fixes that by placing some separation to make it clear which
snapshots belong to which guests.
2019-05-06 11:09:34 -07:00
Alex Goncharov
b75768fc56 Fix box version sort in Update.update_specific 2019-04-24 18:57:34 -04:00
Brian Cain
46e42ed884
Move up doc string for vagrant snapshot pop
This commit moves up the doc string for the command `vagrant snapshot
pop` Prior to this commit it was hidden in between command line flags.
2019-04-09 13:14:44 -07:00
Brian Cain
5b3c6b8ad4
Fixes #10723: Fix bug instance var in Vagrant Cloud CLI optparse
This commit uses the correct instance variable for the optparse library
when reading in the command line flags for various Vagrant Cloud CLI
commands.
2019-03-11 14:21:55 -07:00
Brian Cain
cdcedb0a9e
Fixes #10682: Move over AddAuthentication middleware and hooks
Prior to this commit, the AddAuthentication hooks still existed in a
deprecated class LoginCommand. This commit fixes that by moving it over
to the vagrant cloud cli namespace instead.
2019-02-21 09:42:16 -08:00
Matt Adams
a3836f5fec Change remaining box_client_cert refs
This fixes issues with box add/update when self hosting with client
certs. The --cert option was not being added to the curl subprocess
in these cases.
2019-01-28 08:45:24 -06:00
Brian Cain
5d4c9ef8a7
Merge pull request #10513 from briancain/catch-invalid-version-errors-vagrant_cloud
Fixes #10509:  Catch InvalidVersion errors from vagrant_cloud client
2019-01-09 11:16:58 -08:00
Chris Roberts
e3cf74566c Add support for running elevated commands using the powershell command
This PR adds support for running command passed via the --command
flag as elevated tasks. The option is only valid for commands and
not when setting up a remote session. Logic has also been adjusted
for when communicator restrictions are applied and test coverage
has been added.
2018-12-20 11:30:25 -08:00
Brian Cain
ca6cc140ff
Catch InvalidVersion errors from vagrant_cloud client
This commit adds a new rescue to the `publish` command for when the
client detects an invalid version prior to making the API request to
create that version.
2018-12-17 14:41:29 -08:00
Chris Roberts
2daafd9586
Merge pull request #10490 from chrisroberts/f-snapshot-behavior
Update behavior of `snapshot restore` and `snapshot pop`
2018-12-13 09:18:20 -08:00
Chris Roberts
90a5854684 Fill out ssh options config and remote_user
Include config option within ssh_config command output template. Default
remote_user value to set username value. Include existence check on
provided config value to ensure file is available. Update tests to
include coverage on all changes. Add new options to the docs.
2018-12-11 08:09:43 -08:00
Gavin Williams
122ef7307c Flesh out :config support.
Also noticed whilst testing that if the `ProxyCommand` uses `%r`, then
it fails with `unable to find remote user`, so added support for
`config.ssh.remote_user` aswell
2018-12-11 07:51:47 -08:00
Chris Roberts
c999e7c3d4 Update behavior of snapshot restore and snapshot pop
Both of these commands failed to default the options disabling
the provisioning from ignoring the sentinel file. This resulted
in different behavior than what was seen with the `up` and
`resume` commands which would only provision items with run set
to "always". This defaults the options to proper match the behavior
of `up` and `resume` to be consistent.

This also adds an extra `--no-start` flag to allow users to restore
a snapshot but not start the restored guest immediately.

Fixes #6752
2018-12-07 16:17:44 -08:00
Brian Cain
119f82d826
Merge pull request #10479 from briancain/ensure-tmp-dir-cleanup-package-cmd
Fixes #9593: Ensure temp dir for package command is cleaned up
2018-12-06 15:08:18 -08:00
Brian Cain
2038f2878c
Merge pull request #10470 from wolfgang42/snapshot-error
snapshot plugin: Raise error for bad subcommand.
2018-12-04 14:32:22 -08:00
Brian Cain
86e2b78997
Fixes #9593: Ensure temp dir for package command is cleaned up
Prior to this commit, the package actions would create a temp dir in
the process of packaging and compressing a Vagrant box. This commit
ensures that the temp dir is removed once the command has completed so
that it doesn't leave around lots of temp directories.
2018-12-04 11:07:53 -08:00
Brian Cain
6531ed0970
Merge pull request #10468 from briancain/raise-error-if-provider-file-missing
Fixes #10432: Validate that provider file exists prior to upload
2018-12-03 15:57:50 -08:00
Brian Cain
5fa3c5866c
Ensure tmp dir for validate is removed once command exits 2018-12-03 14:50:20 -08:00
Wolfgang Faust
4ec092f46d snapshot plugin: Raise error for bad subcommand.
Closes #9773.
2018-12-01 14:44:42 -05:00
Brian Cain
6d4d9b9304
Fixes #10432: Validate that provider file exists prior to upload
Prior to this commit, Vagrant would attempt to path expand a file that
didn't exist if it was left out of the passed in arguments and no
`--url` was used for external box uploading. This commit fixes that by
adding some additional validation for the passed in box file.
2018-11-30 14:13:45 -08:00
Brian Cain
69eacd2b73
Remove machine from initialize method 2018-11-30 11:03:05 -08:00
Brian Cain
68dda8f853
Fixes #10224: Clear our registered providers when validating configs with no provider
Prior to this commit, if you went to validate your Vagrantfile and
wanted to ignore the provider, Vagrant would still fail as it checks if
there are any registered providers that are installed and usable. This
commit mocks out all registered providers to bypass that for the
validate command so that Vagrant can just validate the config and ignore
any provider config blocks.
2018-11-30 10:54:16 -08:00
Brian Cain
b951c0e781
Move login command warning
This commit moves where the warning is for the login command so that it
only displays when the command is invoked, and not when the plugin is
loaded.
2018-11-05 11:24:09 -08:00
Brian Cain
6051f3598e
Fixes #10224: Allow validation of config while ignoring provider
This commit adds a new flag to the `vagrant validate` command which
allows users to completely ignore the provider block of a config file.
This is useful for when you are running `vagrant validate` in CI and
don't want to install a valid provider to check the syntax of your
Vagratnfile. When the flag is invoked, a warning will be displayed
saying that the provider block will be ignored and not validated.
2018-10-30 13:37:22 -07:00
Brian Cain
15fb2b729d
Remove #Hash.compact for ruby 2.3 compatibility 2018-10-16 14:41:31 -07:00
Brian Cain
42c01f241c
Mark password as sensitive in logs 2018-10-12 09:07:12 -07:00
Brian Cain
adefbbaf6e
Scrub Vagrant Cloud tokens from RestClient logger 2018-10-12 09:07:12 -07:00
Brian Cain
e8115a4389
Update based on second round of feedback 2018-10-12 09:07:12 -07:00
Brian Cain
d8ec19faa8
Fixup: Update vagrant cloud command PR with feedback 2018-10-12 09:07:12 -07:00
Brian Cain
e67dac0dbb
Alias vagrant login command 2018-10-12 09:07:12 -07:00
Brian Cain
3c45acc35f
Continue if entity already exists with publish command 2018-10-12 09:07:12 -07:00
Brian Cain
83bd592e30
Introduce curl helper and uploader classes
This commit introduces a new uploader class for uploading files and
splits up some commonly used functionality between it and the downloader
class into a curl helper library.
2018-10-12 09:07:10 -07:00
Brian Cain
e70b871660
Introduce cloud command
This commit adds a new command to Vagrant called `cloud`. It handles any
and all interactions with the external service Vagrant Cloud.
2018-10-12 09:06:00 -07:00
Chris Roberts
ba0f0fbcab Default destination to basename of clean source 2018-10-08 15:29:55 -07:00
Chris Roberts
49a9ae4bd9 Remove current communicator name from error text 2018-10-08 14:30:11 -07:00
Chris Roberts
3181b5c1f9 Ensure winrm helper is loaded for command 2018-10-08 14:28:52 -07:00
Chris Roberts
d81abc1245 Fix active machine check to use common types when setting arguments 2018-10-08 14:22:32 -07:00
Chris Roberts
412290828b Fix trailing quotes in source path 2018-10-08 14:18:30 -07:00
Chris Roberts
904a712838 Provide correct RDP information within configuration information
Dynamically generate RDP information when applicable via provider
if supported. When no RDP port is provided ignore RDP in config
and omit from output.
2018-10-04 14:41:10 -07:00
Chris Roberts
48d358adcb Add winrm and upload commands 2018-10-04 13:26:41 -07:00
Brian Cain
4f42da15de
Merge pull request #10171 from eigengrau/default-template
vagrant init: Support VAGRANT_DEFAULT_TEMPLATE
2018-09-07 11:17:46 -07:00
Brian Cain
c3c65a3793
Fixup docs and website wording for command 2018-09-05 13:26:22 -07:00
Brian Cain
b1a0fa628f
Add subcommand docstring to powershell 2018-09-05 12:56:17 -07:00
Brian Cain
d6e43d3197
Include winrm locales 2018-09-05 11:00:45 -07:00
Sebastian Reuße
3efdc8960c vagrant init: Support VAGRANT_DEFAULT_TEMPLATE 2018-09-04 10:48:16 +02:00
Brian Cain
b1357a2f60
Merge pull request #10123 from briancain/add-force-flag-reload
Add `--force` flag to reload command
2018-08-17 15:18:36 -07:00
Brian Cain
e5364e7798
Only write box metadata if guest has box object
Prior to this commit, providers like docker would fail to be brought up
because they do not store box objects like virtualbox or vmware
provider guests. This commit fixes that by making sure the box object
exists before writing the metadata file to disk.
2018-08-17 09:58:24 -07:00
Brian Cain
c65a0a9054
(#9677) Add --force flag to reload command
This commit introduces the `--force` flag to the reload command. This
change means that if the flag is included, the halt step of the reload
will forcefully shutdown the virtual machine rather than a graceful
halt.
2018-08-16 13:57:13 -07:00
Chris Roberts
ceb7a0b5ac When doing box lookup, use explicit provider, machine provider, then default 2018-08-02 16:41:28 -07:00
Chris Roberts
00b783a6a5 Lookup latest available installed box if required on update
When performing a box update and the box version has been updated
to be different than the installed version, perform a lookup for
the latest available installed box to allow the update command to
continue successfully
2018-08-02 16:12:10 -07:00
Chris Roberts
6c1a9dc58e Store box metadata of active guest
When a guest is created, the box metadata information is stored in the
machine data directory. This allows modifications to happen to the
Vagrantfile definition of the box in use (box name change, box version
change, etc) while still allowing the Machine instance of an active
guest successfully load the box currently backing it.
2018-08-02 11:01:36 -07:00
Chris Roberts
7c9fb9a5d7 Use availablity of local plugins file instead of option 2018-07-18 15:49:30 -07:00
Chris Roberts
8e0e2fc53a Add output for local repair 2018-07-18 15:49:30 -07:00
Chris Roberts
8445b496d8 Use consistent terms for describing local flag 2018-07-18 14:19:29 -07:00
Chris Roberts
7a623d2826 Include local flag for plugin update command 2018-07-18 14:02:17 -07:00
Chris Roberts
3fd55dac23 Add local plugin repair support. Update global repair implementation. 2018-07-18 13:46:17 -07:00
Chris Roberts
ef0269c538 Add action method for local plugin repair 2018-07-18 13:45:15 -07:00
Chris Roberts
14edb8f423 Add local only and global only flags to plugin expunge command 2018-07-18 13:43:52 -07:00
Chris Roberts
9d191a2419 Add local option stub to allow Vagrantfile loading 2018-07-17 15:35:25 -07:00
Chris Roberts
8baf7ced38 Use path of state file, not state file itself 2018-07-17 15:35:25 -07:00
Chris Roberts
3223737734 Use env_local consistently internally 2018-07-17 14:49:41 -07:00
Chris Roberts
b71054502e Update local usage to env_local for clarity 2018-07-17 14:49:41 -07:00
Chris Roberts
84c0aafe71 Support non-interactive local plugin install 2018-07-17 14:49:41 -07:00
Chris Roberts
40f4e6f67e Vagrant Environment isolated plugins
Adds support for plugins isolated to a specific `Vagrant::Environment`
which can be managed by the vagrant plugin command using the the
--local flag.
2018-07-17 14:49:41 -07:00
Brian Cain
5ca382727d
Raise error if argument is provided with --all-global flag
This commit raises an error if additional arguments are provided to the
suspend command when the `--all-global` flag is used.
2018-05-11 15:43:14 -07:00
Brian Cain
aa5687cd14
(#7221) Introduce flag for suspending all machines
This commit introduces a new flag to the suspend command,
`--all-global`, which will suepend all vms both locally and globally.
2018-05-11 10:15:48 -07:00
Chris Roberts
97f5822dee Ignore URLs which cannot be parsed in the authentication middleware
Fixes #9725
2018-04-26 15:08:06 -07:00
Chris Roberts
5feb234665 Return original URL value when unmodified
Due to the behavior of URI.parse on Ruby < 2.5 returning the string
value of the parsed URI object may modify the original URL. Specifically
it will remove the `//` prefix characters from SMB paths. When no
host modifications are being made, always return the original value.

Fixes #9636
2018-04-25 16:21:21 -07:00
Josh Soref
1a5ddea9f4 Spelling fixes
* account
* addresses
* administrator
* afterwards
* because
* bridgeable
* capabilities
* capability
* checksum
* configuration
* configuration for
* configure
* criteria
* delimited
* delivered
* derivatives
* description
* detect
* directory
* display
* downloading
* during
* electric
* enabling
* encountered
* equivalent
* executable
* executed
* hashicorp
* hypervisor
* hyphens
* implementation
* incorporate
* inheritance
* initialize
* instance
* instead
* interactions
* invocable
* machine
* maximum
* message
* mounting
* overridden
* overwrite
* paramiko
* preparing
* provides
* provisioning
* recursively
* requested
* resetting
* retryable
* running
* satisfied
* searching
* sometimes
* specified
* successfully
* synced folders
* unauthorized
* underlying
* userprofile
* vagrant
* vagrantfile
* variable
* various
* version
* virtual
* windows
2018-03-14 14:41:04 +00:00
Chris Roberts
fc5ceafbcf Only generate notice once 2018-02-22 14:49:44 -08:00
Chris Roberts
f2bf18e56b Update behavior of the authentication middleware
Always remap old hosts to target host when encountered. When custom
vagrant server is defined, warn when tokens may be attached and allow
time for user to cancel.

Fixes #9442
2018-02-21 17:03:38 -08:00
Chris Roberts
58f66ac8ce Add full checkpoint integration 2018-01-16 14:16:49 -08:00
Brian Cain
11ddd0136d
(#9044) Show all box providers in command outdated
Prior to this commit, when the `--global` flag was used with the
`vagrant box outdated` command, it would ignore box providers and not
inform the user of all outdated boxes. This commit fixes that by
displaying each box within the users environment, and includes the
provider of the box in the message.
2018-01-08 09:43:28 -08:00
Brian Cain
c9e5a22bff (#9062) Deprecate :paranoid in favor of :verify_host_key
As of `net-ssh` version 4.2.0, the key :paranoid has been deprecated in
favor of using :verify_host_key. This commit updates Vagrants ssh config
to use the new key, and deprecates the use of :paranoid.
2018-01-05 10:02:45 -08:00
Brian Cain
b9581ed213
Merge pull request #9251 from briancain/9137/master/exit-0-destroy-not-created
Exit 0 if vagrant destroy finds no running vms
2017-12-20 16:42:36 -08:00
Brian Cain
d4d4ed6473 (#9137) Exit 0 if vagrant destroy finds no running vms
This commit reverts the behavior of `vagrant destroy` to exit 0 if no
running vms were found when the destroy command is run.
2017-12-14 12:48:22 -08:00
Chris Roberts
3a5729015a Add documentation entry for init command --template flag 2017-12-13 15:59:45 -08:00
Zachary Flower
abb1149190 Raise an exception when the template cannot be found, and update tests accordingly 2017-11-17 12:20:03 -07:00
Zachary Flower
14d596f08e Add --template option to init command, with graceful fallback to default Vagrantfile template behavior 2017-11-17 11:30:10 -07:00
Justin Campbell
40d8dc4582 Add app.vagrantup.com to allowed auth hosts
This should allow users setting VAGRANT_SERVER_URL to app.vagrantup.com to authenticate to private boxes.
2017-11-07 10:35:16 -05:00
Justin Campbell
c5266e98b8 Change allowed auth hosts to list 2017-11-07 10:32:33 -05:00
Brian Cain
8be2ae8e6a Add unit test for destroy command 2017-11-01 15:30:59 -07:00
Brian Cain
d8bffd201f Add delay for parallel destroy without force, restructure state checking
This commit adds better messaging to the user if the parallel flag is
used without the force flag. It also makes the state checking based on
the delta between the initial and final states of the guests due to the
fact that there is no guarantee what the "destroyed" state id will be
between providers.
2017-10-31 13:52:07 -07:00
Brian Cain
2d7858ff8a Introduce parallel destroy for certain providers
This commit introduces parallel destroy using the batch action class for
the destroy command.
2017-10-31 11:29:40 -07:00
Justin Campbell
f8fa7e3b29 command/login: Fix typo in server_error 2017-08-30 10:39:58 -04:00
Justin Campbell
3ddc98c2e4 command/login: Support 2FA login on Vagrant Cloud 2017-08-30 10:39:58 -04:00
Justin Campbell
0e091fee16 command/login: Store user/pass on client
Will allow us to prompt for other info without forgetting this data.
2017-08-30 10:39:58 -04:00
Brian Cain
b45ee4f455 (#6656) Format windows paths for ssh_config command
Prior to this commit, if the ssh-config command was invoked within
cygwin or msys2, it would show a regular windows style path for private
keys rather than a path that could be used within msys2 or cygwin. This
commit updates that behavior by converting all of the private key paths
to the proper msys2 or cygwin path if the platform is windows and the
command was invoked from one of those two shells.
2017-08-25 13:17:19 -07:00
Brian Cain
d9e088ba5d (#8479) Disable install providers when using global id on vagrant up
Prior to this commit, when using a global id to bring up a vagrant vm,
vagrant would fail during the "install provider" step due to the fact
that the global vagrant machine was not configured for the local vagrant
environment. Since this global vm exists elsewhere, we disable the
install provider step so that vagrant can just bring up the global
vagrant machine.
2017-08-22 10:08:05 -07:00
Brian Cain
4bd95cbfe2 (#8864) Improve vagrant validate command
Prior to this commit, the `vagrant validate` command would only validate
the first machine in a vagrant file. This commit improves that by
validating all known machines in the environment. If one is not found,
it will properly throw an exception instead of a stacktrace.
2017-08-15 13:53:45 -07:00
Brian Cain
335aa35ff4 Merge pull request #8871 from briancain/8719/master/add-force-flag-for-update
Add force flag for box upgrade command
2017-08-14 08:49:46 -07:00
Justin Campbell
03ebd8b714 command/login: Add hostname to default token desc
Uses `Socket.gethostname` to add the current hostname to the default
description.
2017-08-10 17:21:20 -04:00
Justin Campbell
92578aed4b command/login: Add description to created token
This adds a prompt for a token description, which is now supported in
Vagrant Cloud. Pressing enter on the prompt uses the default description
of `"Vagrant login"`.

    $ vagrant login
    In a moment we will ask for your username and password to HashiCorp's
    Vagrant Cloud. After authenticating, we will store an access token locally on
    disk. Your login details will be transmitted over a secure connection, and
    are never stored on disk locally.

    If you do not have an Vagrant Cloud account, sign up at
    https://www.vagrantcloud.com

    Vagrant Cloud Username: justincampbell
    Password (will be hidden):
    Token description (Defaults to "Vagrant login"):
    You are now logged in.
    $

Which created a token with the default description of "Vagrant login":

![](http://c.justincampbell.me/2V0p0T0U0d0O/Screen%20Shot%202017-08-10%20at%205.08.21%20PM.png)

Entering a description:

    Token description (Defaults to "Vagrant login"): Justin's MacBook Pro

![](http://c.justincampbell.me/2m1N0d1M3k3P/Screen%20Shot%202017-08-10%20at%205.09.39%20PM.png)
2017-08-10 17:12:38 -04:00
Brian Cain
324a08bd75 (#8719) Add force flag for box upgrade command
Prior to this commit, if a state was reached where the action_box_add
command needed a force flag, it would fail requesting the user to
provide that flag to override adding a new box. However that flag did
not exist on the box update command, and could not be passed onto the
action_box_add action. This commit updates that to include a force flag,
and if used, pass that value onto the action_box_add action.
2017-08-09 16:21:13 -07:00
Chris Roberts
5f955c3d38 Convert atlas references to vagrant cloud 2017-06-23 10:01:51 -07:00
Brian Cain
87b7514603 (#7188) Clean up vagrant snapshot restore/delete error messages
This commit adds some better handling around the snapshot restore and
delete commands for the virtualbox provider. If a user attempts to restore from
a vm that does not exist, instead of exiting 0 it will raise an
exception saying the virtual machine has not been created yet.
Addtionally, if a user attempts to restore from a snapshot id that does
not exist, instead of printing a complicated exception from the
virtualbox cli tool, it prints a more useful error message telling the
user that the snapshot does not exist.
2017-06-07 09:12:20 -07:00
Brian Cain
1ade699936 (#6827) Introduce tty flag for ssh command execution
Prior to this commit, if a user ran the `vagrant ssh -c CMD` command, it
would not allow the user to configure pseudo-terminal allocation. This
commit introduces a -t flag for the `vagrant ssh` command which defaults
to true if not specified.
2017-06-02 17:32:02 -07:00
Brian Cain
eadb0ac831 Raise exception if provider doesn't have snapshot capability
Prior to this commit, if a user attempted to use the `vagrant snapshot
save` or `vagrant snapshot list` commands on a vm whose provider did not
support snapshots, it would simply print a warning. This commit changes
that behavior by instead raising an error.
2017-05-26 15:22:25 -07:00
Brian Cain
6ddba4f7b3 (#7810) Enforce unique snapshot names
Prior to this commit, the vagrant snapshot plugin would save snapshots
with existing names which lead to duplicate snapshot names being saved.
This commit fixes that by checking to see if the given snapshot name
already exists and if so, fails telling the user the given snapshot name
already exists. If a user passes a --force flag, vagrant will first
delete the existing snapshot, and take a new one with the given name.
2017-05-25 16:28:17 -07:00
Chris Roberts
39606e833f Update method documentation to correctly describe method 2017-05-09 09:13:14 -07:00
Chris Roberts
df069deac0 Validate plugin sources and report errors if detected. 2017-04-04 17:53:04 -07:00
Gökhan Şengün
51a15d23bd Correct box version sorting of box list command.
Boxes are already correctly sorted as a result of PRs #7956 and #8334. The extra sort here breaks.
2017-03-29 00:56:42 +03:00
Chris Roberts
256ce3b0d5 Merge pull request #8264 from hasyimibhar/command-validate
Add validate command
2017-03-23 09:52:12 -07:00
Chris Roberts
e7abd1114b Merge pull request #8393 from chrisroberts/fix/default-provider-env-var
Prevent other provider install attempts when explicit provider given
2017-03-23 09:35:59 -07:00
Chris Roberts
72d0eb497d Isolate push deprecation to atlas strategy only 2017-03-21 15:08:17 -07:00
Chris Roberts
7c4252e24a Prevent other provider install attempts when explicit provider given 2017-03-21 10:58:06 -07:00