organization.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:AerisCloud 作者: AerisCloud 项目源码 文件源码
def remove(organization_name):
    """
    Remove organizations.
    """
    if not organization_name.isalnum():
        fatal("Your organization name should only contains alphanumeric "
              "characters.")

    dest_path = get_env_path(organization_name)
    if not os.path.exists(dest_path):
        fatal("The %s organization doesn't exist." % organization_name)

    if not click.confirm("Do you want to delete the %s organization?" %
                         organization_name,
                         default=False):
        info("Aborted. Nothing has been done.")
        return

    if os.path.isdir(dest_path) and not os.path.islink(dest_path):
        shutil.rmtree(dest_path)
    else:
        os.remove(dest_path)
    success("The %s organization has been removed." % organization_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号