-
Notifications
You must be signed in to change notification settings - Fork 5
/
provisioning_argument.go
36 lines (29 loc) · 999 Bytes
/
provisioning_argument.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package vagrant
// ProvisioningOption is used to set whether provisioning should be forced,
// disabled, or use the default.
type ProvisioningOption uint8
const (
// DefaultProvisioning will cause vagrant to run the provisioners only if
// they haven't already been run.
DefaultProvisioning ProvisioningOption = iota
// ForceProvisioning will force the provisioners to run.
ForceProvisioning
// DisableProvisioning will disable provisioners.
DisableProvisioning
)
// ProvisioningArgument adds Provisioning and Provisioners arguments to a
// Command.
type ProvisioningArgument struct {
ProvisionersArgument
// Enable or disable provisioning
Provisioning ProvisioningOption
}
func (parg *ProvisioningArgument) buildArguments() []string {
args := parg.ProvisionersArgument.buildArguments()
if parg.Provisioning == ForceProvisioning {
args = append(args, "--provision")
} else if parg.Provisioning == DisableProvisioning {
args = append(args, "--no-provision")
}
return args
}