summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/kwalify.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/functions/kwalify.rb')
-rw-r--r--lib/puppet/parser/functions/kwalify.rb35
1 files changed, 0 insertions, 35 deletions
diff --git a/lib/puppet/parser/functions/kwalify.rb b/lib/puppet/parser/functions/kwalify.rb
deleted file mode 100644
index 49b9aeb..0000000
--- a/lib/puppet/parser/functions/kwalify.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# kwalify.rb
-#
-
-module Puppet::Parser::Functions
- newfunction(:kwalify, :type => :statement, :doc => <<-EOS
-This function uses kwalify to validate Puppet data structures against Kwalify
-schemas.
- EOS
- ) do |args|
-
- raise(Puppet::ParseError, "kwalify(): Wrong number of arguments " +
- "given (#{args.size} for 2)") if args.size != 2
-
- schema = args[0]
- document = args[1]
-
- require 'kwalify'
-
- validator = Kwalify::Validator.new(schema)
-
- errors = validator.validate(document)
-
- if errors && !errors.empty?
- error_out = []
- for e in errors
- error_out << "[#{e.path}] #{e.message}"
- end
- raise(Puppet::ParseError, "Failed kwalify schema validation:\n" + error_out.join("\n"))
- end
-
- end
-end
-
-# vim: set ts=2 sw=2 et :