[BUG] Dashboard error: If usages[' subnets ' [' available '] <= 0:keyerror: ' Available '

Source: Internet
Author: User

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 '] &lt;= 0:keyerror: ' Available '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.