[stgt] [PATCH] Allow recursive includes in /etc/tgt/conf.d

Andy Grover agrover at redhat.com
Thu Aug 1 01:05:43 CEST 2013


From: Pádraig Brady <P at draigBrady.com>

Enable IncludeDirectories so that config files within conf.d can
include arbitrary config files (IncludeGlob is only supported for
a single level in perl's Config-general currently).

We ran into this because instead of adding the globbed include directive
to targets.conf, we added a higher-level .conf that then included
targets.conf as well as conf.d/*.conf.

Signed-off-by: Andy Grover <agrover at redhat.com>
---
 scripts/tgt-admin |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/tgt-admin b/scripts/tgt-admin
index cd34f95..d374172 100755
--- a/scripts/tgt-admin
+++ b/scripts/tgt-admin
@@ -162,7 +162,7 @@ sub parse_configs {
 		# Check if alternative configuration file exists
 		if (-e "$alternate_conf") {
 			execute("# Using $alternate_conf as configuration file\n");
-			%conf = ParseConfig(-ConfigFile => "$alternate_conf", -UseApacheInclude => 1, -IncludeGlob => 1, -MergeDuplicateBlocks => 1);
+			%conf = ParseConfig(-ConfigFile => "$alternate_conf", -UseApacheInclude => 1, -IncludeDirectories => 1, -IncludeGlob => 1, -MergeDuplicateBlocks => 1);
 		}
 		else {
 			die("Config file $alternate_conf not found. Exiting...\n");
@@ -170,7 +170,7 @@ sub parse_configs {
 	} else {
 		# Parse the config file with Config::General
 		if (-e "$configfile") {
-			%conf = ParseConfig(-ConfigFile => "$configfile", -UseApacheInclude => 1, -IncludeGlob => 1, -MergeDuplicateBlocks => 1);
+			%conf = ParseConfig(-ConfigFile => "$configfile", -UseApacheInclude => 1, -IncludeDirectories => 1, -IncludeGlob => 1, -MergeDuplicateBlocks => 1);
 		} else {
 			die("Config file $configfile not found. Exiting...\n");
 		}
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list