From d75de30b721e6e12fbf4a44a187a75f0d247e7a3 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 8 Dec 2019 15:06:48 +0100 Subject: [PATCH] Convert all class usage to relative names Change-Id: Ib0d2c8567775e0b5aa7a0799851b340cb50b784e --- examples/aodh.pp | 20 ++++++++++---------- manifests/api.pp | 12 ++++++------ manifests/auth.pp | 2 +- manifests/client.pp | 7 +++---- manifests/config.pp | 2 +- manifests/db.pp | 2 +- manifests/db/mysql.pp | 4 ++-- manifests/db/postgresql.pp | 4 ++-- manifests/db/sync.pp | 2 +- manifests/evaluator.pp | 4 ++-- manifests/init.pp | 4 ++-- manifests/keystone/auth.pp | 2 +- manifests/keystone/authtoken.pp | 2 +- manifests/listener.pp | 4 ++-- manifests/logging.pp | 2 +- manifests/notifier.pp | 4 ++-- manifests/params.pp | 2 +- manifests/policy.pp | 4 ++-- manifests/wsgi/apache.pp | 12 ++++++------ spec/acceptance/aodh_wsgi_apache_spec.rb | 12 ++++++------ spec/classes/aodh_api_spec.rb | 16 ++++++++-------- 21 files changed, 61 insertions(+), 62 deletions(-) diff --git a/examples/aodh.pp b/examples/aodh.pp index 1bb1ef7e..e3fae34f 100644 --- a/examples/aodh.pp +++ b/examples/aodh.pp @@ -1,19 +1,19 @@ -class { '::aodh': } -class { '::aodh::keystone::authtoken': +class { 'aodh': } +class { 'aodh::keystone::authtoken': password => 'a_big_secret', } -class { '::aodh::api': +class { 'aodh::api': enabled => true, service_name => 'httpd', } -include ::apache -class { '::aodh::wsgi::apache': +include apache +class { 'aodh::wsgi::apache': ssl => false, } -class { '::aodh::auth': +class { 'aodh::auth': auth_password => 'a_big_secret', } -class { '::aodh::evaluator': } -class { '::aodh::notifier': } -class { '::aodh::listener': } -class { '::aodh::client': } +class { 'aodh::evaluator': } +class { 'aodh::notifier': } +class { 'aodh::listener': } +class { 'aodh::client': } diff --git a/manifests/api.pp b/manifests/api.pp index f5cf5b8a..259b9f9f 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -62,12 +62,12 @@ class aodh::api ( ) inherits aodh::params { - include ::aodh::deps - include ::aodh::params - include ::aodh::policy + include aodh::deps + include aodh::params + include aodh::policy if $auth_strategy == 'keystone' { - include ::aodh::keystone::authtoken + include aodh::keystone::authtoken } package { 'aodh-api': @@ -85,7 +85,7 @@ class aodh::api ( } if $sync_db { - include ::aodh::db::sync + include aodh::db::sync } if $service_name == $::aodh::params::api_service_name { @@ -98,7 +98,7 @@ class aodh::api ( tag => 'aodh-service', } } elsif $service_name == 'httpd' { - include ::apache::params + include apache::params service { 'aodh-api': ensure => 'stopped', name => $::aodh::params::api_service_name, diff --git a/manifests/auth.pp b/manifests/auth.pp index cae2f0bd..9539d674 100644 --- a/manifests/auth.pp +++ b/manifests/auth.pp @@ -61,7 +61,7 @@ class aodh::auth ( $interface = $::os_service_default, ) { - include ::aodh::deps + include aodh::deps aodh_config { 'service_credentials/auth_url' : value => $auth_url; diff --git a/manifests/client.pp b/manifests/client.pp index 524b9b90..61901e48 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -10,8 +10,8 @@ class aodh::client ( $ensure = 'present' ) { - include ::aodh::deps - include ::aodh::params + include aodh::deps + include aodh::params package { 'python-aodhclient': ensure => $ensure, @@ -19,7 +19,6 @@ class aodh::client ( tag => 'openstack', } - include '::openstacklib::openstackclient' + include openstacklib::openstackclient } - diff --git a/manifests/config.pp b/manifests/config.pp index 51465d3a..6e6ed79b 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -28,7 +28,7 @@ class aodh::config ( $aodh_api_paste_ini = {}, ) { - include ::aodh::deps + include aodh::deps validate_legacy(Hash, 'validate_hash', $aodh_config) validate_legacy(Hash, 'validate_hash', $aodh_api_paste_ini) diff --git a/manifests/db.pp b/manifests/db.pp index 393d7462..40fd61b2 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -67,7 +67,7 @@ class aodh::db ( $database_idle_timeout = undef, ) { - include ::aodh::deps + include aodh::deps if $database_idle_timeout { warning('The database_idle_timeout parameter is deprecated. Please use \ diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index b2e9af09..947c5dce 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -43,11 +43,11 @@ class aodh::db::mysql( $allowed_hosts = undef ) { - include ::aodh::deps + include aodh::deps validate_legacy(String, 'validate_string', $password) - ::openstacklib::db::mysql { 'aodh': + openstacklib::db::mysql { 'aodh': user => $user, password_hash => mysql::password($password), dbname => $dbname, diff --git a/manifests/db/postgresql.pp b/manifests/db/postgresql.pp index 8ef80608..ffd763bf 100644 --- a/manifests/db/postgresql.pp +++ b/manifests/db/postgresql.pp @@ -32,9 +32,9 @@ class aodh::db::postgresql( $privileges = 'ALL', ) { - include ::aodh::deps + include aodh::deps - ::openstacklib::db::postgresql { 'aodh': + openstacklib::db::postgresql { 'aodh': password_hash => postgresql_password($user, $password), dbname => $dbname, user => $user, diff --git a/manifests/db/sync.pp b/manifests/db/sync.pp index 5a4b8329..7382bb53 100644 --- a/manifests/db/sync.pp +++ b/manifests/db/sync.pp @@ -9,7 +9,7 @@ class aodh::db::sync ( $user = 'aodh', ){ - include ::aodh::deps + include aodh::deps exec { 'aodh-db-sync': command => 'aodh-dbsync --config-file /etc/aodh/aodh.conf', diff --git a/manifests/evaluator.pp b/manifests/evaluator.pp index da632d15..809e6920 100644 --- a/manifests/evaluator.pp +++ b/manifests/evaluator.pp @@ -29,8 +29,8 @@ class aodh::evaluator ( $evaluation_interval = $::os_service_default, ) { - include ::aodh::deps - include ::aodh::params + include aodh::deps + include aodh::params aodh_config { 'DEFAULT/evaluation_interval' : value => $evaluation_interval; diff --git a/manifests/init.pp b/manifests/init.pp index 109cc096..21865313 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -271,8 +271,8 @@ class aodh ( $purge_config = false, ) inherits aodh::params { - include ::aodh::deps - include ::aodh::db + include aodh::deps + include aodh::db package { 'aodh': ensure => $package_ensure, diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index 25e9a077..95c3662d 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -79,7 +79,7 @@ class aodh::keystone::auth ( $admin_url = 'http://127.0.0.1:8042', ) { - include ::aodh::deps + include aodh::deps keystone::resource::service_identity { 'aodh': configure_user => $configure_user, diff --git a/manifests/keystone/authtoken.pp b/manifests/keystone/authtoken.pp index bebcab8a..1fe48195 100644 --- a/manifests/keystone/authtoken.pp +++ b/manifests/keystone/authtoken.pp @@ -214,7 +214,7 @@ class aodh::keystone::authtoken( $service_token_roles_required = $::os_service_default, ) { - include ::aodh::deps + include aodh::deps if is_service_default($password) { fail('Please set password for Aodh service user') diff --git a/manifests/listener.pp b/manifests/listener.pp index c78202c8..a5447368 100644 --- a/manifests/listener.pp +++ b/manifests/listener.pp @@ -19,8 +19,8 @@ class aodh::listener ( $package_ensure = 'present', ) { - include ::aodh::deps - include ::aodh::params + include aodh::deps + include aodh::params ensure_resource( 'package', [$::aodh::params::listener_package_name], { ensure => $package_ensure, diff --git a/manifests/logging.pp b/manifests/logging.pp index d787d83f..67748a11 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -120,7 +120,7 @@ class aodh::logging( $log_date_format = $::os_service_default, ) { - include ::aodh::deps + include aodh::deps oslo::log { 'aodh_config': debug => $debug, diff --git a/manifests/notifier.pp b/manifests/notifier.pp index 5c54db05..ebf6c6f5 100644 --- a/manifests/notifier.pp +++ b/manifests/notifier.pp @@ -19,8 +19,8 @@ class aodh::notifier ( $package_ensure = 'present', ) { - include ::aodh::deps - include ::aodh::params + include aodh::deps + include aodh::params ensure_resource( 'package', [$::aodh::params::notifier_package_name], { ensure => $package_ensure, diff --git a/manifests/params.pp b/manifests/params.pp index 5a7bf51d..a89231d2 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,7 +1,7 @@ # Parameters for puppet-aodh # class aodh::params { - include ::openstacklib::defaults + include openstacklib::defaults $pyvers = $::openstacklib::defaults::pyvers $client_package_name = "python${pyvers}-aodhclient" diff --git a/manifests/policy.pp b/manifests/policy.pp index 5537818f..413be530 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -28,8 +28,8 @@ class aodh::policy ( $policy_path = '/etc/aodh/policy.json', ) { - include ::aodh::deps - include ::aodh::params + include aodh::deps + include aodh::params validate_legacy(Hash, 'validate_hash', $policies) diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 7a25c0ba..36e32fe3 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -124,19 +124,19 @@ class aodh::wsgi::apache ( $custom_wsgi_process_options = {}, ) { - include ::aodh::deps - include ::aodh::params - include ::apache - include ::apache::mod::wsgi + include aodh::deps + include aodh::params + include apache + include apache::mod::wsgi if $ssl { - include ::apache::mod::ssl + include apache::mod::ssl } # NOTE(aschultz): needed because the packaging may introduce some apache # configuration files that apache may remove. See LP#1657847 Anchor['aodh::install::end'] -> Class['apache'] - ::openstacklib::wsgi::apache { 'aodh_wsgi': + openstacklib::wsgi::apache { 'aodh_wsgi': bind_host => $bind_host, bind_port => $port, group => 'aodh', diff --git a/spec/acceptance/aodh_wsgi_apache_spec.rb b/spec/acceptance/aodh_wsgi_apache_spec.rb index a879e966..f61d06e0 100644 --- a/spec/acceptance/aodh_wsgi_apache_spec.rb +++ b/spec/acceptance/aodh_wsgi_apache_spec.rb @@ -6,12 +6,12 @@ describe 'basic aodh' do it 'should work with no errors' do pp= <<-EOS - include ::openstack_integration - include ::openstack_integration::repos - include ::openstack_integration::rabbitmq - include ::openstack_integration::mysql - include ::openstack_integration::keystone - include ::openstack_integration::aodh + include openstack_integration + include openstack_integration::repos + include openstack_integration::rabbitmq + include openstack_integration::mysql + include openstack_integration::keystone + include openstack_integration::aodh EOS diff --git a/spec/classes/aodh_api_spec.rb b/spec/classes/aodh_api_spec.rb index 3504b73f..2cc74702 100644 --- a/spec/classes/aodh_api_spec.rb +++ b/spec/classes/aodh_api_spec.rb @@ -4,8 +4,8 @@ describe 'aodh::api' do let :pre_condition do "class { 'aodh': } - include ::aodh::db - class { '::aodh::keystone::authtoken': + include aodh::db + class { 'aodh::keystone::authtoken': password => 'a_big_secret', }" end @@ -129,10 +129,10 @@ describe 'aodh::api' do end let :pre_condition do - "include ::apache - include ::aodh::db + "include apache + include aodh::db class { 'aodh': } - class { '::aodh::keystone::authtoken': + class { 'aodh::keystone::authtoken': password => 'a_big_secret', }" end @@ -153,10 +153,10 @@ describe 'aodh::api' do end let :pre_condition do - "include ::apache - include ::aodh::db + "include apache + include aodh::db class { 'aodh': } - class { '::aodh::keystone::authtoken': + class { 'aodh::keystone::authtoken': password => 'a_big_secret', }" end