def safe_mkdir(path, uid=-1, gid=-1):
    """ create path if it doesn't exist """
    try:
        os.mkdir(path)
    except __HOLE__, e:
        if e.errno == errno.EEXIST:
            pass
        else:
            raise
    else:
        os.chown(path, uid, gid)
dataset/ETHPy150Open ceph/ceph-deploy/ceph_deploy/hosts/remotes.py/safe_mkdir