From 5f2875f2453362e5156269de2a67ff256522488c Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 8 Dec 2019 23:25:42 +0100 Subject: [PATCH] Convert all class usage to relative names Change-Id: Ie5227ac581af00f445f71b2aaa05e6d1d8363324 --- examples/init.pp | 2 +- manifests/api.pp | 12 ++++++------ manifests/applier.pp | 4 ++-- manifests/client.pp | 4 ++-- manifests/config.pp | 2 +- manifests/db.pp | 2 +- manifests/db/create_schema.pp | 2 +- manifests/db/mysql.pp | 2 +- manifests/db/postgresql.pp | 2 +- manifests/db/upgrade.pp | 2 +- manifests/decision_engine.pp | 4 ++-- manifests/init.pp | 10 +++++----- manifests/keystone/auth.pp | 2 +- manifests/keystone/authtoken.pp | 2 +- manifests/logging.pp | 2 +- manifests/params.pp | 2 +- manifests/policy.pp | 4 ++-- manifests/wsgi/apache.pp | 10 +++++----- spec/acceptance/watcher_wsgi_apache_spec.rb | 12 ++++++------ spec/classes/watcher_api_spec.rb | 12 ++++++------ 20 files changed, 47 insertions(+), 47 deletions(-) diff --git a/examples/init.pp b/examples/init.pp index 206928c..85bc8f5 100644 --- a/examples/init.pp +++ b/examples/init.pp @@ -9,4 +9,4 @@ # Learn more about module testing here: # https://puppet.com/docs/puppet/latest/bgtm.html#testing-your-module # -include ::watcher +include watcher diff --git a/manifests/api.pp b/manifests/api.pp index 4bf44cf..03d5a59 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -169,11 +169,11 @@ class watcher::api ( $auth_strategy = 'keystone', ) inherits watcher::params { - include ::watcher::policy - include ::watcher::deps + include watcher::policy + include watcher::deps if $auth_strategy == 'keystone' { - include ::watcher::keystone::authtoken + include watcher::keystone::authtoken } validate_legacy(String, 'validate_string', $watcher_client_password) @@ -193,11 +193,11 @@ class watcher::api ( } if $create_db_schema { - include ::watcher::db::create_schema + include watcher::db::create_schema } if $upgrade_db { - include ::watcher::db::upgrade + include watcher::db::upgrade } if $service_name == $::watcher::params::api_service_name { @@ -213,7 +213,7 @@ class watcher::api ( 'watcher-db-manage-upgrade'], } } elsif $service_name == 'httpd' { - include ::apache::params + include apache::params service { 'watcher-api': ensure => 'stopped', name => $::watcher::params::api_service_name, diff --git a/manifests/applier.pp b/manifests/applier.pp index 911cdcc..567767d 100644 --- a/manifests/applier.pp +++ b/manifests/applier.pp @@ -47,8 +47,8 @@ class watcher::applier ( $applier_workflow_engine = $::os_service_default, ) { - include ::watcher::params - include ::watcher::deps + include watcher::params + include watcher::deps package { 'watcher-applier': ensure => $package_ensure, diff --git a/manifests/client.pp b/manifests/client.pp index c58b134..a2c123e 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -12,8 +12,8 @@ class watcher::client ( $ensure = 'present' ) { - include ::watcher::deps - include ::watcher::params + include watcher::deps + include watcher::params package { 'python-watcherclient': ensure => $ensure, diff --git a/manifests/config.pp b/manifests/config.pp index e199cca..3c710c3 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -24,7 +24,7 @@ class watcher::config ( $watcher_config = {}, ) { - include ::watcher::deps + include watcher::deps validate_legacy(Hash, 'validate_hash', $watcher_config) diff --git a/manifests/db.pp b/manifests/db.pp index 9c34ef1..ffd8662 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -62,7 +62,7 @@ class watcher::db ( $database_idle_timeout = undef, ) { - include ::watcher::deps + include watcher::deps if $database_idle_timeout { warning('The database_idle_timeout parameter is deprecated. Please use \ diff --git a/manifests/db/create_schema.pp b/manifests/db/create_schema.pp index 738f42a..4537493 100644 --- a/manifests/db/create_schema.pp +++ b/manifests/db/create_schema.pp @@ -12,7 +12,7 @@ class watcher::db::create_schema( $extra_params = '--config-file /etc/watcher/watcher.conf', ) { - include ::watcher::deps + include watcher::deps exec { 'watcher-db-manage-create_schema': command => "watcher-db-manage ${extra_params} create_schema", diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index 39267d4..eaeb8bf 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -43,7 +43,7 @@ class watcher::db::mysql( $allowed_hosts = undef ) { - include ::watcher::deps + include watcher::deps validate_legacy(String, 'validate_string', $password) diff --git a/manifests/db/postgresql.pp b/manifests/db/postgresql.pp index 1cf964a..75d473e 100644 --- a/manifests/db/postgresql.pp +++ b/manifests/db/postgresql.pp @@ -32,7 +32,7 @@ class watcher::db::postgresql( $privileges = 'ALL', ) { - include ::watcher::deps + include watcher::deps ::openstacklib::db::postgresql { 'watcher': password_hash => postgresql_password($user, $password), diff --git a/manifests/db/upgrade.pp b/manifests/db/upgrade.pp index 9ebcc4a..a06b7ca 100644 --- a/manifests/db/upgrade.pp +++ b/manifests/db/upgrade.pp @@ -13,7 +13,7 @@ class watcher::db::upgrade( $extra_params = '--config-file /etc/watcher/watcher.conf', ) { - include ::watcher::deps + include watcher::deps exec { 'watcher-db-manage-upgrade': command => "watcher-db-manage ${extra_params} upgrade", diff --git a/manifests/decision_engine.pp b/manifests/decision_engine.pp index d0e28c0..30903e7 100644 --- a/manifests/decision_engine.pp +++ b/manifests/decision_engine.pp @@ -64,8 +64,8 @@ class watcher::decision_engine ( $weights = $::os_service_default, ) { - include ::watcher::params - include ::watcher::deps + include watcher::params + include watcher::deps if !is_service_default($weights) { validate_legacy(Hash, 'validate_hash', $weights) diff --git a/manifests/init.pp b/manifests/init.pp index 8be77b8..84f7c6d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -376,12 +376,12 @@ class watcher ( $zmq_target_expire = undef, ) { - include ::openstacklib::openstackclient + include openstacklib::openstackclient - include ::watcher::deps - include ::watcher::params - include ::watcher::policy - include ::watcher::db + include watcher::deps + include watcher::params + include watcher::policy + include watcher::db package { 'watcher': ensure => $package_ensure, diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index d49ce13..5c97857 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -79,7 +79,7 @@ class watcher::keystone::auth ( $internal_url = 'http://127.0.0.1:9322', ) { - include ::watcher::deps + include watcher::deps $real_service_name = pick($service_name, $auth_name) diff --git a/manifests/keystone/authtoken.pp b/manifests/keystone/authtoken.pp index c80d8b9..41ba266 100644 --- a/manifests/keystone/authtoken.pp +++ b/manifests/keystone/authtoken.pp @@ -205,7 +205,7 @@ class watcher::keystone::authtoken ( $service_token_roles_required = $::os_service_default, ) { - include ::watcher::deps + include watcher::deps if is_service_default($password) and ! $::watcher::api::watcher_client_password { fail('Please set password for watcher service user') diff --git a/manifests/logging.pp b/manifests/logging.pp index f42ab12..c841ada 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -123,7 +123,7 @@ class watcher::logging( $log_date_format = $::os_service_default, ) { - include ::watcher::deps + include watcher::deps oslo::log { 'watcher_config': use_stderr => $use_stderr, diff --git a/manifests/params.pp b/manifests/params.pp index 7bc7eba..768d2c0 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,7 +1,7 @@ # Parameters for puppet-watcher # class watcher::params { - include ::openstacklib::defaults + include openstacklib::defaults $pyvers = $::openstacklib::defaults::pyvers $pyver3 = $::openstacklib::defaults::pyver3 diff --git a/manifests/policy.pp b/manifests/policy.pp index d543950..ec1ee92 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -28,8 +28,8 @@ class watcher::policy ( $policy_path = '/etc/watcher/policy.json', ) { - include ::watcher::deps - include ::watcher::params + include watcher::deps + include watcher::params validate_legacy(Hash, 'validate_hash', $policies) diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 26604bb..f432893 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -119,12 +119,12 @@ class watcher::wsgi::apache ( $custom_wsgi_process_options = {}, ) { - include ::watcher::deps - include ::watcher::params - include ::apache - include ::apache::mod::wsgi + include watcher::deps + include watcher::params + include apache + include apache::mod::wsgi if $ssl { - include ::apache::mod::ssl + include apache::mod::ssl } ::openstacklib::wsgi::apache { 'watcher_wsgi': diff --git a/spec/acceptance/watcher_wsgi_apache_spec.rb b/spec/acceptance/watcher_wsgi_apache_spec.rb index 2a197f3..710a951 100644 --- a/spec/acceptance/watcher_wsgi_apache_spec.rb +++ b/spec/acceptance/watcher_wsgi_apache_spec.rb @@ -6,16 +6,16 @@ describe 'basic watcher' 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 + include openstack_integration::repos + include openstack_integration::rabbitmq + include openstack_integration::mysql + include openstack_integration::keystone # TODO(aschultz): fix after Ubuntu ocata-m3/rc1. watcher-db-manage is # broken if ($::osfamily == 'RedHat') { - include ::openstack_integration::watcher + include openstack_integration::watcher } EOS diff --git a/spec/classes/watcher_api_spec.rb b/spec/classes/watcher_api_spec.rb index fcbf2bf..6029073 100644 --- a/spec/classes/watcher_api_spec.rb +++ b/spec/classes/watcher_api_spec.rb @@ -145,10 +145,10 @@ describe 'watcher::api' do end let :pre_condition do - "include ::apache - include ::watcher::db + "include apache + include watcher::db class { 'watcher': } - class { '::watcher::keystone::authtoken': + class { 'watcher::keystone::authtoken': password => 'a_big_secret', }" end @@ -171,10 +171,10 @@ describe 'watcher::api' do end let :pre_condition do - "include ::apache - include ::watcher::db + "include apache + include watcher::db class { 'watcher': } - class { '::watcher::keystone::authtoken': + class { 'watcher::keystone::authtoken': password => 'a_big_secret', }" end