mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #39808 from carlpett/vault-lowercase-policies
Vault: Always lowercase policies
This commit is contained in:
commit
7460e460e1
@ -120,7 +120,10 @@ def _get_policies(minion_id, config):
|
||||
for pattern in policy_patterns:
|
||||
try:
|
||||
for expanded_pattern in _expand_pattern_lists(pattern, **mappings):
|
||||
policies.append(expanded_pattern.format(**mappings))
|
||||
policies.append(
|
||||
expanded_pattern.format(**mappings)
|
||||
.lower() # Vault requirement
|
||||
)
|
||||
except KeyError:
|
||||
log.warning('Could not resolve policy pattern {0}'.format(pattern))
|
||||
|
||||
|
@ -45,6 +45,7 @@ class VaultTest(TestCase):
|
||||
}
|
||||
}
|
||||
},
|
||||
'mixedcase': 'UP-low-UP',
|
||||
'dictlist': [
|
||||
{'foo': 'bar'},
|
||||
{'baz': 'qux'}
|
||||
@ -111,7 +112,10 @@ class VaultTest(TestCase):
|
||||
'deeply-nested-list:hello',
|
||||
'deeply-nested-list:world'
|
||||
],
|
||||
'should-not-cause-an-exception,but-result-empty:{foo}': []
|
||||
'should-not-cause-an-exception,but-result-empty:{foo}': [],
|
||||
'Case-Should-Be-Lowered:{grains[mixedcase]}': [
|
||||
'case-should-be-lowered:up-low-up'
|
||||
]
|
||||
}
|
||||
|
||||
with patch('salt.utils.minions.get_minion_data',
|
||||
|
Loading…
Reference in New Issue
Block a user