mirror of
https://github.com/xcat2/confluent.git
synced 2025-02-28 08:11:45 +00:00
Fix for crypted handling
Crypted attributes were not handled well, fix the mistakes.
This commit is contained in:
parent
16667ed41c
commit
dc2df09c4e
@ -1798,11 +1798,12 @@ class CryptedAttributes(Attributes):
|
||||
nkv = {}
|
||||
for key in kv:
|
||||
nkv[key] = {'isset': False}
|
||||
if 'hashvalue' in kv[key]:
|
||||
targkey = 'hashvalue'
|
||||
else:
|
||||
targkey = 'cryptvalue'
|
||||
try:
|
||||
if kv[key] is not None and kv[key]['cryptvalue'] != '':
|
||||
nkv[key] = {'isset': True}
|
||||
nkv[key]['inheritedfrom'] = kv[key]['inheritedfrom']
|
||||
elif kv[key] is not None and kv[key]['hashvalue'] != '':
|
||||
if kv[key] is not None and kv[key][targkey] != '':
|
||||
nkv[key] = {'isset': True}
|
||||
nkv[key]['inheritedfrom'] = kv[key]['inheritedfrom']
|
||||
except KeyError:
|
||||
|
@ -142,7 +142,7 @@ def retrieve_nodes(nodes, element, configmanager, inputdata):
|
||||
desc = ''
|
||||
if 'value' in currattr or 'expression' in currattr:
|
||||
yield msg.Attributes(node, {attribute: currattr}, desc)
|
||||
elif 'cryptvalue' in currattr:
|
||||
elif 'cryptvalue' in currattr or 'hashvalue' in currattr:
|
||||
yield msg.CryptedAttributes(
|
||||
node, {attribute: currattr}, desc)
|
||||
elif isinstance(currattr, list):
|
||||
|
Loading…
x
Reference in New Issue
Block a user