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
@@ -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