From e6711e3906c62850dc6431bd57f5fb58e243a9fc Mon Sep 17 00:00:00 2001 From: Sebastien Badia Date: Mon, 10 Nov 2014 10:46:29 +0100 Subject: [PATCH] Deprecate quota_injected_file_path_bytes (update for Juno) * Deprecate [DEFAULT]/quota_injected_file_path_bytes in favor of [DEFAULT] quota_injected_file_path_length. * Remove quota_max_injected_file_path_bytes parameter. Use new parameters for Juno like it's documented here: http://docs.openstack.org/trunk/config-reference/content/nova-conf-changes-master.html Change-Id: Ia408de8fa980b37e6d46dece8d90a83f2083df8a Partial-Bug: #1391099 --- manifests/quota.pp | 19 ++++++++++++++----- spec/classes/nova_quota_spec.rb | 8 ++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/manifests/quota.pp b/manifests/quota.pp index b1d6e0da0..a9f7fa4d9 100644 --- a/manifests/quota.pp +++ b/manifests/quota.pp @@ -57,6 +57,10 @@ # Defaults to 10240 # # [*quota_injected_file_path_bytes*] +# (optional) Deprecated. Use quota_injected_file_path_length instead +# Defaults to undef +# +# [*quota_injected_file_path_length*] # (optional) Maximum size in bytes of injected file path # Defaults to 255 # @@ -97,7 +101,7 @@ class nova::quota( $quota_metadata_items = 128, $quota_injected_files = 5, $quota_injected_file_content_bytes = 10240, - $quota_injected_file_path_bytes = 255, + $quota_injected_file_path_length = 255, $quota_security_groups = 10, $quota_security_group_rules = 20, $quota_key_pairs = 100, @@ -109,6 +113,7 @@ class nova::quota( $quota_volumes = undef, $quota_gigabytes = undef, $quota_max_injected_files = undef, + $quota_injected_file_path_bytes = undef, $quota_max_injected_file_content_bytes = undef, $quota_max_injected_file_path_bytes = undef ) { @@ -136,10 +141,14 @@ class nova::quota( } if $quota_max_injected_file_path_bytes { - warning('The quota_max_injected_file_path_bytes parameter is deprecated, use quota_injected_file_path_bytes instead.') - $quota_injected_file_path_bytes_real = $quota_max_injected_file_path_bytes + fail('The quota_max_injected_file_path_bytes parameter is deprecated, use quota_injected_file_path_length instead.') + } + + if $quota_injected_file_path_bytes { + warning('The quota_injected_file_path_bytes parameter is deprecated, use quota_injected_file_path_length instead.') + $quota_injected_file_path_length_real = $quota_injected_file_path_bytes } else { - $quota_injected_file_path_bytes_real = $quota_injected_file_path_bytes + $quota_injected_file_path_length_real = $quota_injected_file_path_length } nova_config { @@ -151,7 +160,7 @@ class nova::quota( 'DEFAULT/quota_metadata_items': value => $quota_metadata_items; 'DEFAULT/quota_injected_files': value => $quota_injected_files_real; 'DEFAULT/quota_injected_file_content_bytes': value => $quota_injected_file_content_bytes_real; - 'DEFAULT/quota_injected_file_path_bytes': value => $quota_injected_file_path_bytes_real; + 'DEFAULT/quota_injected_file_path_length': value => $quota_injected_file_path_length_real; 'DEFAULT/quota_security_groups': value => $quota_security_groups; 'DEFAULT/quota_security_group_rules': value => $quota_security_group_rules; 'DEFAULT/quota_key_pairs': value => $quota_key_pairs; diff --git a/spec/classes/nova_quota_spec.rb b/spec/classes/nova_quota_spec.rb index 16c47c7fe..8d6eeb530 100644 --- a/spec/classes/nova_quota_spec.rb +++ b/spec/classes/nova_quota_spec.rb @@ -15,7 +15,7 @@ describe 'nova::quota' do :quota_metadata_items => 128, :quota_injected_files => 5, :quota_injected_file_content_bytes => 10240, - :quota_injected_file_path_bytes => 255, + :quota_injected_file_path_length => 255, :quota_security_groups => 10, :quota_security_group_rules => 20, :quota_key_pairs => 100, @@ -52,7 +52,7 @@ describe 'nova::quota' do :quota_metadata_items => 256, :quota_injected_files => 10, :quota_injected_file_content_bytes => 20480, - :quota_injected_file_path_bytes => 254, + :quota_injected_file_path_length => 254, :quota_security_groups => 20, :quota_security_group_rules => 40, :quota_key_pairs => 200, @@ -69,14 +69,14 @@ describe 'nova::quota' do let :params do { :quota_max_injected_files => 10, :quota_max_injected_file_content_bytes => 20480, - :quota_max_injected_file_path_bytes => 254 + :quota_injected_file_path_bytes => 254 } end it { should contain_nova_config('DEFAULT/quota_injected_files').with_value('10') should contain_nova_config('DEFAULT/quota_injected_file_content_bytes').with_value('20480') - should contain_nova_config('DEFAULT/quota_injected_file_path_bytes').with_value('254') + should contain_nova_config('DEFAULT/quota_injected_file_path_length').with_value('254') } end