Ensure absolute path for file creation

This ensures the parameters used as file paths accept only absolute
paths, so that more sensible errors are returned to users instead of
the error from the file resource.

Change-Id: If82751d8fc42e606593cf6c4a40651325e61872b
This commit is contained in:
Takashi Kajinami 2023-08-22 10:18:58 +09:00
parent 6bde164bd1
commit 3cb2b5472e
4 changed files with 53 additions and 53 deletions

View File

@ -182,7 +182,7 @@ define cinder::backend::netapp (
$thres_avl_size_perc_start = $facts['os_service_default'],
$thres_avl_size_perc_stop = $facts['os_service_default'],
Optional[Array[String]] $nfs_shares = undef,
$nfs_shares_config = '/etc/cinder/shares.conf',
Stdlib::Absolutepath $nfs_shares_config = '/etc/cinder/shares.conf',
$nfs_mount_options = $facts['os_service_default'],
$netapp_host_type = $facts['os_service_default'],
Boolean $manage_volume_type = false,

View File

@ -97,7 +97,7 @@ define cinder::backend::nfs (
$nfs_mount_options = $facts['os_service_default'],
$nfs_sparsed_volumes = $facts['os_service_default'],
$nfs_mount_point_base = $facts['os_service_default'],
$nfs_shares_config = '/etc/cinder/shares.conf',
Stdlib::Absolutepath $nfs_shares_config = '/etc/cinder/shares.conf',
$nfs_used_ratio = $facts['os_service_default'],
$nfs_oversub_ratio = $facts['os_service_default'],
$nas_secure_file_operations = $facts['os_service_default'],

View File

@ -67,7 +67,7 @@ define cinder::backend::vstorage (
$cluster_password,
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$shares_config_path = '/etc/cinder/vzstorage_shares',
Stdlib::Absolutepath $shares_config_path = '/etc/cinder/vzstorage_shares',
$use_sparsed_volumes = $facts['os_service_default'],
$used_ratio = $facts['os_service_default'],
$mount_point_base = $facts['os_service_default'],

View File

@ -21,8 +21,8 @@
# Defaults to '/var/lib/cinder'.
#
class cinder::setup_test_volume(
$volume_name = 'cinder-volumes',
$volume_path = '/var/lib/cinder',
String[1] $volume_name = 'cinder-volumes',
Stdlib::Absolutepath $volume_path = '/var/lib/cinder',
$size = '4G',
$loopback_device = '/dev/loop2'
) {