1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-21 22:04:19 +03:00
Peter Rajnoha 687bc5cecf lvmconfig: fix lvmconfig --type diff to display complete diff if config cascade used
If configuration consists of several sources in config cascade
("config cascade" defined in man lvmconfig(8)), lvmconfig displayed
only difference from defaults of the topmost config in the cascade.
Fix lvmconfig to display complete difference, considering all
the configuration in the cascade.

For example, before this patch:

	(use_lvmetad=0 set in lvm.conf which differs from defaults)
	$ lvmconfig --type diff
	global {
		use_lvmetad=0
	}

	(compact_output=1 set on cmd line)
	$ lvmconfig --type diff --config report/compact_output=1
	report {
		compact_output=1
	}

	(headings=0 set in profile)
	$ lvmconfig --type diff --commandprofile test
	report {
		headings=0
	}

	(difference in topmost configuration source is displayed)
	$ lvmconfig --type diff --commandprofile test --config report/compact_output=1
	report {
		compact_output=1
	}

With this patch applied (the config cascade is merged before looking for
difference from defaults in configuration):

	$ lvmconfig --type diff
	global {
		use_lvmetad=0
	}

	$ lvmconfig --type diff --config report/compact_output=1
	report {
		compact_output=1
	}
	global {
		use_lvmetad=0
	}

	$ lvmconfig --type diff --profile test
	report {
		headings=0
	}
	global {
		use_lvmetad=0
	}

	$ lvmconfig --type diff --profile test --config report/compact_output=1
	report {
		headings=0
		compact_output=1
	}
	global {
		use_lvmetad=0
	}
2016-06-02 13:49:38 +02:00
..
2016-05-19 18:40:14 +02:00
2016-01-21 12:11:37 +01:00
2016-02-23 21:40:16 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-05-27 15:47:24 +02:00
2016-05-27 15:47:24 +02:00
2016-01-21 12:11:37 +01:00
2016-05-25 15:05:49 -05:00
2016-05-25 15:05:49 -05:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-05-25 15:05:49 -05:00
2016-05-25 15:05:49 -05:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-02-25 12:00:53 -06:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-05-19 18:40:14 +02:00
2016-01-21 12:11:37 +01:00
2016-01-21 12:11:37 +01:00
2016-05-25 15:05:49 -05:00
2016-05-25 16:41:59 -05:00