Code Review
/
packages
/
precise
/
mcollective.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
| inline |
side by side
Updated mcollective.init according to OSCI-658
[packages/precise/mcollective.git]
/
plugins
/
mcollective
/
validator
/
array_validator.rb
diff --git a/plugins/mcollective/validator/array_validator.rb
b/plugins/mcollective/validator/array_validator.rb
new file mode 100644
(file)
index 0000000..
ed119f8
--- /dev/null
+++ b/
plugins/mcollective/validator/array_validator.rb
@@ -0,0
+1,9
@@
+module MCollective
+ module Validator
+ class ArrayValidator
+ def self.validate(validator, array)
+ raise ValidatorError, "value should be one of %s" % [ array.join(", ") ] unless array.include?(validator)
+ end
+ end
+ end
+end