Skip to content

Commit

Permalink
Merge pull request voxpupuli#223 from 3flex/validate-location-priority
Browse files Browse the repository at this point in the history
Add validation for location $priority
  • Loading branch information
James Fryman committed Jan 6, 2014
2 parents 1470338 + f2f4c81 commit 6c16108
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion manifests/resource/location.pp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# [*auth_basic_user_file*] - This directive sets the htpasswd filename for
# the authentication realm.
# [*priority*] - Location priority. Default: 500. User priority
# 400-499, 501-599. If the priority is higher than the default priority,
# 401-499, 501-599. If the priority is higher than the default priority,
# the location will be defined after root, or before root.
#
#
Expand Down Expand Up @@ -131,6 +131,12 @@
}

validate_array($index_files)
if !is_integer($priority) {
fail("$priority must be an integer.")
}
if ($priority < 401) or ($priority > 599) {
fail("$priority must be in the range 401-599. It was set to ${priority}.")
}

# # Shared Variables
$ensure_real = $ensure ? {
Expand Down

0 comments on commit 6c16108

Please sign in to comment.