@@ -21,38 +21,47 @@ def initialize(pp)
21
21
klass . new ( project_path )
22
22
end
23
23
24
- def get_plugins ( req , _ )
25
- plugins = [ ]
26
- env = vagrant_env ( req . project_path )
24
+ def extract_plugin_protos ( plugin_manager )
25
+ plugins = [ [ :commands , :COMMAND ] ,
26
+ [ :communicators , :COMMUNICATOR ] ,
27
+ [ :config , :CONFIG ] ,
28
+ [ :guests , :GUEST ] ,
29
+ [ :hosts , :HOST ] ,
30
+ [ :provider_configs , :CONFIG ] ,
31
+ [ :providers , :PROVIDER ] ,
32
+ [ :provisioner_configs , :CONFIG ] ,
33
+ [ :provisioners , :PROVISIONER ] ,
34
+ [ :push_configs , :CONFIG ] ,
35
+ [ :pushes , :PUSH ] ,
36
+ [ :synced_folders , :SYNCEDFOLDER ] ] . map do |method , const |
37
+ plugin_manager . send ( method ) . map do |k , v |
38
+ Hashicorp ::Vagrant ::Plugin . new (
39
+ name : k ,
40
+ type : Hashicorp ::Vagrant ::Plugin ::Type . const_get ( const ) ,
41
+ options : Google ::Protobuf ::Any . pack (
42
+ _convert_options_to_proto ( const , v )
43
+ )
44
+ )
45
+ end
46
+ end . flatten
47
+ Hashicorp ::Vagrant ::GetPluginsResponse . new (
48
+ plugins : plugins
49
+ )
50
+ end
51
+
52
+ def get_global_plugins ( req , _ )
27
53
plugin_manager = Vagrant ::Plugin ::V2 ::Plugin . local_manager
28
54
globalized_plugins = Vagrant ::Plugin ::Manager . instance . globalize!
55
+ Vagrant ::Plugin ::Manager . instance . load_plugins ( globalized_plugins )
56
+ extract_plugin_protos ( plugin_manager )
57
+ end
58
+
59
+ def get_local_plugins ( req , _ )
60
+ env = vagrant_env ( req . project_path )
61
+ plugin_manager = Vagrant ::Plugin ::V2 ::Plugin . local_manager
29
62
localized_plugins = Vagrant ::Plugin ::Manager . instance . localize! ( env )
30
- Vagrant ::Plugin ::Manager . instance . load_plugins ( globalized_plugins . merge ( localized_plugins ) )
31
- plugins = [ [ :commands , :COMMAND ] ,
32
- [ :communicators , :COMMUNICATOR ] ,
33
- [ :config , :CONFIG ] ,
34
- [ :guests , :GUEST ] ,
35
- [ :hosts , :HOST ] ,
36
- [ :provider_configs , :CONFIG ] ,
37
- [ :providers , :PROVIDER ] ,
38
- [ :provisioner_configs , :CONFIG ] ,
39
- [ :provisioners , :PROVISIONER ] ,
40
- [ :push_configs , :CONFIG ] ,
41
- [ :pushes , :PUSH ] ,
42
- [ :synced_folders , :SYNCEDFOLDER ] ] . map do |method , const |
43
- plugin_manager . send ( method ) . map do |k , v |
44
- Hashicorp ::Vagrant ::Plugin . new (
45
- name : k ,
46
- type : Hashicorp ::Vagrant ::Plugin ::Type . const_get ( const ) ,
47
- options : Google ::Protobuf ::Any . pack (
48
- _convert_options_to_proto ( const , v )
49
- )
50
- )
51
- end
52
- end . flatten
53
- Hashicorp ::Vagrant ::GetPluginsResponse . new (
54
- plugins : plugins
55
- )
63
+ Vagrant ::Plugin ::Manager . instance . load_plugins ( localized_plugins )
64
+ extract_plugin_protos ( plugin_manager )
56
65
end
57
66
58
67
def stop ( _ , _ )
0 commit comments