Merge pull request #574 from mhaskel/thankyou_geppetto
Rework defaults for `$object_name` in `postgresql::server::grant`
This commit is contained in:
commit
eaef089635
2 changed files with 12 additions and 7 deletions
|
@ -107,7 +107,6 @@ class postgresql::globals (
|
||||||
'9.3' => '2.1',
|
'9.3' => '2.1',
|
||||||
'9.4' => '2.1',
|
'9.4' => '2.1',
|
||||||
'93' => '2.1',
|
'93' => '2.1',
|
||||||
'9.4' => '2.1',
|
|
||||||
default => undef,
|
default => undef,
|
||||||
}
|
}
|
||||||
$globals_postgis_version = pick($postgis_version, $default_postgis_version)
|
$globals_postgis_version = pick($postgis_version, $default_postgis_version)
|
||||||
|
|
|
@ -4,7 +4,7 @@ define postgresql::server::grant (
|
||||||
$db,
|
$db,
|
||||||
$privilege = undef,
|
$privilege = undef,
|
||||||
$object_type = 'database',
|
$object_type = 'database',
|
||||||
$object_name = $db,
|
$object_name = undef,
|
||||||
$psql_db = $postgresql::server::default_database,
|
$psql_db = $postgresql::server::default_database,
|
||||||
$psql_user = $postgresql::server::user,
|
$psql_user = $postgresql::server::user,
|
||||||
$port = $postgresql::server::port
|
$port = $postgresql::server::port
|
||||||
|
@ -12,6 +12,12 @@ define postgresql::server::grant (
|
||||||
$group = $postgresql::server::group
|
$group = $postgresql::server::group
|
||||||
$psql_path = $postgresql::server::psql_path
|
$psql_path = $postgresql::server::psql_path
|
||||||
|
|
||||||
|
if ! $object_name {
|
||||||
|
$_object_name = $db
|
||||||
|
} else {
|
||||||
|
$_object_name = $object_name
|
||||||
|
}
|
||||||
|
|
||||||
## Munge the input values
|
## Munge the input values
|
||||||
$_object_type = upcase($object_type)
|
$_object_type = upcase($object_type)
|
||||||
$_privilege = upcase($privilege)
|
$_privilege = upcase($privilege)
|
||||||
|
@ -93,13 +99,13 @@ define postgresql::server::grant (
|
||||||
# object_type => 'TABLE',
|
# object_type => 'TABLE',
|
||||||
# object_name => [$schema, $table],
|
# object_name => [$schema, $table],
|
||||||
# }
|
# }
|
||||||
if is_array($object_name) {
|
if is_array($_object_name) {
|
||||||
$_togrant_object = join($object_name, '"."')
|
$_togrant_object = join($_object_name, '"."')
|
||||||
# Never put double quotes into has_*_privilege function
|
# Never put double quotes into has_*_privilege function
|
||||||
$_granted_object = join($object_name, '.')
|
$_granted_object = join($_object_name, '.')
|
||||||
} else {
|
} else {
|
||||||
$_granted_object = $object_name
|
$_granted_object = $_object_name
|
||||||
$_togrant_object = $object_name
|
$_togrant_object = $_object_name
|
||||||
}
|
}
|
||||||
|
|
||||||
$_unless = $unless_function ? {
|
$_unless = $unless_function ? {
|
||||||
|
|
Loading…
Reference in a new issue