Skip to content

Commit b166186

Browse files
author
Julien Pivotto
committed
Avoid relative classname inclusion
Including a class by a relative name might lead to unexpected results; in addition to that there is also a small performance penalty. Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
1 parent e885b54 commit b166186

15 files changed

+21
-21
lines changed

examples/apache.pp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
include apache
2-
include apache::mod::php
3-
include apache::mod::cgi
4-
include apache::mod::userdir
5-
include apache::mod::disk_cache
6-
include apache::mod::proxy_http
1+
include ::apache
2+
include ::apache::mod::php
3+
include ::apache::mod::cgi
4+
include ::apache::mod::userdir
5+
include ::apache::mod::disk_cache
6+
include ::apache::mod::proxy_http

examples/dev.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include apache::mod::dev
1+
include ::apache::mod::dev

examples/init.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include apache
1+
include ::apache

examples/mod_load_params.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Tests the path and identifier parameters for the apache::mod class
22

33
# Base class for clarity:
4-
class { 'apache': }
4+
class { '::apache': }
55

66

77
# Exaple parameter usage:

examples/mods.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Base class. Declares default vhost on port 80 and default ssl
44
# vhost on port 443 listening on all interfaces and serving
55
# $apache::docroot, and declaring our default set of modules.
6-
class { 'apache':
6+
class { '::apache':
77
default_mods => true,
88
}
99

examples/mods_custom.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Base class. Declares default vhost on port 80 and default ssl
44
# vhost on port 443 listening on all interfaces and serving
55
# $apache::docroot, and declaring a custom set of modules.
6-
class { 'apache':
6+
class { '::apache':
77
default_mods => [
88
'info',
99
'alias',

examples/php.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class { 'apache':
1+
class { '::apache':
22
mpm_module => 'prefork',
33
}
4-
include apache::mod::php
4+
include ::apache::mod::php

examples/vhost.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Base class. Declares default vhost on port 80 and default ssl
66
# vhost on port 443 listening on all interfaces and serving
77
# $apache::docroot
8-
class { 'apache': }
8+
class { '::apache': }
99

1010
# Most basic vhost
1111
apache::vhost { 'first.example.com':

examples/vhost_directories.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Base class. Declares default vhost on port 80 and default ssl
22
# vhost on port 443 listening on all interfaces and serving
33
# $apache::docroot
4-
class { 'apache': }
4+
class { '::apache': }
55

66
# Example from README adapted.
77
apache::vhost { 'readme.example.net':

examples/vhost_filter.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Base class. Declares default vhost on port 80 with filters.
2-
class { 'apache': }
2+
class { '::apache': }
33

44
# Example from README adapted.
55
apache::vhost { 'readme.example.net':

examples/vhost_ip_based.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Base class. Turn off the default vhosts; we will be declaring
55
# all vhosts below.
6-
class { 'apache':
6+
class { '::apache':
77
default_vhost => false,
88
}
99

examples/vhost_proxypass.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Base class. Declares default vhost on port 80 and default ssl
66
# vhost on port 443 listening on all interfaces and serving
77
# $apache::docroot
8-
class { 'apache': }
8+
class { '::apache': }
99

1010
# Most basic vhost with proxy_pass
1111
apache::vhost { 'first.example.com':

examples/vhost_ssl.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Base class. Turn off the default vhosts; we will be declaring
55
# all vhosts below.
6-
class { 'apache':
6+
class { '::apache':
77
default_vhost => false,
88
}
99

examples/vhosts_without_listen.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Base class. Turn off the default vhosts; we will be declaring
66
# all vhosts below.
7-
class { 'apache':
7+
class { '::apache':
88
default_vhost => false,
99
}
1010

manifests/fastcgi/server.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
$file_type = 'application/x-httpd-php',
88
$pass_header = undef,
99
) {
10-
include apache::mod::fastcgi
10+
include ::apache::mod::fastcgi
1111

1212
Apache::Mod['fastcgi'] -> Apache::Fastcgi::Server[$title]
1313

0 commit comments

Comments
 (0)