'Returns a node from the cache, retrieving the node from Ironic API
if the node doesn\'t yet exist in the cache.'

def _node_from_cache(self, nodename):

    cache_age = (time.time() - self.node_cache_time)
    if (nodename in self.node_cache):
        LOG.debug('Using    cache    for    node    %(node)s,    age:    %(age)s', {'node': nodename, 'age': cache_age})
        return self.node_cache[nodename]
    else:
        LOG.debug('Node    %(node)s    not    found    in    cache,    age:    %(age)s', {'node': nodename, 'age': cache_age})
        node = self._get_node(nodename)
        self.node_cache[nodename] = node
        return node
