From 0d54db18cc5ec04d96cbf377228365ea2f49e22a Mon Sep 17 00:00:00 2001 From: Tom De Vylder Date: Fri, 6 Mar 2015 10:00:33 +0100 Subject: [PATCH] Assert private classes --- manifests/config.pp | 2 ++ manifests/install.pp | 2 ++ manifests/preinstall.pp | 2 ++ manifests/preinstall/redhat.pp | 4 +--- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 62f39f9..0640501 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,6 +1,8 @@ # == Class icingaweb2::config # class icingaweb2::config { + assert_private() + @user { 'icingaweb2': ensure => present, home => $::icingaweb2::web_root, diff --git a/manifests/install.pp b/manifests/install.pp index fce7d51..278e987 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -1,6 +1,8 @@ # == Class icingaweb2::install # class icingaweb2::install { + assert_private() + if $::icingaweb2::install_method == 'package' { if $::icingaweb2::pkg_list { package { $::icingaweb2::pkg_list: diff --git a/manifests/preinstall.pp b/manifests/preinstall.pp index 04e36b9..6e85fc3 100644 --- a/manifests/preinstall.pp +++ b/manifests/preinstall.pp @@ -1,6 +1,8 @@ # == Class icingaweb2::preinstall # class icingaweb2::preinstall { + assert_private() + if $::icingaweb2::manage_repo and $::icingaweb2::install_method == 'package' { case $::operatingsystem { 'RedHat', 'CentOS': { diff --git a/manifests/preinstall/redhat.pp b/manifests/preinstall/redhat.pp index 33c9498..49abc38 100644 --- a/manifests/preinstall/redhat.pp +++ b/manifests/preinstall/redhat.pp @@ -3,9 +3,7 @@ define icingaweb2::preinstall::redhat( $pkg_repo_version, ) { - if $caller_module_name != $module_name { - fail 'Tried to include private class icingaweb2::preinstall::redhat' - } + assert_private() case $::operatingsystem { 'RedHat', 'CentOS', 'Scientific': {