Inherit pyvers from openstacklib::defaults

Change-Id: I483e300e898c37b2de7b48966a465dfa4570232d
This commit is contained in:
Tobias Urdin 2019-01-17 22:09:32 +01:00
parent 67e1d43e0f
commit 4eadce4d0e
3 changed files with 5 additions and 15 deletions

View File

@ -3,14 +3,8 @@
class watcher::params {
include ::openstacklib::defaults
if ($::os_package_type == 'debian') or ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
$pyvers = '3'
$pyver3 = '3.6'
} else {
$pyvers = ''
$pyver3 = '2.7'
}
$pyvers = $::openstacklib::defaults::pyvers
$pyver3 = $::openstacklib::defaults::pyver3
$client_package_name = "python${pyvers}-watcherclient"
$group = 'watcher'
@ -38,7 +32,7 @@ class watcher::params {
if ($::os_package_type == 'debian') {
$watcher_wsgi_script_source = '/usr/share/watcher-common/app.wsgi'
} else {
$watcher_wsgi_script_source = '/usr/lib/python2.7/dist-packages/watcher/api/app.wsgi'
$watcher_wsgi_script_source = "/usr/lib/python${pyver3}/dist-packages/watcher/api/app.wsgi"
}
$watcher_wsgi_script_path = '/usr/lib/cgi-bin/watcher'
}

View File

@ -27,11 +27,7 @@ describe 'watcher::client' do
let(:platform_params) do
case facts[:osfamily]
when 'Debian'
if facts[:os_package_type] == 'debian'
{ :client_package_name => 'python3-watcherclient' }
else
{ :client_package_name => 'python-watcherclient' }
end
{ :client_package_name => 'python3-watcherclient' }
when 'RedHat'
{ :client_package_name => 'python-watcherclient' }
end

View File

@ -92,7 +92,7 @@ describe 'watcher::wsgi::apache' do
when 'Debian'
{
:wsgi_script_path => '/usr/lib/cgi-bin/watcher',
:wsgi_script_source => '/usr/lib/python2.7/dist-packages/watcher/api/app.wsgi'
:wsgi_script_source => '/usr/lib/python3/dist-packages/watcher/api/app.wsgi'
}
when 'RedHat'
{