Switch nova to leverage os_package_type fact

This change switches the logic that handles which type of debian or
ubuntu packages based on the operatingsystem fact to leverage the
os_package_type fact so that we can leverage Debian packages on an
Ubuntu based system

Change-Id: I6d62804699978289c7e2293dba6d24b5b8b1b002
Depends-On: I0a009c0a60062d40c558c1f8de95386ce253f930
This commit is contained in:
Alex Schultz
2015-11-04 13:59:31 -06:00
parent 64a0f4e6bc
commit 3ef8f7f25c
3 changed files with 41 additions and 5 deletions

View File

@@ -99,8 +99,8 @@ class nova::params {
# debian specific nova config
$root_helper = 'sudo nova-rootwrap'
$lock_path = '/var/lock/nova'
case $::operatingsystem {
'Debian': {
case $::os_package_type {
'debian': {
$spicehtml5proxy_package_name = 'nova-consoleproxy'
$spicehtml5proxy_service_name = 'nova-spicehtml5proxy'
$vncproxy_package_name = 'nova-consoleproxy'

View File

@@ -47,7 +47,8 @@ describe 'nova::spicehtml5proxy' do
context 'on Ubuntu system' do
let :facts do
{ :osfamily => 'Debian',
:operatingsystem => 'Ubuntu' }
:operatingsystem => 'Ubuntu',
:os_package_type => 'ubuntu' }
end
let :platform_params do
@@ -61,7 +62,8 @@ describe 'nova::spicehtml5proxy' do
context 'on Debian system' do
let :facts do
{ :osfamily => 'Debian',
:operatingsystem => 'Debian' }
:operatingsystem => 'Debian',
:os_package_type => 'debian' }
end
let :platform_params do
@@ -72,6 +74,22 @@ describe 'nova::spicehtml5proxy' do
it_configures 'nova-spicehtml5proxy'
end
context 'on Ubuntu system with Debian packages' do
let :facts do
{ :osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
:os_package_type => 'debian' }
end
let :platform_params do
{ :spicehtml5proxy_package_name => 'nova-consoleproxy',
:spicehtml5proxy_service_name => 'nova-spicehtml5proxy' }
end
it_configures 'nova-spicehtml5proxy'
end
context 'on Redhat platforms' do
let :facts do
{ :osfamily => 'RedHat' }

View File

@@ -56,7 +56,9 @@ describe 'nova::vncproxy' do
describe 'on debian OS' do
let :facts do
{ :osfamily => 'Debian', :operatingsystem => 'Debian' }
{ :osfamily => 'Debian',
:operatingsystem => 'Debian',
:os_package_type => 'debian' }
end
it { is_expected.to contain_package('nova-vncproxy').with(
:name => "nova-consoleproxy",
@@ -69,6 +71,22 @@ describe 'nova::vncproxy' do
)}
end
describe 'on Ubuntu OS with Debian packages' do
let :facts do
{ :osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
:os_package_type => 'debian' }
end
it { is_expected.to contain_package('nova-vncproxy').with(
:name => "nova-consoleproxy",
:ensure => 'present'
)}
it { is_expected.to contain_service('nova-vncproxy').with(
:name => 'nova-novncproxy',
:hasstatus => true,
:ensure => 'running'
)}
end
describe 'on Redhatish platforms' do