2013-11-02 22:24:04 +00:00
|
|
|
import confluent.messages as msg
|
|
|
|
|
2013-11-02 23:45:10 +00:00
|
|
|
def retrieve(nodes, element, configmanager, inputdata):
|
2013-11-02 22:24:04 +00:00
|
|
|
attributes = configmanager.get_node_attributes(nodes)
|
|
|
|
for node in attributes.iterkeys():
|
|
|
|
for attribute in attributes[node].iterkeys():
|
|
|
|
currattr = attributes[node][attribute]
|
|
|
|
if 'value' in currattr:
|
|
|
|
yield msg.Attributes(node,
|
|
|
|
{attribute: currattr['value']})
|
|
|
|
elif 'cryptvalue' in currattr:
|
|
|
|
yield msg.CryptedAttributes(node,
|
|
|
|
{attribute: currattr['cryptvalue']})
|
|
|
|
else:
|
|
|
|
print repr(currattr)
|
|
|
|
raise Exception("BUGGY ATTRIBUTE FOR NODE")
|
|
|
|
|
|
|
|
|