Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace all validate functions with datatypes #201

Merged
merged 1 commit into from
Mar 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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