OpenStack Version number: Liberty
System platform: CentOS 7.2 64bit
###############################################################
1. Phenomenon:
Administrator login Dasgboard, view project Network Network "Select a network" Select a subnet "To view the network ID, such as the following:
View httpd log errors such as the following:
Tail-f/etc/httpd/logs/error_log[tue APR 10:24:08.830778] [: ERROR] [PID 94866] Error while checking action permis Sions. [Tue APR 12 10:24:08.830848 2016] [: ERROR] [PID 94866] Traceback (most recent): [Tue Apr 10:24:08.830854] [: ERROR] [pid 94866] File "/usr/lib/python2.7/site-p ackages/horizon/tables/base.py ", line 1270, in _filter_action[tue APR 10:24:08.830859] [: ERROR] [PID 94866] Re Turn action._allowed (Request, Datum) and Row_matched[tue Apr 10:24:08.830862] [: ERROR] [pid 94866] File "/usr/li b/python2.7/site-packages/horizon/tables/actions.py ", line 135, in _allowed[tue Apr 10:24:08.830866] [: ERROR] [ PID 94866] self.allowed (Request, Datum)) [Tue Apr 10:24:08.830873] [: ERROR] [pid 94866] File "/usr/share/open stack-dashboard/openstack_dashboard/wsgi/. /.. /openstack_dashboard/dashboards/project/networks/subnets/tables.py ", line 103, Allowed[tue APR 12 10:24:08.830883 "[: ERROR] [pid 94866] if usages[' SubneTS ' [' available '] <= 0:[tue Apr 10:24:08.830899] [: ERROR] [pid 94866] keyerror: ' Available '
################################################################
2. Problem solving:
change/usr/share/openstack-dashboard/openstack_dashboard/dashboards/project/networks/subnets/tables.py source code such as the following :
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.class ES] + [' 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
[BUG] Dashboard error: If usages[' subnets ' [' available '] <= 0:keyerror: ' Available '