def _update_node_locations(self, oldpath, newpath):

        oldprefix = oldpath + '/'  # root node can not be renamed, anyway
        oldprefix_len = len(oldprefix)

        # Update alive and dead descendents.
        for cache in [self._node_manager.cache, self._node_manager.registry]:
            for nodepath in cache:
                if nodepath.startswith(oldprefix) and nodepath != oldprefix:
                    nodesuffix = nodepath[oldprefix_len:]
                    newnodepath = join_path(newpath, nodesuffix)
                    newnodeppath = split_path(newnodepath)[0]
                    descendent_node = self._get_node(nodepath)
                    descendent_node._g_update_location(newnodeppath)



# If a user hits ^C during a run, it is wise to gracefully close the
# opened files.
@hosts(iterable) should behave like @hosts(*iterable)
dataset/ETHPy150Open PyTables/PyTables/tables/file.py/File._update_node_locations--crossover with--dataset/ETHPy150Open fabric/fabric/tests/test_main.py/test_hosts_decorator_expands_single_iterable