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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Pádraig Brady <P@xxxxxxxxxxxxxx>

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@xxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux