vagrant-skytap 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,47 +0,0 @@
1
- module VagrantPlugins
2
- module Skytap
3
- module Command
4
- module StartMixins
5
-
6
- # Would be nice to just extend this, then alias #build_start_options
7
- # and add default options flag.
8
- #include VagrantPlugins::CommandUp::StartMixins
9
-
10
- # This adds the standard `start` command line flags to the given
11
- # OptionParser, storing the result in the `options` dictionary.
12
- #
13
- # @param [OptionParser] parser
14
- # @param [Hash] options
15
- def build_start_options(parser, options)
16
- # Setup the defaults
17
- options[:provision_types] = nil
18
-
19
- # Add the options
20
- parser.on("--[no-]provision", "Enable or disable provisioning") do |p|
21
- options[:provision_enabled] = p
22
- options[:provision_ignore_sentinel] = true
23
- end
24
-
25
- parser.on("--provision-with x,y,z", Array,
26
- "Enable only certain provisioners, by type.") do |list|
27
- options[:provision_types] = list.map { |type| type.to_sym }
28
- options[:provision_enabled] = true
29
- options[:provision_ignore_sentinel] = true
30
- end
31
- end
32
-
33
- # This validates the provisioner flags and raises an exception
34
- # if there are invalid ones.
35
- def validate_provisioner_flags!(options)
36
- (options[:provision_types] || []).each do |type|
37
- klass = Vagrant.plugin("2").manager.provisioners[type]
38
- if !klass
39
- raise Vagrant::Errors::ProvisionerFlagInvalid,
40
- name: type.to_s
41
- end
42
- end
43
- end
44
- end
45
- end
46
- end
47
- end