)]}'
{"designate/central/service.py":[{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"ea3ad8ba1dad9b858faf42bb2f8c4bc554c323f6","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from designate.openstack.common import log as logging"},{"line_number":25,"context_line":"from designate.openstack.common import excutils"},{"line_number":26,"context_line":"from designate.openstack.common.gettextutils import _LI"},{"line_number":27,"context_line":"from designate.openstack.common.gettextutils import _LC"},{"line_number":28,"context_line":"from designate import backend"},{"line_number":29,"context_line":"from designate import central"},{"line_number":30,"context_line":"from designate import exceptions"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_10818aa0","line":27,"updated":"2014-08-11 10:42:40.000000000","message":"Looks like a merge issue - we should be using designate.i18n now.","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"a7a6ab03daf052c09600f7b220911b2467be1639","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from designate.openstack.common import log as logging"},{"line_number":25,"context_line":"from designate.openstack.common import excutils"},{"line_number":26,"context_line":"from designate.openstack.common.gettextutils import _LI"},{"line_number":27,"context_line":"from designate.openstack.common.gettextutils import _LC"},{"line_number":28,"context_line":"from designate import backend"},{"line_number":29,"context_line":"from designate import central"},{"line_number":30,"context_line":"from designate import exceptions"}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_09400b06","line":27,"in_reply_to":"baada198_10818aa0","updated":"2014-08-20 21:35:52.000000000","message":"Done","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"ea3ad8ba1dad9b858faf42bb2f8c4bc554c323f6","unresolved":false,"context_lines":[{"line_number":316,"context_line":"                \u0027records\u0027: recordlist"},{"line_number":317,"context_line":"            }"},{"line_number":318,"context_line":"            soa \u003d self.create_recordset(context, zone[\u0027id\u0027],"},{"line_number":319,"context_line":"                                        objects.RecordSet(**values))"},{"line_number":320,"context_line":"        return soa"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    def _update_soa(self, context, zone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_c236bde7","line":319,"updated":"2014-08-11 10:42:40.000000000","message":"I\u0027m not actually sure if this is an issue, just something that comes to mind.. \n\ncalling out to self.create_recordset (and similar methods elsewhere) will trigger a second nested transaction to be started - I don\u0027t think we currently do this anywhere else, and I\u0027m wondering how/if we handle the failure of either the outer or nested transactions..","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"a7a6ab03daf052c09600f7b220911b2467be1639","unresolved":false,"context_lines":[{"line_number":316,"context_line":"                \u0027records\u0027: recordlist"},{"line_number":317,"context_line":"            }"},{"line_number":318,"context_line":"            soa \u003d self.create_recordset(context, zone[\u0027id\u0027],"},{"line_number":319,"context_line":"                                        objects.RecordSet(**values))"},{"line_number":320,"context_line":"        return soa"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    def _update_soa(self, context, zone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_c98a931a","line":319,"in_reply_to":"baada198_c236bde7","updated":"2014-08-20 21:35:52.000000000","message":"Hmm. I thought I\u0027d seen other examples of this. I\u0027ll have to look.","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"ea3ad8ba1dad9b858faf42bb2f8c4bc554c323f6","unresolved":false,"context_lines":[{"line_number":324,"context_line":"        # Need elevated context to get the servers"},{"line_number":325,"context_line":"        elevated_context \u003d context.elevated()"},{"line_number":326,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":327,"context_line":"        servers \u003d self.find_servers(elevated_context)"},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"        soa \u003d self._find_or_create_soa(context, zone)"},{"line_number":330,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_a26c69d0","line":327,"updated":"2014-08-11 10:42:40.000000000","message":"The elevated context can be skipped by calling get_domain_servers() instead","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"a7a6ab03daf052c09600f7b220911b2467be1639","unresolved":false,"context_lines":[{"line_number":324,"context_line":"        # Need elevated context to get the servers"},{"line_number":325,"context_line":"        elevated_context \u003d context.elevated()"},{"line_number":326,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":327,"context_line":"        servers \u003d self.find_servers(elevated_context)"},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"        soa \u003d self._find_or_create_soa(context, zone)"},{"line_number":330,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_89017bb1","line":327,"in_reply_to":"baada198_a26c69d0","updated":"2014-08-20 21:35:52.000000000","message":"Done","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"ea3ad8ba1dad9b858faf42bb2f8c4bc554c323f6","unresolved":false,"context_lines":[{"line_number":332,"context_line":"        recordlist \u003d objects.RecordList(objects\u003d["},{"line_number":333,"context_line":"            objects.Record(data\u003dr) for r in new_values])"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"        soa.update({\u0027records\u0027: recordlist})"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"        self.update_recordset(context, soa, increment_serial\u003dFalse)"},{"line_number":338,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_0289956f","line":335,"updated":"2014-08-11 10:42:40.000000000","message":"Total nitpick (and then some!)\n\nThis would be cleaner:\n\n    soa.records \u003d recordlist\n\nSpecially, as it avoids the unnecessary creation of a dict, and the iteration etc within the update() method.","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"a7a6ab03daf052c09600f7b220911b2467be1639","unresolved":false,"context_lines":[{"line_number":332,"context_line":"        recordlist \u003d objects.RecordList(objects\u003d["},{"line_number":333,"context_line":"            objects.Record(data\u003dr) for r in new_values])"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"        soa.update({\u0027records\u0027: recordlist})"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"        self.update_recordset(context, soa, increment_serial\u003dFalse)"},{"line_number":338,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_69717f75","line":335,"in_reply_to":"baada198_0289956f","updated":"2014-08-20 21:35:52.000000000","message":"Done","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"ea3ad8ba1dad9b858faf42bb2f8c4bc554c323f6","unresolved":false,"context_lines":[{"line_number":343,"context_line":"        elevated_context \u003d context.elevated()"},{"line_number":344,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"        servers \u003d self.find_servers(elevated_context)"},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"        try:"},{"line_number":349,"context_line":"            ns \u003d self.find_recordset(context,"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_a2f1c901","line":346,"updated":"2014-08-11 10:42:40.000000000","message":"As above - get_domain_servers avoids the need for the elevated context","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"a7a6ab03daf052c09600f7b220911b2467be1639","unresolved":false,"context_lines":[{"line_number":343,"context_line":"        elevated_context \u003d context.elevated()"},{"line_number":344,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"        servers \u003d self.find_servers(elevated_context)"},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"        try:"},{"line_number":349,"context_line":"            ns \u003d self.find_recordset(context,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_896a5b7f","line":346,"in_reply_to":"baada198_a2f1c901","updated":"2014-08-20 21:35:52.000000000","message":"Done","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"ea3ad8ba1dad9b858faf42bb2f8c4bc554c323f6","unresolved":false,"context_lines":[{"line_number":373,"context_line":"        # Need elevated context to get the servers"},{"line_number":374,"context_line":"        elevated_context \u003d context.elevated()"},{"line_number":375,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":376,"context_line":"        servers \u003d self.find_servers(elevated_context)"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"        new_values \u003d []"},{"line_number":379,"context_line":"        for s in servers:"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_62d2515c","line":376,"updated":"2014-08-11 10:42:40.000000000","message":"As above - get_domain_servers avoids the need for the elevated context","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"a7a6ab03daf052c09600f7b220911b2467be1639","unresolved":false,"context_lines":[{"line_number":373,"context_line":"        # Need elevated context to get the servers"},{"line_number":374,"context_line":"        elevated_context \u003d context.elevated()"},{"line_number":375,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":376,"context_line":"        servers \u003d self.find_servers(elevated_context)"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"        new_values \u003d []"},{"line_number":379,"context_line":"        for s in servers:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_a96717b6","line":376,"in_reply_to":"baada198_62d2515c","updated":"2014-08-20 21:35:52.000000000","message":"Done","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"ea3ad8ba1dad9b858faf42bb2f8c4bc554c323f6","unresolved":false,"context_lines":[{"line_number":464,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":465,"context_line":"        zones \u003d self.find_domains(elevated_context)"},{"line_number":466,"context_line":"        for z in zones:"},{"line_number":467,"context_line":"            self._update_ns(elevated_context, z)"},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"        return created_server"},{"line_number":470,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_e244a11a","line":467,"updated":"2014-08-11 10:42:40.000000000","message":"TODO for after my SQLA Core switch lands - we can make this 1000x more efficient with a \"hand crafted\" (kinda..) SQL Query","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"0c99deea5bb199a1076e9d3e6c1e4e2faaebddd5","unresolved":false,"context_lines":[{"line_number":464,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":465,"context_line":"        zones \u003d self.find_domains(elevated_context)"},{"line_number":466,"context_line":"        for z in zones:"},{"line_number":467,"context_line":"            self._update_ns(elevated_context, z)"},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"        return created_server"},{"line_number":470,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_4fe923e5","line":467,"in_reply_to":"1abeadc6_89741b37","updated":"2014-08-20 22:37:05.000000000","message":"Yea, another review is fine.. LGTM as soon as we can :)","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"a7a6ab03daf052c09600f7b220911b2467be1639","unresolved":false,"context_lines":[{"line_number":464,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":465,"context_line":"        zones \u003d self.find_domains(elevated_context)"},{"line_number":466,"context_line":"        for z in zones:"},{"line_number":467,"context_line":"            self._update_ns(elevated_context, z)"},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"        return created_server"},{"line_number":470,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_89741b37","line":467,"in_reply_to":"baada198_e244a11a","updated":"2014-08-20 21:35:52.000000000","message":"I think this is now done, but I\u0027m thinking this would be a separate patch. What do you think?","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"ea3ad8ba1dad9b858faf42bb2f8c4bc554c323f6","unresolved":false,"context_lines":[{"line_number":500,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":501,"context_line":"        zones \u003d self.find_domains(elevated_context)"},{"line_number":502,"context_line":"        for z in zones:"},{"line_number":503,"context_line":"            self._update_ns(elevated_context, z)"},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"        return server"},{"line_number":506,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_024ef538","line":503,"updated":"2014-08-11 10:42:40.000000000","message":"TODO for after my SQLA Core switch lands - we can make this 1000x more efficient with a \"hand crafted\" (kinda..) SQL Query","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"ea3ad8ba1dad9b858faf42bb2f8c4bc554c323f6","unresolved":false,"context_lines":[{"line_number":525,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":526,"context_line":"        zones \u003d self.find_domains(elevated_context)"},{"line_number":527,"context_line":"        for z in zones:"},{"line_number":528,"context_line":"            self._update_ns(elevated_context, z)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"        self.notifier.info(context, \u0027dns.server.delete\u0027, server)"},{"line_number":531,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_224bf928","line":528,"updated":"2014-08-11 10:42:40.000000000","message":"TODO for after my SQLA Core switch lands - we can make this 1000x more efficient with a \"hand crafted\" (kinda..) SQL Query","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"},{"author":{"_account_id":8094,"name":"Vinod Mangalpally","email":"mrvinod@outlook.com","username":"vinodmr"},"change_message_id":"3e9938bc0c93fdf107eb99f4947054592eda0b6f","unresolved":false,"context_lines":[{"line_number":290,"context_line":"                raise exceptions.InvalidTTL(\u0027TTL is below the minimum: %s\u0027"},{"line_number":291,"context_line":"                                            % min_ttl)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def _increment_domain_serial(self, context, domain_id):"},{"line_number":294,"context_line":"        domain \u003d self.storage.get_domain(context, domain_id)"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        # Increment the serial number"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_d02cab9b","line":293,"updated":"2014-08-22 16:17:53.000000000","message":"At every place that we call this - the domain is available.  So we can pass in the domain, instead of the domain_id.  That way we do not have to call get_domain again.\n\nAlso create_recordset does not currently call this - It should be calling this.","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"071e6591ba4f53124b01dee797838465ba0176f4","unresolved":false,"context_lines":[{"line_number":290,"context_line":"                raise exceptions.InvalidTTL(\u0027TTL is below the minimum: %s\u0027"},{"line_number":291,"context_line":"                                            % min_ttl)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def _increment_domain_serial(self, context, domain_id):"},{"line_number":294,"context_line":"        domain \u003d self.storage.get_domain(context, domain_id)"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        # Increment the serial number"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_c9aa4184","line":293,"in_reply_to":"1abeadc6_9ec23de7","updated":"2014-08-22 20:53:55.000000000","message":"Agreed (with both of you)... This code needs fixing, at one point in made sense but through many refactors it no longer does.\n\nWe should file a bug for this, as changing it in this review would be doing 2 things at once...","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"89f62cb40fcf30acbdb96d484b4e54f04c15b14e","unresolved":false,"context_lines":[{"line_number":290,"context_line":"                raise exceptions.InvalidTTL(\u0027TTL is below the minimum: %s\u0027"},{"line_number":291,"context_line":"                                            % min_ttl)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def _increment_domain_serial(self, context, domain_id):"},{"line_number":294,"context_line":"        domain \u003d self.storage.get_domain(context, domain_id)"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        # Increment the serial number"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_9ec23de7","line":293,"in_reply_to":"1abeadc6_d02cab9b","updated":"2014-08-22 20:40:37.000000000","message":"That\u0027s all existing code. I didn\u0027t change any of the existing code. I just added the _update_soa() using the existing domain.","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8094,"name":"Vinod Mangalpally","email":"mrvinod@outlook.com","username":"vinodmr"},"change_message_id":"3e9938bc0c93fdf107eb99f4947054592eda0b6f","unresolved":false,"context_lines":[{"line_number":331,"context_line":""},{"line_number":332,"context_line":"    # SOA Recordset Methods"},{"line_number":333,"context_line":"    def _build_soa_record(self, zone, servers):"},{"line_number":334,"context_line":"        return \"%s %s. %d %d %d %d %d\" % (servers[0][\u0027name\u0027],"},{"line_number":335,"context_line":"                                          zone[\u0027email\u0027].replace(\"@\", \".\"),"},{"line_number":336,"context_line":"                                          zone[\u0027serial\u0027],"},{"line_number":337,"context_line":"                                          zone[\u0027refresh\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_b0080fdb","line":334,"updated":"2014-08-22 16:17:53.000000000","message":"Would the servers always be in the same order - when new servers are added or deleted too?\n\nOtherwise different SOA records would have different servers.","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"071e6591ba4f53124b01dee797838465ba0176f4","unresolved":false,"context_lines":[{"line_number":331,"context_line":""},{"line_number":332,"context_line":"    # SOA Recordset Methods"},{"line_number":333,"context_line":"    def _build_soa_record(self, zone, servers):"},{"line_number":334,"context_line":"        return \"%s %s. %d %d %d %d %d\" % (servers[0][\u0027name\u0027],"},{"line_number":335,"context_line":"                                          zone[\u0027email\u0027].replace(\"@\", \".\"),"},{"line_number":336,"context_line":"                                          zone[\u0027serial\u0027],"},{"line_number":337,"context_line":"                                          zone[\u0027refresh\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_8992094a","line":334,"in_reply_to":"1abeadc6_7e66412b","updated":"2014-08-22 20:53:55.000000000","message":"As the code stands today, we always take the first record - this follows that pattern..","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"89f62cb40fcf30acbdb96d484b4e54f04c15b14e","unresolved":false,"context_lines":[{"line_number":331,"context_line":""},{"line_number":332,"context_line":"    # SOA Recordset Methods"},{"line_number":333,"context_line":"    def _build_soa_record(self, zone, servers):"},{"line_number":334,"context_line":"        return \"%s %s. %d %d %d %d %d\" % (servers[0][\u0027name\u0027],"},{"line_number":335,"context_line":"                                          zone[\u0027email\u0027].replace(\"@\", \".\"),"},{"line_number":336,"context_line":"                                          zone[\u0027serial\u0027],"},{"line_number":337,"context_line":"                                          zone[\u0027refresh\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_7e66412b","line":334,"in_reply_to":"1abeadc6_b0080fdb","updated":"2014-08-22 20:40:37.000000000","message":"I\u0027m not sure. This is the code that the backend plugins use to create the SOA, and when I read about it always referred to the first one in the list.","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8094,"name":"Vinod Mangalpally","email":"mrvinod@outlook.com","username":"vinodmr"},"change_message_id":"3e9938bc0c93fdf107eb99f4947054592eda0b6f","unresolved":false,"context_lines":[{"line_number":339,"context_line":"                                          zone[\u0027expire\u0027],"},{"line_number":340,"context_line":"                                          zone[\u0027minimum\u0027])"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    def _find_or_create_soa(self, context, zone):"},{"line_number":343,"context_line":"        # Need elevated context to get the servers"},{"line_number":344,"context_line":"        elevated_context \u003d context.elevated()"},{"line_number":345,"context_line":"        elevated_context.all_tenants \u003d True"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_95df85d5","line":342,"updated":"2014-08-22 16:17:53.000000000","message":"Now that the NS and SOA records are created at database migration time, there should be just a separate create method.","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"89f62cb40fcf30acbdb96d484b4e54f04c15b14e","unresolved":false,"context_lines":[{"line_number":339,"context_line":"                                          zone[\u0027expire\u0027],"},{"line_number":340,"context_line":"                                          zone[\u0027minimum\u0027])"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    def _find_or_create_soa(self, context, zone):"},{"line_number":343,"context_line":"        # Need elevated context to get the servers"},{"line_number":344,"context_line":"        elevated_context \u003d context.elevated()"},{"line_number":345,"context_line":"        elevated_context.all_tenants \u003d True"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_be43796a","line":342,"in_reply_to":"1abeadc6_95df85d5","updated":"2014-08-22 20:40:37.000000000","message":"I was wondering about that, but this is the way that it was done when the recordsets were added to v1 -- they did the database migration and still had this in there,so that\u0027s the way I left it.","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"071e6591ba4f53124b01dee797838465ba0176f4","unresolved":false,"context_lines":[{"line_number":339,"context_line":"                                          zone[\u0027expire\u0027],"},{"line_number":340,"context_line":"                                          zone[\u0027minimum\u0027])"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    def _find_or_create_soa(self, context, zone):"},{"line_number":343,"context_line":"        # Need elevated context to get the servers"},{"line_number":344,"context_line":"        elevated_context \u003d context.elevated()"},{"line_number":345,"context_line":"        elevated_context.all_tenants \u003d True"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_89e049ce","line":342,"in_reply_to":"1abeadc6_be43796a","updated":"2014-08-22 20:53:55.000000000","message":"I agree with vinod here. The reason we have this in the v1 record API is because its possible to create a record without first creating the recordset. With the SOA created in either th migration, or when the domain is first created, we no longer need to handle the SOA being non-existant.","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8094,"name":"Vinod Mangalpally","email":"mrvinod@outlook.com","username":"vinodmr"},"change_message_id":"3e9938bc0c93fdf107eb99f4947054592eda0b6f","unresolved":false,"context_lines":[{"line_number":379,"context_line":"        self.update_recordset(context, soa, increment_serial\u003dFalse)"},{"line_number":380,"context_line":""},{"line_number":381,"context_line":"    # NS Recordset Methods"},{"line_number":382,"context_line":"    def _find_or_create_ns(self, context, zone):"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"        servers \u003d self.get_domain_servers(context, zone[\u0027id\u0027])"},{"line_number":385,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_75e4a9ab","line":382,"updated":"2014-08-22 16:17:53.000000000","message":"Now that the NS and SOA records are created at database migration time, there should be separate find and create methods.","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"89f62cb40fcf30acbdb96d484b4e54f04c15b14e","unresolved":false,"context_lines":[{"line_number":379,"context_line":"        self.update_recordset(context, soa, increment_serial\u003dFalse)"},{"line_number":380,"context_line":""},{"line_number":381,"context_line":"    # NS Recordset Methods"},{"line_number":382,"context_line":"    def _find_or_create_ns(self, context, zone):"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"        servers \u003d self.get_domain_servers(context, zone[\u0027id\u0027])"},{"line_number":385,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_5e526535","line":382,"in_reply_to":"1abeadc6_75e4a9ab","updated":"2014-08-22 20:40:37.000000000","message":"Same comment as above.","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8094,"name":"Vinod Mangalpally","email":"mrvinod@outlook.com","username":"vinodmr"},"change_message_id":"3e9938bc0c93fdf107eb99f4947054592eda0b6f","unresolved":false,"context_lines":[{"line_number":499,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":500,"context_line":"        zones \u003d self.find_domains(elevated_context)"},{"line_number":501,"context_line":"        for z in zones:"},{"line_number":502,"context_line":"            self._update_ns(elevated_context, z)"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":"        return created_server"},{"line_number":505,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_155d3579","line":502,"updated":"2014-08-22 16:17:53.000000000","message":"For the create/update/delete_servers, you end up calling get_domain_servers for every zone.  Instead if you pass the servers to the call, that would be more efficient.","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"89f62cb40fcf30acbdb96d484b4e54f04c15b14e","unresolved":false,"context_lines":[{"line_number":499,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":500,"context_line":"        zones \u003d self.find_domains(elevated_context)"},{"line_number":501,"context_line":"        for z in zones:"},{"line_number":502,"context_line":"            self._update_ns(elevated_context, z)"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":"        return created_server"},{"line_number":505,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_69176d45","line":502,"in_reply_to":"1abeadc6_155d3579","updated":"2014-08-22 20:40:37.000000000","message":"Once we\u0027re using server pools, couldn\u0027t each zone have a different server/server pool in theory?","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"071e6591ba4f53124b01dee797838465ba0176f4","unresolved":false,"context_lines":[{"line_number":499,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":500,"context_line":"        zones \u003d self.find_domains(elevated_context)"},{"line_number":501,"context_line":"        for z in zones:"},{"line_number":502,"context_line":"            self._update_ns(elevated_context, z)"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":"        return created_server"},{"line_number":505,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_a931855b","line":502,"in_reply_to":"1abeadc6_69176d45","updated":"2014-08-22 20:53:55.000000000","message":"For pools, the CUD of the server will be scoped to a pool, so all zones updated at the time will belong to the same pool.\n\nHaving _update_ns skip the get_domain_servers call when an optional servers argument is passed makes sense, and speeds things up.","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8094,"name":"Vinod Mangalpally","email":"mrvinod@outlook.com","username":"vinodmr"},"change_message_id":"3e9938bc0c93fdf107eb99f4947054592eda0b6f","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":536,"context_line":"        zones \u003d self.find_domains(elevated_context)"},{"line_number":537,"context_line":"        for z in zones:"},{"line_number":538,"context_line":"            self._update_ns(elevated_context, z)"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"        return server"},{"line_number":541,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_f0dc4748","line":538,"updated":"2014-08-22 16:17:53.000000000","message":"For update_server and delete_server, if SOA records contain the server that is being updated/deleted - then they should be updated too.","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"89f62cb40fcf30acbdb96d484b4e54f04c15b14e","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":536,"context_line":"        zones \u003d self.find_domains(elevated_context)"},{"line_number":537,"context_line":"        for z in zones:"},{"line_number":538,"context_line":"            self._update_ns(elevated_context, z)"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"        return server"},{"line_number":541,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_495471c9","line":538,"in_reply_to":"1abeadc6_f0dc4748","updated":"2014-08-22 20:40:37.000000000","message":"Done","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8094,"name":"Vinod Mangalpally","email":"mrvinod@outlook.com","username":"vinodmr"},"change_message_id":"3e9938bc0c93fdf107eb99f4947054592eda0b6f","unresolved":false,"context_lines":[{"line_number":1007,"context_line":"        target \u003d {\u0027tenant_id\u0027: context.tenant}"},{"line_number":1008,"context_line":"        policy.check(\u0027find_recordsets\u0027, context, target)"},{"line_number":1009,"context_line":""},{"line_number":1010,"context_line":"        # Create SOA \u0026 NS recordsets if they don\u0027t already exist"},{"line_number":1011,"context_line":"        domain \u003d self.find_domain(context, {\u0027id\u0027: criterion[\u0027domain_id\u0027]})"},{"line_number":1012,"context_line":""},{"line_number":1013,"context_line":"        self._find_or_create_soa(context, domain)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_75fbc946","line":1010,"updated":"2014-08-22 16:17:53.000000000","message":"This comment is not true now","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"89f62cb40fcf30acbdb96d484b4e54f04c15b14e","unresolved":false,"context_lines":[{"line_number":1007,"context_line":"        target \u003d {\u0027tenant_id\u0027: context.tenant}"},{"line_number":1008,"context_line":"        policy.check(\u0027find_recordsets\u0027, context, target)"},{"line_number":1009,"context_line":""},{"line_number":1010,"context_line":"        # Create SOA \u0026 NS recordsets if they don\u0027t already exist"},{"line_number":1011,"context_line":"        domain \u003d self.find_domain(context, {\u0027id\u0027: criterion[\u0027domain_id\u0027]})"},{"line_number":1012,"context_line":""},{"line_number":1013,"context_line":"        self._find_or_create_soa(context, domain)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_a90b45d4","line":1010,"in_reply_to":"1abeadc6_75fbc946","updated":"2014-08-22 20:40:37.000000000","message":"Done","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8094,"name":"Vinod Mangalpally","email":"mrvinod@outlook.com","username":"vinodmr"},"change_message_id":"3e9938bc0c93fdf107eb99f4947054592eda0b6f","unresolved":false,"context_lines":[{"line_number":1011,"context_line":"        domain \u003d self.find_domain(context, {\u0027id\u0027: criterion[\u0027domain_id\u0027]})"},{"line_number":1012,"context_line":""},{"line_number":1013,"context_line":"        self._find_or_create_soa(context, domain)"},{"line_number":1014,"context_line":"        self._find_or_create_ns(context, domain)"},{"line_number":1015,"context_line":""},{"line_number":1016,"context_line":"        recordsets \u003d self.storage.find_recordsets(context, criterion, marker,"},{"line_number":1017,"context_line":"                                                  limit, sort_key, sort_dir)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_5587adb4","line":1014,"updated":"2014-08-22 16:17:53.000000000","message":"These calls should not be needed now","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"89f62cb40fcf30acbdb96d484b4e54f04c15b14e","unresolved":false,"context_lines":[{"line_number":1011,"context_line":"        domain \u003d self.find_domain(context, {\u0027id\u0027: criterion[\u0027domain_id\u0027]})"},{"line_number":1012,"context_line":""},{"line_number":1013,"context_line":"        self._find_or_create_soa(context, domain)"},{"line_number":1014,"context_line":"        self._find_or_create_ns(context, domain)"},{"line_number":1015,"context_line":""},{"line_number":1016,"context_line":"        recordsets \u003d self.storage.find_recordsets(context, criterion, marker,"},{"line_number":1017,"context_line":"                                                  limit, sort_key, sort_dir)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_c90ec1e4","line":1014,"in_reply_to":"1abeadc6_5587adb4","updated":"2014-08-22 20:40:37.000000000","message":"Done","commit_id":"f903ce8f0bb2563759f9e678a4dc46cd0873a83e"},{"author":{"_account_id":8094,"name":"Vinod Mangalpally","email":"mrvinod@outlook.com","username":"vinodmr"},"change_message_id":"8c402258bf5a751088f8e7a285c0e7971d858622","unresolved":false,"context_lines":[{"line_number":400,"context_line":"        for r in ns.records:"},{"line_number":401,"context_line":"            if r.data \u003d\u003d orig_name:"},{"line_number":402,"context_line":"                r.data \u003d new_name"},{"line_number":403,"context_line":"                self.update_recordset(context, ns, increment_serial\u003dFalse)"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":"    def _add_ns(self, context, zone, server):"},{"line_number":406,"context_line":"        # Get NS recordset"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_e2860113","line":403,"updated":"2014-08-25 16:20:38.000000000","message":"Why shouldn\u0027t the serial be incremented when ns records are added/updated or deleted?","commit_id":"56754b9a5e39ea013cd2d11617f0fb4d70c299b6"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"b7de3675d579b543e69d4fb882c6b0c4413d4b55","unresolved":false,"context_lines":[{"line_number":400,"context_line":"        for r in ns.records:"},{"line_number":401,"context_line":"            if r.data \u003d\u003d orig_name:"},{"line_number":402,"context_line":"                r.data \u003d new_name"},{"line_number":403,"context_line":"                self.update_recordset(context, ns, increment_serial\u003dFalse)"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":"    def _add_ns(self, context, zone, server):"},{"line_number":406,"context_line":"        # Get NS recordset"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_98d77a23","line":403,"in_reply_to":"1abeadc6_e2860113","updated":"2014-08-25 16:59:06.000000000","message":"Good question. I was wondering about this. My thinking went along the lines of -- the NS/SOA records are being updated as the result of another action. If the serial needs to be updated, then the original action should be triggering the updated serial. If this does it, too, we could get into an infinite loop of updating the serial number.\n\nSo, I think we need to make sure that the original actions -- update server, etc. are calling update serial if it needs to be done rather than doing it in the update SOA/NS.\n\nOther thoughts?","commit_id":"56754b9a5e39ea013cd2d11617f0fb4d70c299b6"},{"author":{"_account_id":8094,"name":"Vinod Mangalpally","email":"mrvinod@outlook.com","username":"vinodmr"},"change_message_id":"8c402258bf5a751088f8e7a285c0e7971d858622","unresolved":false,"context_lines":[{"line_number":423,"context_line":"                                            \u0027type\u0027: \"NS\"})"},{"line_number":424,"context_line":"        for r in ns.records:"},{"line_number":425,"context_line":"            if r.data \u003d\u003d server.obj_get_original_value(\u0027name\u0027):"},{"line_number":426,"context_line":"                self.delete_recordset(context, zone.id,"},{"line_number":427,"context_line":"                                      ns.id, increment_serial\u003dFalse)"},{"line_number":428,"context_line":""},{"line_number":429,"context_line":"    # Quota Enforcement Methods"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_623031e9","line":426,"updated":"2014-08-25 16:20:38.000000000","message":"Just the one record should be deleted in this case, rather than the entire recordset.","commit_id":"56754b9a5e39ea013cd2d11617f0fb4d70c299b6"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"b7de3675d579b543e69d4fb882c6b0c4413d4b55","unresolved":false,"context_lines":[{"line_number":423,"context_line":"                                            \u0027type\u0027: \"NS\"})"},{"line_number":424,"context_line":"        for r in ns.records:"},{"line_number":425,"context_line":"            if r.data \u003d\u003d server.obj_get_original_value(\u0027name\u0027):"},{"line_number":426,"context_line":"                self.delete_recordset(context, zone.id,"},{"line_number":427,"context_line":"                                      ns.id, increment_serial\u003dFalse)"},{"line_number":428,"context_line":""},{"line_number":429,"context_line":"    # Quota Enforcement Methods"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_d8e1f2ff","line":426,"in_reply_to":"1abeadc6_623031e9","updated":"2014-08-25 16:59:06.000000000","message":"True. I\u0027ll fix that.","commit_id":"56754b9a5e39ea013cd2d11617f0fb4d70c299b6"},{"author":{"_account_id":8094,"name":"Vinod Mangalpally","email":"mrvinod@outlook.com","username":"vinodmr"},"change_message_id":"8c402258bf5a751088f8e7a285c0e7971d858622","unresolved":false,"context_lines":[{"line_number":572,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":573,"context_line":"        zones \u003d self.find_domains(elevated_context)"},{"line_number":574,"context_line":"        for z in zones:"},{"line_number":575,"context_line":"            self._delete_ns(elevated_context, z)"},{"line_number":576,"context_line":"            # Also, update the SOA recordset"},{"line_number":577,"context_line":"            self._update_soa(context, z)"},{"line_number":578,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_421c156b","line":575,"updated":"2014-08-25 16:20:38.000000000","message":"\u0027server\u0027 is not passed to _delete_ns.","commit_id":"56754b9a5e39ea013cd2d11617f0fb4d70c299b6"},{"author":{"_account_id":8130,"name":"Betsy Luzader","email":"betsy.luzader@rackspace.com","username":"bluzader"},"change_message_id":"b7de3675d579b543e69d4fb882c6b0c4413d4b55","unresolved":false,"context_lines":[{"line_number":572,"context_line":"        elevated_context.all_tenants \u003d True"},{"line_number":573,"context_line":"        zones \u003d self.find_domains(elevated_context)"},{"line_number":574,"context_line":"        for z in zones:"},{"line_number":575,"context_line":"            self._delete_ns(elevated_context, z)"},{"line_number":576,"context_line":"            # Also, update the SOA recordset"},{"line_number":577,"context_line":"            self._update_soa(context, z)"},{"line_number":578,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_78b9beeb","line":575,"in_reply_to":"1abeadc6_421c156b","updated":"2014-08-25 16:59:06.000000000","message":"Working on that now.","commit_id":"56754b9a5e39ea013cd2d11617f0fb4d70c299b6"}],"designate/storage/impl_sqlalchemy/migrate_repo/versions/039_support_soa_records.py":[{"author":{"_account_id":741,"name":"Kiall Mac Innes","email":"kiall@macinnes.ie","username":"kiall"},"change_message_id":"ea3ad8ba1dad9b858faf42bb2f8c4bc554c323f6","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    # Add missing unique index"},{"line_number":32,"context_line":"    constraint \u003d UniqueConstraint(\u0027domain_id\u0027, \u0027name\u0027, \u0027type\u0027,"},{"line_number":33,"context_line":"                                  name\u003d\u0027unique_recordset\u0027,"},{"line_number":34,"context_line":"                                  table\u003drecords_table)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    constraint.create()"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_42daad1d","line":34,"updated":"2014-08-11 10:42:40.000000000","message":"Humm - This should be present already! 034_add_recordsets_table.py adds this index, I *think* we\u0027re hitting a SQLite specific issue where indexes are dropped after any table is altered.. \n\n035_add_unique_record_sqlite.py shows this exact issue happening before, and a sample of how to fix the index only on SQLite (We\u0027ll also want to make sure there are no other dropped indexes)","commit_id":"0e47e98f46b3cdfed3459bfc0e274db0c7212605"}]}
