Remove require on main init class

Now all Sahara packages are fixed and we don't need use require
for main init.pp class from service classes anymore.

Change-Id: If11b03675ed62f3f56e69cb4fbeb75a3d46a5ab7
This commit is contained in:
Denis Egorenko 2015-12-09 20:26:27 +03:00
parent e9b312c5bb
commit 0c465a0333
7 changed files with 7 additions and 30 deletions

View File

@ -22,7 +22,8 @@ class sahara::service::all (
$package_ensure = 'present', $package_ensure = 'present',
) { ) {
require ::sahara include ::sahara::policy
include ::sahara::params
Sahara_config<||> ~> Service['sahara-all'] Sahara_config<||> ~> Service['sahara-all']
Class['sahara::policy'] ~> Service['sahara-all'] Class['sahara::policy'] ~> Service['sahara-all']

View File

@ -28,7 +28,8 @@ class sahara::service::api (
$package_ensure = 'present', $package_ensure = 'present',
) { ) {
require ::sahara include ::sahara::policy
include ::sahara::params
Sahara_config<||> ~> Service['sahara-api'] Sahara_config<||> ~> Service['sahara-api']
Class['sahara::policy'] ~> Service['sahara-api'] Class['sahara::policy'] ~> Service['sahara-api']

View File

@ -22,10 +22,9 @@ class sahara::service::engine (
$package_ensure = 'present', $package_ensure = 'present',
) { ) {
require ::sahara include ::sahara::params
Sahara_config<||> ~> Service['sahara-engine'] Sahara_config<||> ~> Service['sahara-engine']
Class['sahara::policy'] ~> Service['sahara-engine']
package { 'sahara-engine': package { 'sahara-engine':
ensure => $package_ensure, ensure => $package_ensure,

View File

@ -2,12 +2,6 @@ require 'spec_helper'
describe 'sahara::service::all' do 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 context 'on Debian platforms' do
let :facts do let :facts do
@default_facts.merge({ @default_facts.merge({
@ -16,8 +10,6 @@ describe 'sahara::service::all' do
}) })
end end
it_configures 'sahara-all'
it_behaves_like 'generic sahara service', { it_behaves_like 'generic sahara service', {
:name => 'sahara-all', :name => 'sahara-all',
:package_name => 'sahara', :package_name => 'sahara',
@ -29,8 +21,6 @@ describe 'sahara::service::all' do
@default_facts.merge({ :osfamily => 'RedHat' }) @default_facts.merge({ :osfamily => 'RedHat' })
end end
it_configures 'sahara-all'
it_behaves_like 'generic sahara service', { it_behaves_like 'generic sahara service', {
:name => 'sahara-all', :name => 'sahara-all',
:package_name => 'openstack-sahara', :package_name => 'openstack-sahara',

View File

@ -4,10 +4,6 @@ describe 'sahara::service::api' do
shared_examples_for 'sahara-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 context 'default params' do
it { is_expected.to contain_sahara_config('DEFAULT/api_workers').with_value('<SERVICE DEFAULT>') } it { is_expected.to contain_sahara_config('DEFAULT/api_workers').with_value('<SERVICE DEFAULT>') }
end end

View File

@ -2,19 +2,11 @@ require 'spec_helper'
describe 'sahara::service::engine' do 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 context 'on Debian platforms' do
let :facts do let :facts do
@default_facts.merge({ :osfamily => 'Debian' }) @default_facts.merge({ :osfamily => 'Debian' })
end end
it_configures 'sahara-engine'
it_behaves_like 'generic sahara service', { it_behaves_like 'generic sahara service', {
:name => 'sahara-engine', :name => 'sahara-engine',
:package_name => 'sahara-engine', :package_name => 'sahara-engine',
@ -26,8 +18,6 @@ describe 'sahara::service::engine' do
@default_facts.merge({ :osfamily => 'RedHat' }) @default_facts.merge({ :osfamily => 'RedHat' })
end end
it_configures 'sahara-engine'
it_behaves_like 'generic sahara service', { it_behaves_like 'generic sahara service', {
:name => 'sahara-engine', :name => 'sahara-engine',
:package_name => 'openstack-sahara-engine', :package_name => 'openstack-sahara-engine',

View File

@ -11,7 +11,7 @@ shared_examples 'generic sahara service' do |service|
is_expected.to contain_package(service[:name]).with({ is_expected.to contain_package(service[:name]).with({
:name => service[:package_name], :name => service[:package_name],
:ensure => 'present', :ensure => 'present',
:notify => ["Service[#{service[:name]}]", 'Exec[sahara-dbmanage]'] :notify => "Service[#{service[:name]}]"
}) })
is_expected.to contain_service(service[:name]).with({ is_expected.to contain_service(service[:name]).with({
:name => service[:service_name], :name => service[:service_name],
@ -32,7 +32,7 @@ shared_examples 'generic sahara service' do |service|
is_expected.to contain_package(service[:name]).with({ is_expected.to contain_package(service[:name]).with({
:name => service[:package_name], :name => service[:package_name],
:ensure => '2014.2-1', :ensure => '2014.2-1',
:notify => ["Service[#{service[:name]}]", 'Exec[sahara-dbmanage]'] :notify => "Service[#{service[:name]}]"
}) })
is_expected.to contain_service(service[:name]).with({ is_expected.to contain_service(service[:name]).with({
:name => service[:service_name], :name => service[:service_name],