'An os.makedirs() for iRODS collections.  `rods_path` is the desired collection to create.'

def __mkcolls(self, rods_path):

    assert rods_path.startswith((self.root_collection_path + '/')), ('__mkcolls():    Creating    collections    outside    the    root    collection    is    not    allowed    (requested    path    was:    %s)' % rods_path)
    mkcolls = []
    c = irods.irodsCollection(self.rods_conn, rods_path)
    while (c.getId() == (-1)):
        assert c.getCollName().startswith((self.root_collection_path + '/')), ('__mkcolls():    Attempted    to    move    above    the    root    collection:    %s' % c.getCollName())
        mkcolls.append(c.getCollName())
        c.upCollection()
    for collname in reversed(mkcolls):
        log.debug(('Creating    collection    %s' % collname))
        ci = irods.collInp_t()
        ci.collName = collname
        status = irods.rcCollCreate(self.rods_conn, ci)
        assert (status == 0), ('__mkcolls():    Failed    to    create    collection:    %s' % collname)
