[stgt] [PATCH 3/3] tgt-admin: merge duplicate blocks in targets.conf

Andy Grover agrover at redhat.com
Thu Mar 10 01:51:03 CET 2011


See https://bugzilla.redhat.com/show_bug.cgi?id=681499

If there are duplicate blocks in targets.conf, this can cause issues.
These should be merged.

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 2c69e8b..2ffa8cf 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,);
+			%conf = ParseConfig(-ConfigFile => "$alternate_conf", -UseApacheInclude => 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,);
+			%conf = ParseConfig(-ConfigFile => "$configfile", -UseApacheInclude => 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