From b11b93405e6094883ab41b5ab3a8d45ce54a7292 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Tue, 5 Jul 2016 09:19:20 +0800 Subject: [PATCH] Deprecate migration flags parameters The correct live and block migration flags can be inferred from the new live_migration_tunnelled config option. live_migration_flag and block_migration_flag will be removed to avoid potential misconfiguration. Change-Id: I523d351900ee7852875e94e1d5d5cffb76935f11 --- manifests/migration/libvirt.pp | 42 +++++++++---------- ...ion_flags_parameters-41ef9156a4e77121.yaml | 4 ++ spec/classes/nova_migration_libvirt_spec.rb | 4 -- 3 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 releasenotes/notes/deprecate_migration_flags_parameters-41ef9156a4e77121.yaml diff --git a/manifests/migration/libvirt.pp b/manifests/migration/libvirt.pp index 7630c103c..6acbc3ece 100644 --- a/manifests/migration/libvirt.pp +++ b/manifests/migration/libvirt.pp @@ -13,14 +13,6 @@ # Valid options are none and sasl. # Defaults to 'none' # -# [*live_migration_flag*] -# (optional) Migration flags to be set for live migration (string value) -# Defaults to undef -# -# [*block_migration_flag*] -# (optional) Migration flags to be set for block migration (string value) -# Defaults to undef -# # [*live_migration_tunnelled*] # (optional) Whether to use tunnelled migration, where migration data is # transported over the libvirtd connection. @@ -44,15 +36,26 @@ # (optional) Whether or not configure libvirt bits. # Defaults to true. # +#DEPRECATED PARAMETERS +# +# [*live_migration_flag*] +# (optional) Migration flags to be set for live migration (string value) +# Defaults to undef +# +# [*block_migration_flag*] +# (optional) Migration flags to be set for block migration (string value) +# Defaults to undef +# class nova::migration::libvirt( $use_tls = false, $auth = 'none', - $live_migration_flag = undef, - $block_migration_flag = undef, $live_migration_tunnelled = $::os_service_default, $override_uuid = false, $configure_libvirt = true, $configure_nova = true, + #DEPRECATED PARAMETERS + $live_migration_flag = undef, + $block_migration_flag = undef, ){ include ::nova::deps @@ -67,23 +70,20 @@ class nova::migration::libvirt( $listen_tcp = '1' } + if $live_migration_flag { + warning('live_migration_flag parameter is deprecated, has no effect and will be removed in a future release.') + } + + if $block_migration_flag { + warning('block_migration_flag parameter is deprecated, has no effect and will be removed in a future release.') + } + if $configure_nova { if $use_tls { nova_config { 'libvirt/live_migration_uri': value => 'qemu+tls://%s/system'; } } - if $live_migration_flag { - nova_config { - 'libvirt/live_migration_flag': value => $live_migration_flag - } - } - - if $block_migration_flag { - nova_config { - 'libvirt/block_migration_flag': value => $block_migration_flag - } - } nova_config { 'libvirt/live_migration_tunnelled': value => $live_migration_tunnelled diff --git a/releasenotes/notes/deprecate_migration_flags_parameters-41ef9156a4e77121.yaml b/releasenotes/notes/deprecate_migration_flags_parameters-41ef9156a4e77121.yaml new file mode 100644 index 000000000..171f6ed13 --- /dev/null +++ b/releasenotes/notes/deprecate_migration_flags_parameters-41ef9156a4e77121.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - The live_migration_flag and block_migration_flag parameters + are deprecated. diff --git a/spec/classes/nova_migration_libvirt_spec.rb b/spec/classes/nova_migration_libvirt_spec.rb index 22d2d8a83..22e6400e5 100644 --- a/spec/classes/nova_migration_libvirt_spec.rb +++ b/spec/classes/nova_migration_libvirt_spec.rb @@ -80,13 +80,9 @@ describe 'nova::migration::libvirt' do context 'with migration flags set' do let :params do { - :live_migration_flag => 'live migration flag', - :block_migration_flag => 'block migration flag', :live_migration_tunnelled => true, } end - it { is_expected.to contain_nova_config('libvirt/live_migration_flag').with(:value => 'live migration flag') } - it { is_expected.to contain_nova_config('libvirt/block_migration_flag').with(:value => 'block migration flag') } it { is_expected.to contain_nova_config('libvirt/live_migration_tunnelled').with(:value => true) } end