Skip to content

Commit

Permalink
Merge pull request #201 from bastelfreak/puppet4
Browse files Browse the repository at this point in the history
replace all validate functions with datatypes
  • Loading branch information
yastupin authored Mar 3, 2017
2 parents bad1c5b + 1f0e577 commit 2d343fc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
13 changes: 5 additions & 8 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
# @param module_build_root See main class
#
class selinux::config (
$mode = $::selinux::mode,
$type = $::selinux::type,
$manage_package = $::selinux::manage_package,
$package_name = $::selinux::package_name,
$module_build_root = $::selinux::module_build_root
$mode = $::selinux::mode,
$type = $::selinux::type,
$manage_package = $::selinux::manage_package,
$package_name = $::selinux::package_name,
Stdlib::Absolutepath $module_build_root = $::selinux::module_build_root
) {

if $caller_module_name != $module_name {
Expand Down Expand Up @@ -95,9 +95,6 @@
}
}

# Module build config:
validate_absolute_path($module_build_root)

file {$module_build_root:
ensure => 'directory',
owner => 'root',
Expand Down
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
class selinux (
Optional[Enum['enforcing', 'permissive', 'disabled']] $mode = $::selinux::params::mode,
Optional[Enum['targeted', 'minimum', 'mls']] $type = $::selinux::params::type,
String $refpolicy_makefile = $::selinux::params::refpolicy_makefile,
Stdlib::Absolutepath $refpolicy_makefile = $::selinux::params::refpolicy_makefile,
Boolean $manage_package = $::selinux::params::manage_package,
String $package_name = $::selinux::params::package_name,
String $refpolicy_package_name = $::selinux::params::refpolicy_package_name,
String $module_build_root = $::selinux::params::module_build_root,
Stdlib::Absolutepath $module_build_root = $::selinux::params::module_build_root,
Enum['refpolicy', 'simple'] $default_builder = 'simple',

### START Hiera Lookups ###
Expand Down
4 changes: 0 additions & 4 deletions manifests/module.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@
fail("The simple builder does not support the 'source_if' parameter")
}

# let's just make doubly sure that this is an absolute path:
validate_absolute_path($::selinux::config::module_build_dir)
validate_absolute_path($::selinux::refpolicy_makefile)

$module_dir = $::selinux::config::module_build_dir
$module_file = "${module_dir}/${title}"

Expand Down
1 change: 0 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

$refpolicy_package_name = 'selinux-policy-devel'

validate_absolute_path($::selinux_agent_vardir)
$module_build_root = "${::selinux_agent_vardir}/puppet-selinux"

if $::operatingsystemmajrelease {
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.6.0 < 5.0.0"
"version_requirement": ">= 4.13.1 < 5.0.0"
}
],
"requirements": [
Expand Down

0 comments on commit 2d343fc

Please sign in to comment.