|
@@ -167,7 +167,7 @@ class BaseStorage(object):
|
|
|
|
|
|
return result
|
|
|
|
|
|
- def find_node(self, rawid):
|
|
|
+ def find_node(self, rawid, include_raw_data=False):
|
|
|
"""
|
|
|
Fetch node data by given id.
|
|
|
If necessary, look through node aliases.
|
|
@@ -175,10 +175,13 @@ class BaseStorage(object):
|
|
|
|
|
|
# look through all nodes
|
|
|
found = None
|
|
|
- for node in self.get_nodes():
|
|
|
+ nodes = self.get_all_nodes_raw()
|
|
|
+ for nodeid in nodes:
|
|
|
+ node = nodes[nodeid]
|
|
|
+
|
|
|
# if we have a direct hit, return it immediately
|
|
|
- if node['node_id'] == rawid:
|
|
|
- return sanitize_node(node)
|
|
|
+ if nodeid == rawid:
|
|
|
+ return sanitize_node(node, include_raw_data=include_raw_data)
|
|
|
|
|
|
# search through aliases
|
|
|
if 'aliases' in node and rawid in node['aliases']:
|
|
@@ -186,7 +189,7 @@ class BaseStorage(object):
|
|
|
|
|
|
# return found node
|
|
|
if not found is None:
|
|
|
- return sanitize_node(found)
|
|
|
+ return sanitize_node(found, include_raw_data=include_raw_data)
|
|
|
else:
|
|
|
return None
|
|
|
|