mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-03 12:44:22 -07:00
Fix issue when creating dconf key
This commit is contained in:
parent
840fbf8c27
commit
a7dd03ffc5
1 changed files with 8 additions and 1 deletions
|
@ -421,6 +421,13 @@ class DconfPreference(object):
|
|||
|
||||
:returns: bool -- True if a change was made, False if no change was required.
|
||||
"""
|
||||
def _create_dconf_key(root, sub_dir, key):
|
||||
# Root should end with '/'
|
||||
if sub_dir == "/":
|
||||
# No sub directory
|
||||
return "%s%s" % (root, key)
|
||||
return "%s%s/%s" % (root, sub_dir, key)
|
||||
|
||||
# Ensure key refers to a directory, as required by dconf
|
||||
root_dir = key
|
||||
if not root_dir.endswith('/'):
|
||||
|
@ -442,7 +449,7 @@ class DconfPreference(object):
|
|||
|
||||
# For each sub-directory, check if at least one change is needed
|
||||
changed = any(
|
||||
not self.variants_are_equal(self.read("%s%s/%s" % (root_dir, sub_dir, k)), v)
|
||||
not self.variants_are_equal(self.read(_create_dconf_key(root_dir, sub_dir, k)), v)
|
||||
for sub_dir in config.sections()
|
||||
for k, v in config[sub_dir].items()
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue