[BUG] Dashboard报错:if usages['subnets']['available'] <= 0: KeyError: 'available'
2016-04-12 11:10
609 查看
Openstack版本:Liberty
系统平台:CentOS 7.2 64bit
###############################################################
1.现象:
管理员登陆Dasgboard,查看项目》网络》网络》选择一个网络》选择一个子网》查看网络ID,如下:
![](http://img.blog.csdn.net/20160412103734132)
查看httpd日志报错如下:
2.问题解决:
修改/usr/share/openstack-dashboard/openstack_dashboard/dashboards/project/networks/subnets/tables.py源代码如下:
系统平台:CentOS 7.2 64bit
###############################################################
1.现象:
管理员登陆Dasgboard,查看项目》网络》网络》选择一个网络》选择一个子网》查看网络ID,如下:
查看httpd日志报错如下:
tail -f /etc/httpd/logs/error_log [Tue Apr 12 10:24:08.830778 2016] [:error] [pid 94866] Error while checking action permissions. [Tue Apr 12 10:24:08.830848 2016] [:error] [pid 94866] Traceback (most recent call last): [Tue Apr 12 10:24:08.830854 2016] [:error] [pid 94866] File "/usr/lib/python2.7/site-packages/horizon/tables/base.py", line 1270, in _filter_action [Tue Apr 12 10:24:08.830859 2016] [:error] [pid 94866] return action._allowed(request, datum) and row_matched [Tue Apr 12 10:24:08.830862 2016] [:error] [pid 94866] File "/usr/lib/python2.7/site-packages/horizon/tables/actions.py", line 135, in _allowed [Tue Apr 12 10:24:08.830866 2016] [:error] [pid 94866] self.allowed(request, datum)) [Tue Apr 12 10:24:08.830873 2016] [:error] [pid 94866] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/networks/subnets/tables.py", line 103, in allowed [Tue Apr 12 10:24:08.830883 2016] [:error] [pid 94866] if usages['subnets']['available'] <= 0: [Tue Apr 12 10:24:08.830899 2016] [:error] [pid 94866] KeyError: 'available'################################################################
2.问题解决:
修改/usr/share/openstack-dashboard/openstack_dashboard/dashboards/project/networks/subnets/tables.py源代码如下:
class CreateSubnet(SubnetPolicyTargetMixin, CheckNetworkEditable, tables.LinkAction): name = "create" verbose_name = _("Create Subnet") url = "horizon:project:networks:addsubnet" classes = ("ajax-modal",) icon = "plus" policy_rules = (("network", "create_subnet"),) def get_link_url(self, datum=None): network_id = self.table.kwargs['network_id'] return reverse(self.url, args=(network_id,)) def allowed(self, request, datum=None): usages = quotas.tenant_quota_usages(request) if usages['subnets'].get('available', 1) <= 0: if 'disabled' not in self.classes: self.classes = [c for c in self.classes] + ['disabled'] self.verbose_name = _('Create Subnet (Quota exceeded)') else: self.verbose_name = _('Create Subnet') self.classes = [c for c in self.classes if c != 'disabled'] return True
相关文章推荐
- RAID Levels: RAID 0,RAID1,RAID 10,RAID 5,RAID 6(Complete Tutorial)
- Mongodb中的repairDatabase()
- 你所不知道的TIME_WAIT和CLOSE_WAIT
- 欢迎访问我的个人博客:www.aidandai.com
- 2016年全球人工智能技术大会的“根”(Root)源自何处?
- Sorting Railway Cars
- static 修饰方法
- 在Silverlight中使用async/await
- POJ 1995 Raising Modulo Numbers
- 用Foxmail for Mac客户端登录网易163邮箱
- LINQ的Contains方法
- LeetCode 70. Climbing Stairs
- 转载时请表明原文出处(http://blog.sina.com.cn/wyw1976)及作者邮箱(wyw1976@gmail.com) Linux 系统中有关mtd和u
- Visual Voicemail
- 小Ai成功预测我是歌手依靠的是什么
- A Head Start on Domain-Driven Design Patterns
- Communicating With Users and Developers - Mailing
- 发运确认后,订单行保持“已挑库”状态 Order Line Remains in Picked (Awaiting Shipping) Status After Ship Confirmation
- 【AC自动机/fail树】BZOJ3172- [Tjoi2013]单词
- Apache James配置个人笔记(完整解决DNS问题), 网页版的参考 Claros In Touch webmail(Pop3/IMAP)