Sha256: 30e6487dcd2b98664458a135d508604c86aa0ab549b4b8994103015542b40c06
Contents?: true
Size: 1010 Bytes
Versions: 18
Compression:
Stored size: 1010 Bytes
Contents
module Katello module Validators class ContentViewPuppetModuleValidator < ActiveModel::Validator def validate(record) if record.uuid.blank? && (record.name.blank? || record.author.blank?) invalid_parameters = _("Invalid puppet module parameters specified. Either 'uuid' or 'name' and 'author' must be specified.") record.errors[:base] << invalid_parameters return end if record.name && record.author # validate that a puppet module exists with this name+author unless PuppetModule .in_repositories(record.content_view.puppet_repos) .where(:name => record.name, :author => record.author).present? invalid_parameters = _("Puppet Module with name='%{name}' and author='%{author}' does not exist") % { :name => record.name, :author => record.author } record.errors[:base] << invalid_parameters end end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems