db_models.py 文件源码

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

项目:ranger 作者: openstack 项目源码 文件源码
def remove_region(self, region_name):
        region_deleted_flag = False
        assert isinstance(region_name, basestring)
        try:
            LOG.debug("remove regions {0} from flavor {1}".format(region_name,
                                                                  str(self)))

            for region in reversed(self.flavor_regions):
                if region.region_name == region_name:
                    self.flavor_regions.remove(region)
                    region_deleted_flag = True

            if not region_deleted_flag:
                raise ErrorStatus(404,
                                  "Failed to remove region {0} from flavor id {1}".format(
                                      region_name, str(self.id)))

        except ErrorStatus as e:
            raise

        except Exception as exception:
            LOG.log_exception(
                "Failed to remove region {0} from flavor {1}".format(
                    region_name, str(self)), exception)
            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号