66 Commits

Author SHA1 Message Date
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
Paul Hinze
7c56c74bb6
Support and honor the "primary" option for Command plugins 2022-07-27 11:36:04 -05:00
sophia
2c0f43db3b Make flags that are only defined as --no- work 2022-05-23 11:41:08 -05:00
sophia
0b6781444a Resolve issue with Vagrant core providing more flag options than Vagrant legacy
This occurs when boolean flags in legacy Vagrant does
not define both a positive and negative boolean flag.
For example, --force and --no-force flags
2022-05-18 15:49:17 -05:00
sophia
28beec7bad Set alias for boolean flags that have a 'no-' option 2022-05-17 15:04:07 -05:00
Paul Hinze
7f56168959
Work around a few global flag collisions for ssh command
* `vagrant ssh` has a --no-tty flag colliding with the one defined in
   `bin/vagrant` - in fact none of the flags in `bin/vagrant` are
   processed in `serve` mode, so remove the code that captures them from
   the CommandInfo OptionParser dance
 * `vagrant ssh` has a `--plain` flag colliding with the one defined in
   `internal/cli/base.go` - this flag was inherited from Waypoint, so we
   can just rename it to line up with the (inversely defined) `--color`
   flag used in legacy vagrant
2022-04-25 12:26:48 -05:00
Paul Hinze
8f9952089a
Fix commands that run without a project
Some commands like `vagrant init` and `vagrant box` should be able to
run successfully without a full Project available in VAGRANT_CWD (in
other words, they don't require that a valid Vagrantfile be available.)

Thus far we've been assuming that a Project is available when
dispatching commands, which mean that commands of this nature weren't
working.

Here we make the Basis available to serve as an alternative client to
Vagrant::Environment::Remote such that it can be instantiated and passed
through to commands. This required some changes to Environment::Remote
to make its interactions with the client more defensive, but we manage
to avoid needing to make any changes to the normal legacy codepaths.
2022-04-25 12:26:47 -05:00
Chris Roberts
83ca40e239
Refactor Ruby service implementations
Update the Ruby service implementations to use the funcspec util
    module for generating spec content. A helper method is now used
    for generating a parent class for services to subclass which
    automatically includes all required modules for usage.
2022-04-25 12:26:37 -05:00
sophia
19f3d2f0b6
Refactor named plugin bits to apply to all components 2022-04-25 12:26:33 -05:00
sophia
8355209654
Accept machine for provider state endpoint 2022-04-25 12:26:24 -05:00
Chris Roberts
1a32e8c2f9
Fetch command banner and remove switch characters 2022-04-25 12:26:21 -05:00
Chris Roberts
5e6fe71a37
Use ruby command arguments type when executing command 2022-04-25 12:26:21 -05:00
sophia
df5f7d40e8
Rename exception logger to exception transformer
The exception logger no longer logs errors. Instead it transforms
the errors into a grpc friendly format. The exception that would
have been logged at this point gets logged when the task completes.
2022-04-25 12:26:20 -05:00
sophia
441f82760b
Include exception logger and attach to all available methods 2022-04-25 12:26:19 -05:00
Chris Roberts
5c8f14041c
Update services to provide broker and use proper plugin manager 2022-04-25 12:26:15 -05:00
Chris Roberts
167b8bf70d
Use seed util module for clients/services 2022-04-25 12:26:05 -05:00
Chris Roberts
faac057cca
Build arguments for command via mapper directly 2022-04-25 12:25:59 -05:00
Chris Roberts
917ac04ef1
Add expected types for funcspec maps 2022-04-25 12:25:58 -05:00
Chris Roberts
c6c7455c8e
Clean up and add some logging output 2022-04-25 12:24:47 -05:00
Chris Roberts
fd18051b0d
Update module usage within service implementations 2022-04-25 12:24:42 -05:00
Chris Roberts
ce29c48931
Use mapper when loading funcspec arguments in services 2022-04-25 12:24:38 -05:00
Chris Roberts
82549f5579
Use updated Remote UI class name 2022-04-25 12:24:35 -05:00
sophia
8808ef353e
Clean up logging 2022-04-25 12:24:27 -05:00
sophia
1ea5b2ba91
Save point: use target ref to retrieve info from target index 2022-04-25 12:24:26 -05:00
sophia
7de0fe1bd8
Get machine index remote service setup 2022-04-25 12:24:26 -05:00
Chris Roberts
9e514cc8c1
Remove target from spec 2022-04-25 12:24:25 -05:00
sophia
e86dc5958a
Clean up debugging cruft 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
d6e732cde3
Provide broker when loading terminal UI 2022-04-25 12:24:07 -05:00
Chris Roberts
742f94c9e0
Add modules to services and update exception logger usage 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