AttributeError: 'function' object has no attribute 'get'

Bug #1619439 reported by Turbo Fredriksson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate
New
Undecided
Unassigned
OpenStack Heat
New
Undecided
Unassigned

Bug Description

Trying to create a heat stack like this:

----- s n i p -----
heat_template_version: 2015-04-30
description: Designate domain record template - test

resources:
  record:
    type: OS::Designate::Record
    properties:
      description: test record
      name: test.domain.top.
      domain: domain.top.
      data: 10.0.0.1
      type: A
----- s n i p -----

with:

----- s n i p -----
# heat stack-create -f test-dns.yaml test-dns
ERROR: Property error: : resources.record.properties.domain: : unknown
----- s n i p -----

gives me this in designate-api.log:

----- s n i p -----
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware [req-da9c24c4-e53e-4154-a7a4-a76192a5f5c6 4b0e25c70d2b4ad6ba4c50250f2f0b0b 04ee0e71babe4fd7aa16c3f64a8fca89 - - -] 'function' object has no attribute 'get'
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware Traceback (most recent call last):
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/designate/api/middleware.py", line 243, in __call__
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware return request.get_response(self.application)
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1299, in send
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware application, catch_exc_info=False)
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1263, in call_application
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware app_iter = application(self.environ, start_response)
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware resp = self.call_func(req, *args, **self.kwargs)
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware return self.func(req, *args, **kwargs)
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/designate/api/middleware.py", line 231, in __call__
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware return request.get_response(self.application)
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1299, in send
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware application, catch_exc_info=False)
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1263, in call_application
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware app_iter = application(self.environ, start_response)
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/flask/app.py", line 2000, in __call__
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware return self.wsgi_app(environ, start_response)
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1991, in wsgi_app
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware response = self.make_response(self.handle_exception(e))
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1559, in handle_exception
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware handler = self._find_error_handler(InternalServerError())
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1476, in _find_error_handler
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware .get(code))
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1465, in find_handler
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware handler = handler_map.get(cls)
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware AttributeError: 'function' object has no attribute 'get'
2016-09-01 20:05:21.328 5850 ERROR designate.api.middleware
2016-09-01 20:05:21.334 5850 INFO eventlet.wsgi [req-da9c24c4-e53e-4154-a7a4-a76192a5f5c6 4b0e25c70d2b4ad6ba4c50250f2f0b0b 04ee0e71babe4fd7aa16c3f64a8fca89 - - -] 10.0.4.1 - - [01/Sep/2016 20:05:21] "GET /v1/domains/domain.top. HTTP/1.1" 500 307 0.287642
----- s n i p -----

That URL gave a 500 error, which is strange since:

