From c018f718d488509d33058074be6a46466b2e8229 Mon Sep 17 00:00:00 2001 From: Matt Fischer Date: Tue, 15 Dec 2015 22:16:02 -0700 Subject: [PATCH] Deprecate nova::utilities nova::utilities installs a bunch of packages, most of which have much to do with nova and includes deprecated tooling like euc2tools. This class makes little sense to do, if operators want these packages, they should install them directly. Change-Id: I50960a0e902fd0ba1fb8e4ba2852fdbc708bb1d9 --- manifests/init.pp | 10 +++++----- manifests/utilities.pp | 1 + spec/classes/nova_init_spec.rb | 10 +++++----- spec/classes/nova_utilities_spec.rb | 6 +++++- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index d59d44a26..6d4be7f9a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -188,10 +188,6 @@ # (optional) Syslog facility to receive log lines. # Defaults to undef # -# [*install_utilities*] -# (optional) Install nova utilities (Extra packages used by nova tools) -# Defaults to true, -# # [*use_ssl*] # (optional) Enable SSL on the API server # Defaults to false, not set @@ -330,6 +326,10 @@ # (optional) Disable Nagle algorithm # Defaults to undef # +# [*install_utilities*] +# (optional) Install nova utilities (Extra packages used by nova tools) +# Defaults to undef +# class nova( $ensure_package = 'present', $database_connection = undef, @@ -382,7 +382,6 @@ class nova( $use_syslog = undef, $use_stderr = undef, $log_facility = undef, - $install_utilities = true, $notification_driver = undef, $notification_topics = 'notifications', $notify_api_faults = false, @@ -407,6 +406,7 @@ class nova( $qpid_heartbeat = undef, $qpid_protocol = undef, $qpid_tcp_nodelay = undef, + $install_utilities = undef, ) inherits nova::params { include ::nova::deps diff --git a/manifests/utilities.pp b/manifests/utilities.pp index be8c1f991..f1bd02e35 100644 --- a/manifests/utilities.pp +++ b/manifests/utilities.pp @@ -3,6 +3,7 @@ # Extra packages used by nova tools # unzip swig screen parted curl euca2ools libguestfs-tools - extra packages class nova::utilities { + warning('This class is deprecated and will be removed in Mitaka. Make other plans if you need these packages installed') if $::osfamily == 'Debian' { ensure_packages(['unzip', 'screen', 'parted', 'curl', 'euca2ools']) diff --git a/spec/classes/nova_init_spec.rb b/spec/classes/nova_init_spec.rb index dd98db699..d4d62f336 100644 --- a/spec/classes/nova_init_spec.rb +++ b/spec/classes/nova_init_spec.rb @@ -64,8 +64,8 @@ describe 'nova' do is_expected.to contain_nova_config('cinder/catalog_info').with('value' => 'volumev2:cinderv2:publicURL') end - it 'installs utilities' do - is_expected.to contain_class('nova::utilities') + it 'does not install utilities' do + is_expected.to_not contain_class('nova::utilities') end end @@ -90,7 +90,7 @@ describe 'nova' do :auth_strategy => 'foo', :ensure_package => '2012.1.1-15.el6', :memcached_servers => ['memcached01:11211', 'memcached02:11211'], - :install_utilities => false, + :install_utilities => true, :notification_driver => 'ceilometer.compute.nova_notifier', :notification_topics => 'openstack', :notify_api_faults => true, @@ -169,8 +169,8 @@ describe 'nova' do ) } end - it 'does not install utilities' do - is_expected.to_not contain_class('nova::utilities') + it 'installs utilities' do + is_expected.to contain_class('nova::utilities') end end diff --git a/spec/classes/nova_utilities_spec.rb b/spec/classes/nova_utilities_spec.rb index f91f46ecd..8da06c906 100644 --- a/spec/classes/nova_utilities_spec.rb +++ b/spec/classes/nova_utilities_spec.rb @@ -3,11 +3,15 @@ require 'spec_helper' describe 'nova::utilities' do describe 'on debian platforms' do + let :pre_condition do + "class { '::nova': install_utilities => true }" + end + let :facts do @default_facts.merge({ :osfamily => 'Debian' }) end - it 'installes utilities' do + it 'installs utilities' do is_expected.to contain_package('unzip').with_ensure('present') is_expected.to contain_package('screen').with_ensure('present') is_expected.to contain_package('parted').with_ensure('present')