85 Commits

Author SHA1 Message Date
Chris Roberts
7c93e6b0f1 Update plugin related functions for manager changes 2022-04-25 16:12:38 -07:00
Chris Roberts
eef7eca1c5 Use dedicated function to check for legacy 2022-04-25 16:12:38 -07:00
Chris Roberts
813963cb7b Update log level for trace type message 2022-04-25 16:12:38 -07:00
Chris Roberts
32807020af Update basis to use cleanup 2022-04-25 16:12:38 -07:00
Chris Roberts
6c7e154a92 Only register managers if legacy is loaded. Close core manager. 2022-04-25 16:01:10 -07:00
Chris Roberts
287268635a Update basis ResourceId() function to match core signature 2022-04-25 16:01:10 -07:00
sophia
25dfcd039f Update paths to use Path type instead of string 2022-04-25 14:12:28 -05:00
Chris Roberts
341dabcebd
Log seeding as trace level messages 2022-04-25 12:26:54 -05:00
Paul Hinze
ae58d787a0
Fix leaking basis log lines 2022-04-25 12:26:54 -05:00
sophia
77a06e83d0
Close core plugins 2022-04-25 12:26:50 -05:00
sophia
68ffb3a8cf
Inject core plugin manager into context when running plugins 2022-04-25 12:26:50 -05:00
sophia
c2c784a295
Seed basis with core plugin manager 2022-04-25 12:26:49 -05:00
sophia
0d38ccf20c
Create boxes dir if it does not exist 2022-04-25 12:26:49 -05:00
sophia
82fa38f5e0
Check for consistency between db/boxes dir when creating box collection 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
Paul Hinze
61fbd0f622
Move Basis, Project, and Target seeding earlier
Having these objects populate their seeds during `Run` was too late for
those values to show up in command plugins, which would be seeded with
empty args instead.

h/t @chrisroberts for the debugging help and fix suggestion!
2022-04-25 12:26:47 -05:00
sophia
dffa7547e8
Simplify target index to keep track of basis opposed to loading one in from the factory 2022-04-25 12:26:42 -05:00
Chris Roberts
14fa44a449
Update to use command info from sdk 2022-04-25 12:26:32 -05:00
Chris Roberts
1155e7be21
Configure plugins and use plugin local functions 2022-04-25 12:26:14 -05:00
sophia
3a43cd35cb
Don't use config if it doesn't exist yet 2022-04-25 12:26:06 -05:00
sophia
04591646a3
Use host from vagrantfile if defined 2022-04-25 12:26:06 -05:00
sophia
36dbd73945
Add endpoint for accessing basis/project/target config 2022-04-25 12:26:06 -05:00
sophia
01bc9a8430
Remove unused config from basis 2022-04-25 12:26:06 -05:00
Chris Roberts
6b37b7ba55
Add seed functions and seed before running 2022-04-25 12:26:05 -05:00
Chris Roberts
bd2d399951
Use function to get component type 2022-04-25 12:26:05 -05:00
sophia
f1dc606d11
Get plugins from basis 2022-04-25 12:26:04 -05:00
sophia
d49944a25d
Only init targets when running a job scoped at the project or target 2022-04-25 12:26:01 -05:00
Chris Roberts
a2147ed27f
Update basis ResourceId to match interface 2022-04-25 12:25:59 -05:00
Chris Roberts
22de22e199
Update parent counting when loading plugins 2022-04-25 12:25:59 -05:00
sophia
d786649e03
Add box if not found in box collection 2022-04-25 12:25:55 -05:00
sophia
2dfb9b933e
Get boxes from project 2022-04-25 12:25:55 -05:00
sophia
c4cd5c599b
Add mappers to component at component creation phase 2022-04-25 12:25:51 -05:00
sophia
63c71b0a20
Append mappers to a plugin component 2022-04-25 12:25:51 -05:00
Chris Roberts
7595f1533f
Enable plugin mappers 2022-04-25 12:25:50 -05:00
Chris Roberts
038d4b16c3
Cache host value to prevent multiple lookups during run 2022-04-25 12:25:50 -05:00
sophia
22c75fe979
Raise error for failing to load parent plugin 2022-04-25 12:25:49 -05:00
Chris Roberts
cb869a6597
Fix up logging, singularize name 2022-04-25 12:25:49 -05:00
sophia
cafa1d039d
Load single parent plugin 2022-04-25 12:24:48 -05:00
sophia
fd96279d82
Count number of parents for host plugin 2022-04-25 12:24:48 -05:00
sophia
f1f1b8c79d
Update parents -> parent 2022-04-25 12:24:48 -05:00
sophia
3d0197d0bf
Store plugin parents 2022-04-25 12:24:47 -05:00
Chris Roberts
7cc07642a5
Use project for host capabilities 2022-04-25 12:24:47 -05:00
Chris Roberts
66d2a70291
Seed host and guest plugins 2022-04-25 12:24:45 -05:00
Chris Roberts
99978cf9d6
Set statebag into host plugin 2022-04-25 12:24:45 -05:00
sophia
58ffe630a2
Pass statebag to host detect function 2022-04-25 12:24:41 -05:00
sophia
97baac8772
Check for parents if host detected 2022-04-25 12:24:41 -05:00
sophia
f845222c44
Add statebag to basis 2022-04-25 12:24:40 -05:00
sophia
b30bbcb13a
Don't check for 'found' in basis/project/target query results 2022-04-25 12:24:39 -05:00
Chris Roberts
c4011c7fde
Attach factory to basis. Let basis provide target index 2022-04-25 12:24:31 -05:00
Chris Roberts
d16eee410f
Add target initialization when loading project 2022-04-25 12:24:24 -05:00