----- s n i p -----
# designate domain-list
+--------------------------------------+-----------------------+------------+
| id | name | serial |
+--------------------------------------+-----------------------+------------+
| 16bdefc0-8607-467d-841c-570217b6eedd | domain.tld. | 1471689793 |
| e437e2df-22f8-4c13-9d40-1e1499a17db3 | openstack.domain.tld. | 1472033419 |
| d8c10490-b723-4489-a9d6-66ef9916f088 | domain.top. | 1472033604 |
+--------------------------------------+-----------------------+------------+
# designate record-list bayour.net.
+--------------------------------------+------+---------------------+-------------------------------------------------------------------------------+
| id | type | name | data |
+--------------------------------------+------+---------------------+-------------------------------------------------------------------------------+
| e1c939c7-f922-4eb3-b4da-778bca2b7bd5 | SOA | domain.top. | ns1.openstack.domain.tld. dnsadmin.domain.tld. 1472033604 3596 600 86400 3600 |
| 14fce707-fed5-4ed6-a9d7-a30723e99a52 | NS | domain.top. | ns1.openstack.domain.tld. |
| ab3de9fd-89fe-4f81-8eea-7e4cda48fd15 | NS | ns1.domain.top. | ns1.domain.top. |
| 36b80246-72ee-4f13-aa52-5b2c7a3d1dbc | A | ns1.domain.top. | 10.0.4.1 |
| 598a9096-cbed-4053-9346-23db046fe568 | A | domain.top. | 10.0.4.1 |
| 32e129cb-c09e-4de1-aeb3-09944f4870c3 | A | gw.domain.top. | 10.0.4.254 |
| 6344132b-305e-4aaf-9006-5c032c36ca4c | A | router.domain.top. | 10.0.4.253 |
| dac61f02-5c35-428a-9c2f-e6d83ff2291b | A | astrix.domain.top. | 10.0.5.45 |
| 441041bd-093b-455a-be7a-257679a6f161 | A | smtp.domain.top. | 10.0.5.46 |
| ab02a064-66b0-42b1-b7e1-b7040bbc4d86 | A | live.domain.top. | 10.0.5.47 |
| 2b1e946d-e4e2-4c3e-a0e3-30073425bc54 | A | monitor.domain.top. | 10.0.5.48 |
| 830d4f41-d52a-4de2-a1e6-6e61313af6a5 | A | www.domain.top. | 10.0.5.49 |
| 58ff2582-b6d8-498e-b31c-283fc8b5c668 | A | jenkins.domain.top. | 10.0.5.50 |
+--------------------------------------+------+---------------------+-------------------------------------------------------------------------------+
----- s n i p -----

Creating a record from the shell works just fine:

----- s n i p -----
# designate record-create --name test.domain.top. --data 10.0.0.1 --type A domain.top.
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| description | None |
| type | A |
| created_at | 2016-09-01T19:19:36.000000 |
| updated_at | None |
| domain_id | d8c10490-b723-4489-a9d6-66ef9916f088 |
| priority | None |
| ttl | None |
| data | 10.0.0.1 |
| id | 240b3803-3371-4b93-ac7e-5c82fa3ba9aa |
| name | test.domain.top. |
+-------------+--------------------------------------+
----- s n i p -----

Tags: designate
Revision history for this message
Turbo Fredriksson (turbo-bayour) wrote :

If I use the heat-templates/hot/designate/desginate_record.yaml template, then it works.

This is Designate v1:2.0.0-3 and Heat v1:6.0.0-2 on Debian GNU/Linux Sid.

Revision history for this message
Thomas Herve (therve) wrote :

There is a 500 in designate, so there is at least a bug in there.

Revision history for this message
Turbo Fredriksson (turbo-bayour) wrote :

I'm pretty sure this worked a week or so ago. I DID upgrade my system last week, but I can't remember what upgraded :(. However, looking at my backup (which unfortunately is at least a month old), Heat was still at v1:6.0.0-2 and Designate was at v1:2.0.0-2.

Comparing the differences between the two Designate version, this is the only one:

----- s n i p -----
--- /tmp/designate/usr/lib/python2.7/dist-packages/designate/api/__init__.py 2016-05-20 15:44:00.000000000 +0100
+++ /usr/lib/python2.7/dist-packages/designate/api/__init__.py 2016-07-26 16:27:25.000000000 +0100
@@ -38,7 +38,7 @@
                help='The strategy to use for auth. Supports noauth or '
                     'keystone'),
     cfg.BoolOpt('enable-api-v1', default=True),
- cfg.BoolOpt('enable-api-v2', default=False),
+ cfg.BoolOpt('enable-api-v2', default=True),
     cfg.BoolOpt('enable-api-admin', default=False),
     cfg.IntOpt('max_header_line', default=16384,
                help="Maximum line size of message headers to be accepted. "
----- s n i p -----

Revision history for this message
Turbo Fredriksson (turbo-bayour) wrote :

I can confirm that this is a duplicate of #1587849. The solution presented worked and solved my problem.

Should this issue be closed or left open until the other bug is closed?

Revision history for this message
Thomas Herve (therve) wrote :

This is effectively closed as a duplicate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.