diff --git a/designate/central/service.py b/designate/central/service.py index 22a3f3447..7dff863c7 100644 --- a/designate/central/service.py +++ b/designate/central/service.py @@ -379,7 +379,11 @@ class Service(service.RPCService, service.Service): Check to make sure that the records in the recordset follow the rules, and won't blow up on the nameserver. """ - if hasattr(recordset, 'records'): + try: + recordset.records + except (AttributeError, exceptions.RelationNotLoaded): + pass + else: if len(recordset.records) > 1 and recordset.type == 'CNAME': raise exceptions.BadRequest( 'CNAME recordsets may not have more than 1 record' diff --git a/designate/mdns/handler.py b/designate/mdns/handler.py index 41e6febfe..60e8324a8 100644 --- a/designate/mdns/handler.py +++ b/designate/mdns/handler.py @@ -113,7 +113,7 @@ class RequestHandler(xfr.XFRMixin): question = request.question[0] criterion = { - 'name': question.name.to_text(), + 'name': question.name.to_text().decode('utf-8'), 'type': 'SECONDARY', 'deleted': False } @@ -349,7 +349,7 @@ class RequestHandler(xfr.XFRMixin): # TODO(vinod) once validation is separated from the api, # validate the parameters criterion = { - 'name': q_rrset.name.to_text(), + 'name': q_rrset.name.to_text().decode('utf-8'), 'type': dns.rdatatype.to_text(q_rrset.rdtype), 'zones_deleted': False } diff --git a/designate/tests/test_mdns/test_handler.py b/designate/tests/test_mdns/test_handler.py index 6e7423379..23f9a1650 100644 --- a/designate/tests/test_mdns/test_handler.py +++ b/designate/tests/test_mdns/test_handler.py @@ -429,7 +429,7 @@ class MdnsRequestHandlerTest(MdnsTestCase): # ;AUTHORITY # ;ADDITIONAL - expected_response = "d2f5850000010001000000010474657874076578616d706c6503636f6d0000100001c00c0010000100000e10000b0a666f6f747874646174610000292000000000000000" # noqa + expected_response = b"d2f5850000010001000000010474657874076578616d706c6503636f6d0000100001c00c0010000100000e10000b0a666f6f747874646174610000292000000000000000" # noqa # This creates an TXT record for mail.example.com zone = self.create_zone() @@ -445,7 +445,7 @@ class MdnsRequestHandlerTest(MdnsTestCase): # query is for text.example.com. IN TXT payload = "d2f5012000010000000000010474657874076578616d706c6503636f6d00001000010000291000000000000000" # noqa - expected_response = "d2f5850000010001000000010474657874076578616d706c6503636f6d0000100001c00c0010000100000e10000d03666f6f0362617204626c61680000292000000000000000" # noqa + expected_response = b"d2f5850000010001000000010474657874076578616d706c6503636f6d0000100001c00c0010000100000e10000d03666f6f0362617204626c61680000292000000000000000" # noqa # expected_response is NOERROR. The other fields are # response: id 54005 # opcode QUERY diff --git a/tests-py3.txt b/tests-py3.txt index e0594abbd..03860130c 100644 --- a/tests-py3.txt +++ b/tests-py3.txt @@ -1,15 +1,8 @@ # Blacklist of tests failing on Python 3 -designate.tests.test_api.test_v1.test_records designate.tests.test_api.test_v2.test_floatingips -designate.tests.test_api.test_v2.test_recordsets designate.tests.test_api.test_v2.test_zones designate.tests.test_central.test_service -designate.tests.test_dnsutils -designate.tests.test_mdns.test_handler -designate.tests.test_notification_handler.test_neutron -designate.tests.test_notification_handler.test_nova designate.tests.test_pool_manager.test_service -designate.tests.test_storage.test_sqlalchemy designate.tests.unit.test_central.test_basic designate.tests.unit.test_pool designate.tests.unit.test_producer.test_tasks