Some CFEngine config validation
This commit is contained in:
parent
c457285fb6
commit
ae8e8830c4
|
@ -56,6 +56,19 @@ module VagrantPlugins
|
|||
@yum_repo_url = "http://cfengine.com/pub/yum/"
|
||||
end
|
||||
end
|
||||
|
||||
def validate(machine)
|
||||
errors = []
|
||||
|
||||
valid_modes = [:bootstrap, :singlerun]
|
||||
errors << I18n.t("vagrant.cfengine_config.invalid_mode") if !valid_modes.include?(@mode)
|
||||
|
||||
if @mode == :bootstrap
|
||||
errors << I18n.t("vagrant.cfengine_config.policy_server_address") if !@policy_server_address
|
||||
end
|
||||
|
||||
{ "CFEngine" => errors }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,6 +11,12 @@ en:
|
|||
cfengine_no_bootstrap: |-
|
||||
CFEngine doesn't require bootstrap. Not bootstrapping.
|
||||
|
||||
cfengine_config:
|
||||
invalid_mode: |-
|
||||
The mode must be 'bootstrap' or 'singlerun'
|
||||
policy_server_address: |-
|
||||
The policy server address must be set for bootstrapping.
|
||||
|
||||
general:
|
||||
batch_unexpected_error: |-
|
||||
An unexpected error ocurred when executing the action on the
|
||||
|
|
Loading…
Reference in New Issue