diff --git a/manifests/service/all.pp b/manifests/service/all.pp index 2127344f..b4070608 100644 --- a/manifests/service/all.pp +++ b/manifests/service/all.pp @@ -22,7 +22,8 @@ class sahara::service::all ( $package_ensure = 'present', ) { - require ::sahara + include ::sahara::policy + include ::sahara::params Sahara_config<||> ~> Service['sahara-all'] Class['sahara::policy'] ~> Service['sahara-all'] diff --git a/manifests/service/api.pp b/manifests/service/api.pp index ca8fb1ec..15510791 100644 --- a/manifests/service/api.pp +++ b/manifests/service/api.pp @@ -28,7 +28,8 @@ class sahara::service::api ( $package_ensure = 'present', ) { - require ::sahara + include ::sahara::policy + include ::sahara::params Sahara_config<||> ~> Service['sahara-api'] Class['sahara::policy'] ~> Service['sahara-api'] diff --git a/manifests/service/engine.pp b/manifests/service/engine.pp index 89f3b9ef..83296728 100644 --- a/manifests/service/engine.pp +++ b/manifests/service/engine.pp @@ -22,10 +22,9 @@ class sahara::service::engine ( $package_ensure = 'present', ) { - require ::sahara + include ::sahara::params Sahara_config<||> ~> Service['sahara-engine'] - Class['sahara::policy'] ~> Service['sahara-engine'] package { 'sahara-engine': ensure => $package_ensure, diff --git a/spec/classes/sahara_all_spec.rb b/spec/classes/sahara_all_spec.rb index 8205e5b8..d1833f03 100644 --- a/spec/classes/sahara_all_spec.rb +++ b/spec/classes/sahara_all_spec.rb @@ -2,12 +2,6 @@ require 'spec_helper' describe 'sahara::service::all' do - shared_examples_for 'sahara-all' do - context 'require main class' do - it { is_expected.to contain_class('sahara') } - end - end - context 'on Debian platforms' do let :facts do @default_facts.merge({ @@ -16,8 +10,6 @@ describe 'sahara::service::all' do }) end - it_configures 'sahara-all' - it_behaves_like 'generic sahara service', { :name => 'sahara-all', :package_name => 'sahara', @@ -29,8 +21,6 @@ describe 'sahara::service::all' do @default_facts.merge({ :osfamily => 'RedHat' }) end - it_configures 'sahara-all' - it_behaves_like 'generic sahara service', { :name => 'sahara-all', :package_name => 'openstack-sahara', diff --git a/spec/classes/sahara_api_spec.rb b/spec/classes/sahara_api_spec.rb index c15b3868..d5df33cf 100644 --- a/spec/classes/sahara_api_spec.rb +++ b/spec/classes/sahara_api_spec.rb @@ -4,10 +4,6 @@ describe 'sahara::service::api' do shared_examples_for 'sahara-api' do - context 'require main class' do - it { is_expected.to contain_class('sahara') } - end - context 'default params' do it { is_expected.to contain_sahara_config('DEFAULT/api_workers').with_value('') } end diff --git a/spec/classes/sahara_engine_spec.rb b/spec/classes/sahara_engine_spec.rb index a6b2504d..64cbac54 100644 --- a/spec/classes/sahara_engine_spec.rb +++ b/spec/classes/sahara_engine_spec.rb @@ -2,19 +2,11 @@ require 'spec_helper' describe 'sahara::service::engine' do - shared_examples_for 'sahara-engine' do - context 'require main class' do - it { is_expected.to contain_class('sahara') } - end - end - context 'on Debian platforms' do let :facts do @default_facts.merge({ :osfamily => 'Debian' }) end - it_configures 'sahara-engine' - it_behaves_like 'generic sahara service', { :name => 'sahara-engine', :package_name => 'sahara-engine', @@ -26,8 +18,6 @@ describe 'sahara::service::engine' do @default_facts.merge({ :osfamily => 'RedHat' }) end - it_configures 'sahara-engine' - it_behaves_like 'generic sahara service', { :name => 'sahara-engine', :package_name => 'openstack-sahara-engine', diff --git a/spec/shared_examples.rb b/spec/shared_examples.rb index 70dc4c3d..88010d7e 100644 --- a/spec/shared_examples.rb +++ b/spec/shared_examples.rb @@ -11,7 +11,7 @@ shared_examples 'generic sahara service' do |service| is_expected.to contain_package(service[:name]).with({ :name => service[:package_name], :ensure => 'present', - :notify => ["Service[#{service[:name]}]", 'Exec[sahara-dbmanage]'] + :notify => "Service[#{service[:name]}]" }) is_expected.to contain_service(service[:name]).with({ :name => service[:service_name], @@ -32,7 +32,7 @@ shared_examples 'generic sahara service' do |service| is_expected.to contain_package(service[:name]).with({ :name => service[:package_name], :ensure => '2014.2-1', - :notify => ["Service[#{service[:name]}]", 'Exec[sahara-dbmanage]'] + :notify => "Service[#{service[:name]}]" }) is_expected.to contain_service(service[:name]).with({ :name => service[:service_name],