Change ubuntu to py3
Change-Id: I3bc422abeb49fe068d6013333101366d0071ebab
This commit is contained in:
parent
6b21f1b4ce
commit
a0fccec778
|
@ -4,44 +4,30 @@
|
||||||
#
|
#
|
||||||
class gnocchi::params {
|
class gnocchi::params {
|
||||||
include ::openstacklib::defaults
|
include ::openstacklib::defaults
|
||||||
|
$pyvers = $::openstacklib::defaults::pyvers
|
||||||
|
|
||||||
if ($::os_package_type == 'debian') or ($::os['name'] == 'Fedora') or
|
$client_package_name = "python${pyvers}-gnocchiclient"
|
||||||
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
|
$rados_package_name = "python${pyvers}-rados"
|
||||||
$pyvers = '3'
|
$common_package_name = 'gnocchi-common'
|
||||||
} else {
|
$api_package_name = 'gnocchi-api'
|
||||||
$pyvers = ''
|
$api_service_name = 'gnocchi-api'
|
||||||
}
|
$metricd_package_name = 'gnocchi-metricd'
|
||||||
|
$metricd_service_name = 'gnocchi-metricd'
|
||||||
$client_package_name = "python${pyvers}-gnocchiclient"
|
$statsd_package_name = 'gnocchi-statsd'
|
||||||
$rados_package_name = "python${pyvers}-rados"
|
$statsd_service_name = 'gnocchi-statsd'
|
||||||
$common_package_name = 'gnocchi-common'
|
$group = 'gnocchi'
|
||||||
$api_service_name = 'gnocchi-api'
|
$gnocchi_wsgi_script_source = '/usr/bin/gnocchi-api'
|
||||||
$metricd_package_name = 'gnocchi-metricd'
|
|
||||||
$metricd_service_name = 'gnocchi-metricd'
|
|
||||||
$statsd_package_name = 'gnocchi-statsd'
|
|
||||||
$statsd_service_name = 'gnocchi-statsd'
|
|
||||||
$group = 'gnocchi'
|
|
||||||
|
|
||||||
case $::osfamily {
|
case $::osfamily {
|
||||||
'RedHat': {
|
'RedHat': {
|
||||||
$api_package_name = 'gnocchi-api'
|
|
||||||
$sqlite_package_name = undef
|
$sqlite_package_name = undef
|
||||||
$indexer_package_name = 'openstack-gnocchi-indexer-sqlalchemy'
|
$indexer_package_name = 'openstack-gnocchi-indexer-sqlalchemy'
|
||||||
$gnocchi_wsgi_script_path = '/var/www/cgi-bin/gnocchi'
|
$gnocchi_wsgi_script_path = '/var/www/cgi-bin/gnocchi'
|
||||||
$gnocchi_wsgi_script_source = '/usr/bin/gnocchi-api'
|
|
||||||
$pymysql_package_name = undef
|
$pymysql_package_name = undef
|
||||||
$cradox_package_name = "python${pyvers}-cradox"
|
$cradox_package_name = "python${pyvers}-cradox"
|
||||||
$redis_package_name = "python${pyvers}-redis"
|
$redis_package_name = "python${pyvers}-redis"
|
||||||
}
|
}
|
||||||
'Debian': {
|
'Debian': {
|
||||||
if $::os_package_type == 'debian' {
|
|
||||||
$api_package_name = 'gnocchi-api'
|
|
||||||
$gnocchi_wsgi_script_source = '/usr/bin/gnocchi-api'
|
|
||||||
} else {
|
|
||||||
$api_package_name = 'python-gnocchi'
|
|
||||||
$gnocchi_wsgi_script_source = '/usr/bin/python2-gnocchi-api'
|
|
||||||
}
|
|
||||||
|
|
||||||
$sqlite_package_name = 'python-pysqlite2'
|
$sqlite_package_name = 'python-pysqlite2'
|
||||||
$gnocchi_wsgi_script_path = '/usr/lib/cgi-bin/gnocchi'
|
$gnocchi_wsgi_script_path = '/usr/lib/cgi-bin/gnocchi'
|
||||||
$pymysql_package_name = "python${pyvers}-pymysql"
|
$pymysql_package_name = "python${pyvers}-pymysql"
|
||||||
|
|
|
@ -49,15 +49,6 @@ class gnocchi::storage(
|
||||||
name => $::gnocchi::params::redis_package_name,
|
name => $::gnocchi::params::redis_package_name,
|
||||||
tag => 'openstack',
|
tag => 'openstack',
|
||||||
})
|
})
|
||||||
|
|
||||||
# NOTE(tobias.urdin): Gnocchi components are packaged with py3 in Ubuntu
|
|
||||||
# from Queens.
|
|
||||||
if $::operatingsystem == 'Ubuntu' {
|
|
||||||
ensure_resource('package', 'python3-redis', {
|
|
||||||
name => 'python3-redis',
|
|
||||||
tag => 'openstack',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,16 +105,6 @@ class gnocchi::storage::ceph(
|
||||||
'name' => $::gnocchi::params::rados_package_name,
|
'name' => $::gnocchi::params::rados_package_name,
|
||||||
'tag' => ['openstack','gnocchi-package'],
|
'tag' => ['openstack','gnocchi-package'],
|
||||||
})
|
})
|
||||||
|
|
||||||
# NOTE(tobias.urdin): Gnocchi components are packaged with py3 in Ubuntu
|
|
||||||
# from Queens.
|
|
||||||
if $::operatingsystem == 'Ubuntu' {
|
|
||||||
ensure_packages('python3-rados', {
|
|
||||||
'ensure' => 'present',
|
|
||||||
'name' => 'python3-rados',
|
|
||||||
'tag' => ['openstack','gnocchi-package'],
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,11 +180,7 @@ describe 'gnocchi::api' do
|
||||||
let(:platform_params) do
|
let(:platform_params) do
|
||||||
case facts[:osfamily]
|
case facts[:osfamily]
|
||||||
when 'Debian'
|
when 'Debian'
|
||||||
if facts[:os_package_type] == 'debian' then
|
package_name = 'gnocchi-api'
|
||||||
package_name = 'gnocchi-api'
|
|
||||||
else
|
|
||||||
package_name = 'python-gnocchi'
|
|
||||||
end
|
|
||||||
when 'RedHat'
|
when 'RedHat'
|
||||||
package_name = 'gnocchi-api'
|
package_name = 'gnocchi-api'
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,19 +1,15 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'gnocchi::client' do
|
describe 'gnocchi::client' do
|
||||||
|
shared_examples 'gnocchi::client' do
|
||||||
shared_examples_for 'gnocchi client' do
|
|
||||||
|
|
||||||
it { is_expected.to contain_class('gnocchi::deps') }
|
it { is_expected.to contain_class('gnocchi::deps') }
|
||||||
it { is_expected.to contain_class('gnocchi::params') }
|
it { is_expected.to contain_class('gnocchi::params') }
|
||||||
|
|
||||||
it 'installs gnocchi client package' do
|
it { should contain_package('python-gnocchiclient').with(
|
||||||
is_expected.to contain_package('python-gnocchiclient').with(
|
:ensure => 'present',
|
||||||
:ensure => 'present',
|
:name => platform_params[:client_package_name],
|
||||||
:name => platform_params[:client_package_name],
|
:tag => 'openstack',
|
||||||
:tag => 'openstack',
|
)}
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
|
@ -27,18 +23,13 @@ describe 'gnocchi::client' do
|
||||||
let(:platform_params) do
|
let(:platform_params) do
|
||||||
case facts[:osfamily]
|
case facts[:osfamily]
|
||||||
when 'Debian'
|
when 'Debian'
|
||||||
if facts[:os_package_type] == 'debian'
|
{ :client_package_name => 'python3-gnocchiclient' }
|
||||||
{ :client_package_name => 'python3-gnocchiclient' }
|
|
||||||
else
|
|
||||||
{ :client_package_name => 'python-gnocchiclient' }
|
|
||||||
end
|
|
||||||
when 'RedHat'
|
when 'RedHat'
|
||||||
{ :client_package_name => 'python-gnocchiclient' }
|
{ :client_package_name => 'python-gnocchiclient' }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it_behaves_like 'gnocchi client'
|
it_behaves_like 'gnocchi::client'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -108,13 +108,8 @@ describe 'gnocchi::db' do
|
||||||
let(:platform_params) do
|
let(:platform_params) do
|
||||||
case facts[:osfamily]
|
case facts[:osfamily]
|
||||||
when 'Debian'
|
when 'Debian'
|
||||||
if facts[:os_package_type] == 'debian' then
|
|
||||||
pymysql_pkg = 'python3-pymysql'
|
|
||||||
else
|
|
||||||
pymysql_pkg = 'python-pymysql'
|
|
||||||
end
|
|
||||||
{
|
{
|
||||||
:pymysql_package_name => pymysql_pkg,
|
:pymysql_package_name => 'python3-pymysql',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -86,8 +86,6 @@ describe 'gnocchi::storage::ceph' do
|
||||||
|
|
||||||
it { is_expected.to contain_package('python-cradox').with(:ensure => 'present') }
|
it { is_expected.to contain_package('python-cradox').with(:ensure => 'present') }
|
||||||
it { is_expected.not_to contain_package('python-rados') }
|
it { is_expected.not_to contain_package('python-rados') }
|
||||||
it { is_expected.not_to contain_package('python3-rados') }
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -105,20 +103,6 @@ describe 'gnocchi::storage::ceph' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'gnocchi storage ceph ubuntu' do
|
|
||||||
context 'with manage_rados set to true installs python3-rados on Ubuntu' do
|
|
||||||
before do
|
|
||||||
params.merge!({
|
|
||||||
:manage_cradox => false,
|
|
||||||
:manage_rados => true,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
it { is_expected.to contain_package('python3-rados').with(:ensure => 'present') }
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
:supported_os => OSDefaults.get_supported_os
|
:supported_os => OSDefaults.get_supported_os
|
||||||
}).each do |os,facts|
|
}).each do |os,facts|
|
||||||
|
@ -134,10 +118,6 @@ describe 'gnocchi::storage::ceph' do
|
||||||
it_behaves_like 'gnocchi storage ceph cradox redhat'
|
it_behaves_like 'gnocchi storage ceph cradox redhat'
|
||||||
end
|
end
|
||||||
|
|
||||||
if facts[:operatingsystem] == 'Ubuntu' then
|
|
||||||
it_behaves_like 'gnocchi storage ceph ubuntu'
|
|
||||||
end
|
|
||||||
|
|
||||||
it_behaves_like 'gnocchi storage ceph'
|
it_behaves_like 'gnocchi storage ceph'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,7 +25,7 @@ describe 'gnocchi::storage' do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'installs python-redis package' do
|
it 'installs python-redis package' do
|
||||||
is_expected.to contain_package(platform_params[:redis_package_name]).with(
|
is_expected.to contain_package('python-redis').with(
|
||||||
:name => platform_params[:redis_package_name],
|
:name => platform_params[:redis_package_name],
|
||||||
:tag => 'openstack'
|
:tag => 'openstack'
|
||||||
)
|
)
|
||||||
|
@ -33,24 +33,6 @@ describe 'gnocchi::storage' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for 'gnocchi-storage ubuntu' do
|
|
||||||
context 'with coordination set on ubuntu' do
|
|
||||||
before do
|
|
||||||
params.merge!({
|
|
||||||
:coordination_url => 'redis://localhost:6379',
|
|
||||||
:metric_processing_delay => 30,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'installs python3-redis package' do
|
|
||||||
is_expected.to contain_package('python3-redis').with(
|
|
||||||
:name => 'python3-redis',
|
|
||||||
:tag => 'openstack'
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
:supported_os => OSDefaults.get_supported_os
|
:supported_os => OSDefaults.get_supported_os
|
||||||
}).each do |os,facts|
|
}).each do |os,facts|
|
||||||
|
@ -62,16 +44,12 @@ describe 'gnocchi::storage' do
|
||||||
let(:platform_params) do
|
let(:platform_params) do
|
||||||
case facts[:osfamily]
|
case facts[:osfamily]
|
||||||
when 'Debian'
|
when 'Debian'
|
||||||
{ :redis_package_name => 'python-redis' }
|
{ :redis_package_name => 'python3-redis' }
|
||||||
when 'RedHat'
|
when 'RedHat'
|
||||||
{ :redis_package_name => 'python-redis' }
|
{ :redis_package_name => 'python-redis' }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if facts[:operatingsystem] == 'Ubuntu' then
|
|
||||||
it_behaves_like 'gnocchi-storage ubuntu'
|
|
||||||
end
|
|
||||||
|
|
||||||
it_behaves_like 'gnocchi-storage'
|
it_behaves_like 'gnocchi-storage'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -92,16 +92,11 @@ describe 'gnocchi::wsgi::apache' do
|
||||||
let(:platform_params) do
|
let(:platform_params) do
|
||||||
case facts[:osfamily]
|
case facts[:osfamily]
|
||||||
when 'Debian'
|
when 'Debian'
|
||||||
if facts[:os_package_type] == 'debian' then
|
|
||||||
script_source = '/usr/bin/gnocchi-api'
|
|
||||||
else
|
|
||||||
script_source = '/usr/bin/python2-gnocchi-api'
|
|
||||||
end
|
|
||||||
{
|
{
|
||||||
:httpd_service_name => 'apache2',
|
:httpd_service_name => 'apache2',
|
||||||
:httpd_ports_file => '/etc/apache2/ports.conf',
|
:httpd_ports_file => '/etc/apache2/ports.conf',
|
||||||
:wsgi_script_path => '/usr/lib/cgi-bin/gnocchi',
|
:wsgi_script_path => '/usr/lib/cgi-bin/gnocchi',
|
||||||
:wsgi_script_source => script_source
|
:wsgi_script_source => '/usr/bin/gnocchi-api'
|
||||||
}
|
}
|
||||||
when 'RedHat'
|
when 'RedHat'
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue