def ensure_tree(path):
    """Create a directory (and any ancestor directories required)

    :param path: Directory to create
    """
    try:
        os.makedirs(path)
    except __HOLE__ as exc:
        if exc.errno == errno.EEXIST:
            if not os.path.isdir(path):
                raise
        else:
            raise
dataset/ETHPy150Open openstack/solum/solum/openstack/common/fileutils.py/ensure_tree