)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c2a0b9d29bfdba3cd893f03d63f234fadf65a2f5","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add standard attribute functions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now the standard attrs should be added into db table \u0027standardattributes\u0027."},{"line_number":10,"context_line":"So when the extension attrs want to add into this table, should based on"},{"line_number":11,"context_line":"subscribe/notify."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a8ffd7b_d08028fa","line":9,"updated":"2015-11-30 18:43:12.000000000","message":"I really don\u0027t understand what this is for.","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"3988974d9b6835bc7cdaaa5d051ce6232582c3c7","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add standard attribute functions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now the standard attrs should be added into db table \u0027standardattributes\u0027."},{"line_number":10,"context_line":"So when the extension attrs want to add into this table, should based on"},{"line_number":11,"context_line":"subscribe/notify."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a8ffd7b_d1e1eed1","line":9,"in_reply_to":"9a8ffd7b_b4922af5","updated":"2015-12-01 09:49:49.000000000","message":"I think that you need to add more explanations to the commit message so that the reviewers can get a better picture of what you are trying to do. Honestly when the original patch for the attributes was added I felt like it was missing an example on how one should use it.","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"1def16b678f2b524dac66121bce5bf179a7549a4","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add standard attribute functions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now the standard attrs should be added into db table \u0027standardattributes\u0027."},{"line_number":10,"context_line":"So when the extension attrs want to add into this table, should based on"},{"line_number":11,"context_line":"subscribe/notify."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a8ffd7b_b4922af5","line":9,"in_reply_to":"9a8ffd7b_d08028fa","updated":"2015-12-01 01:32:18.000000000","message":"@Armando, Hi, thanks for review. This patch is for neutron resource which want to add into db table \u0027standardattributes\u0027, the table is used for neutron common attributes towards neutron resources. This way will not modify the base db codes anymore, the new resource common attributes which as extensions will just subscribe and do this own function, it will add themselves into the table.","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b344872a328b544bcc56bc571edc189879818a35","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add standard attribute functions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now the standard attrs should be added into db table \u0027standardattributes\u0027."},{"line_number":10,"context_line":"So when the extension attrs want to add into this table, should based on"},{"line_number":11,"context_line":"subscribe/notify."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a8ffd7b_e5fe79ad","line":9,"in_reply_to":"9a8ffd7b_d1e1eed1","updated":"2015-12-02 01:52:05.000000000","message":"Adding a timestamp attribute should not be anything more convoluted than something along the lines of [1], but that in itself is more complex than average because it\u0027s modifying an existing schema. The initial step would be simply to add the DB field and get it populated where it matters: it\u0027s a backward compatible change that can apply everywhere.\n\nLet me get Kevin to look at this one, I am sure he can shed more light on the matter.\n\n[1] https://review.openstack.org/#/c/224575/","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c2a0b9d29bfdba3cd893f03d63f234fadf65a2f5","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now the standard attrs should be added into db table \u0027standardattributes\u0027."},{"line_number":10,"context_line":"So when the extension attrs want to add into this table, should based on"},{"line_number":11,"context_line":"subscribe/notify."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch add these function to support the way of standard attrs"},{"line_number":14,"context_line":"addition."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a8ffd7b_907b8029","line":11,"updated":"2015-11-30 18:43:12.000000000","message":"why?","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"}],"neutron/api/v2/base.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"3988974d9b6835bc7cdaaa5d051ce6232582c3c7","unresolved":false,"context_lines":[{"line_number":453,"context_line":"                # We don\u0027t want to quota this resource"},{"line_number":454,"context_line":"                LOG.debug(e)"},{"line_number":455,"context_line":""},{"line_number":456,"context_line":"        @standard_attr_common.check_standardattr(self._plugin, request.context)"},{"line_number":457,"context_line":"        def notify(create_result):"},{"line_number":458,"context_line":"            # Ensure usage trackers for all resources affected by this API"},{"line_number":459,"context_line":"            # operation are marked as dirty"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_9187e6d6","line":456,"updated":"2015-12-01 09:49:49.000000000","message":"nice :)","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"af484fa569dfc284621d4791b80cc34288a074d5","unresolved":false,"context_lines":[{"line_number":456,"context_line":"                # We don\u0027t want to quota this resource"},{"line_number":457,"context_line":"                LOG.debug(e)"},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"        @standard_attr_common.check_standardattr(self._plugin, request.context)"},{"line_number":460,"context_line":"        def notify(create_result):"},{"line_number":461,"context_line":"            # Ensure usage trackers for all resources affected by this API"},{"line_number":462,"context_line":"            # operation are marked as dirty"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_27ee2023","line":459,"updated":"2016-02-03 09:38:53.000000000","message":"This decorator will be very difficult to use elsewhere in its current form because the context is set in the decorator so it means that it can only be used to decorate functions that are created specifically for a single request.\n\nSince it\u0027s so specific to this function, I think it would be much cleaner to just add a function call directly in notify. Then you can also include the resource type so the six.iter next call isn\u0027t needed.\n\ndef notify(create_result):\n    standard_attr_common.add_standard_attr_if_needed(request.context, self._plugin,\n                                                     self._resource, create_result)","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"219c398ced88a739817b70cb25c0a2be4f995830","unresolved":false,"context_lines":[{"line_number":456,"context_line":"                # We don\u0027t want to quota this resource"},{"line_number":457,"context_line":"                LOG.debug(e)"},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"        @standard_attr_common.check_standardattr(self._plugin, request.context)"},{"line_number":460,"context_line":"        def notify(create_result):"},{"line_number":461,"context_line":"            # Ensure usage trackers for all resources affected by this API"},{"line_number":462,"context_line":"            # operation are marked as dirty"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_47fc7c3e","line":459,"in_reply_to":"5a5ae5dd_27ee2023","updated":"2016-02-03 10:07:19.000000000","message":"Thanks. Agree with U. This function is just for return the timestamp info during creation when timestamp extension is enable. The issue is this function limit the worth itself. So I will update this patch soon.","commit_id":"4f1d71245699812af530005b4543d715fca46de4"}],"neutron/callbacks/events.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0fed1a445cf45255789553dd94f9ec338a81dcf5","unresolved":false,"context_lines":[{"line_number":29,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":30,"context_line":"BEFORE \u003d \u0027before_\u0027"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"CREATE_PRECOMMIT \u003d \u0027create_precommit\u0027"},{"line_number":33,"context_line":"UPDATE_PRECOMMIT \u003d \u0027update_precommit\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a5ae5dd_180af979","line":32,"updated":"2016-02-05 01:55:20.000000000","message":"this conflicts with:\n\nhttps://review.openstack.org/#/c/252755/","commit_id":"51bb1874a81ebb07741c74db4150962e03cfc09a"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"7bf143d7e63799c97419242f547cbe7d612d28ed","unresolved":false,"context_lines":[{"line_number":29,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":30,"context_line":"BEFORE \u003d \u0027before_\u0027"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"CREATE_PRECOMMIT \u003d \u0027create_precommit\u0027"},{"line_number":33,"context_line":"UPDATE_PRECOMMIT \u003d \u0027update_precommit\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a5ae5dd_7b968740","line":32,"in_reply_to":"5a5ae5dd_180af979","updated":"2016-02-05 02:19:35.000000000","message":"I will see. Thank you","commit_id":"51bb1874a81ebb07741c74db4150962e03cfc09a"}],"neutron/callbacks/resources.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c2a0b9d29bfdba3cd893f03d63f234fadf65a2f5","unresolved":false,"context_lines":[{"line_number":20,"context_line":"SECURITY_GROUP_RULE \u003d \u0027security_group_rule\u0027"},{"line_number":21,"context_line":"SUBNET \u003d \u0027subnet\u0027"},{"line_number":22,"context_line":"SUBNET_GATEWAY \u003d \u0027subnet_gateway\u0027"},{"line_number":23,"context_line":"STANDARD_ATTR \u003d \u0027standard_attr\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_50751830","line":23,"updated":"2015-11-30 18:43:12.000000000","message":"standard_attr is not resource, this makes no sense.","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"6013e8f144f153cec793ed55e1cb136450878eec","unresolved":false,"context_lines":[{"line_number":20,"context_line":"SECURITY_GROUP_RULE \u003d \u0027security_group_rule\u0027"},{"line_number":21,"context_line":"SUBNET \u003d \u0027subnet\u0027"},{"line_number":22,"context_line":"SUBNET_GATEWAY \u003d \u0027subnet_gateway\u0027"},{"line_number":23,"context_line":"STANDARD_ATTR \u003d \u0027standard_attr\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_1a86bdb9","line":23,"in_reply_to":"9a8ffd7b_50751830","updated":"2015-12-01 02:56:00.000000000","message":"@Armando, Thanks, it just like \u0027SUBNET_GATEWAY\u0027,\u0027PROCESS\u0027 and others which don\u0027t look like resource.","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0fed1a445cf45255789553dd94f9ec338a81dcf5","unresolved":false,"context_lines":[{"line_number":21,"context_line":"SECURITY_GROUP_RULE \u003d \u0027security_group_rule\u0027"},{"line_number":22,"context_line":"SUBNET \u003d \u0027subnet\u0027"},{"line_number":23,"context_line":"SUBNET_GATEWAY \u003d \u0027subnet_gateway\u0027"},{"line_number":24,"context_line":"NETWORK \u003d \u0027network\u0027"},{"line_number":25,"context_line":"SUBNETPOOL \u003d \u0027subnetpool\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a5ae5dd_d841c1aa","line":24,"range":{"start_line":24,"start_character":0,"end_line":24,"end_character":7},"updated":"2016-02-05 01:55:20.000000000","message":"alphabetical order please.","commit_id":"51bb1874a81ebb07741c74db4150962e03cfc09a"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"7bf143d7e63799c97419242f547cbe7d612d28ed","unresolved":false,"context_lines":[{"line_number":21,"context_line":"SECURITY_GROUP_RULE \u003d \u0027security_group_rule\u0027"},{"line_number":22,"context_line":"SUBNET \u003d \u0027subnet\u0027"},{"line_number":23,"context_line":"SUBNET_GATEWAY \u003d \u0027subnet_gateway\u0027"},{"line_number":24,"context_line":"NETWORK \u003d \u0027network\u0027"},{"line_number":25,"context_line":"SUBNETPOOL \u003d \u0027subnetpool\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a5ae5dd_3b448f19","line":24,"range":{"start_line":24,"start_character":0,"end_line":24,"end_character":7},"in_reply_to":"5a5ae5dd_d841c1aa","updated":"2016-02-05 02:19:35.000000000","message":"Thanks a lot for correct.;-)","commit_id":"51bb1874a81ebb07741c74db4150962e03cfc09a"}],"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c2a0b9d29bfdba3cd893f03d63f234fadf65a2f5","unresolved":false,"context_lines":[{"line_number":336,"context_line":"                    target_tenant\u003d\u0027*\u0027, tenant_id\u003dnetwork[\u0027tenant_id\u0027])"},{"line_number":337,"context_line":"                context.session.add(entry)"},{"line_number":338,"context_line":"            context.session.add(network)"},{"line_number":339,"context_line":"        registry.notify(resources.STANDARD_ATTR,"},{"line_number":340,"context_line":"                        events.AFTER_CREATE,"},{"line_number":341,"context_line":"                        self,"},{"line_number":342,"context_line":"                        context\u003dcontext,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_3093b451","line":339,"updated":"2015-11-30 18:43:12.000000000","message":"Can you explain what a callback would do with this notification? I don\u0027t understand what this is for. I think this is unnecessary.","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"d4a7a5de3a651215017947605abfd2c5033580da","unresolved":false,"context_lines":[{"line_number":336,"context_line":"                    target_tenant\u003d\u0027*\u0027, tenant_id\u003dnetwork[\u0027tenant_id\u0027])"},{"line_number":337,"context_line":"                context.session.add(entry)"},{"line_number":338,"context_line":"            context.session.add(network)"},{"line_number":339,"context_line":"        registry.notify(resources.STANDARD_ATTR,"},{"line_number":340,"context_line":"                        events.AFTER_CREATE,"},{"line_number":341,"context_line":"                        self,"},{"line_number":342,"context_line":"                        context\u003dcontext,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_3445d516","line":339,"in_reply_to":"9a8ffd7b_053ae2cd","updated":"2015-12-01 03:58:17.000000000","message":"maybe after finishing this patch, it is convenient to add other extension attribute such as timestamp and resource tags","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"6013e8f144f153cec793ed55e1cb136450878eec","unresolved":false,"context_lines":[{"line_number":336,"context_line":"                    target_tenant\u003d\u0027*\u0027, tenant_id\u003dnetwork[\u0027tenant_id\u0027])"},{"line_number":337,"context_line":"                context.session.add(entry)"},{"line_number":338,"context_line":"            context.session.add(network)"},{"line_number":339,"context_line":"        registry.notify(resources.STANDARD_ATTR,"},{"line_number":340,"context_line":"                        events.AFTER_CREATE,"},{"line_number":341,"context_line":"                        self,"},{"line_number":342,"context_line":"                        context\u003dcontext,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_053ae2cd","line":339,"in_reply_to":"9a8ffd7b_3093b451","updated":"2015-12-01 02:56:00.000000000","message":"This callback will notify the resources which subscribe this function and event. And these resources will add their own attributes which are common attrs towards neutron resources to the db table \u0027standardattributes\u0027.","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c2a0b9d29bfdba3cd893f03d63f234fadf65a2f5","unresolved":false,"context_lines":[{"line_number":369,"context_line":"                    context.session.delete(entry)"},{"line_number":370,"context_line":"                    context.session.expire(network, [\u0027rbac_entries\u0027])"},{"line_number":371,"context_line":"            network.update(n)"},{"line_number":372,"context_line":"        registry.notify(resources.STANDARD_ATTR,"},{"line_number":373,"context_line":"                        events.AFTER_UPDATE,"},{"line_number":374,"context_line":"                        self,"},{"line_number":375,"context_line":"                        context\u003dcontext,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_f09c4c5f","line":372,"updated":"2015-11-30 18:43:12.000000000","message":"ditto","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c2a0b9d29bfdba3cd893f03d63f234fadf65a2f5","unresolved":false,"context_lines":[{"line_number":602,"context_line":"        if ipv6_utils.is_auto_address_subnet(subnet):"},{"line_number":603,"context_line":"            self.ipam.add_auto_addrs_on_network_ports(context, subnet,"},{"line_number":604,"context_line":"                                                      ipam_subnet)"},{"line_number":605,"context_line":"        registry.notify(resources.STANDARD_ATTR,"},{"line_number":606,"context_line":"                        events.AFTER_CREATE,"},{"line_number":607,"context_line":"                        self,"},{"line_number":608,"context_line":"                        context\u003dcontext,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_b09fa44f","line":605,"updated":"2015-11-30 18:43:12.000000000","message":"ditto","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c2a0b9d29bfdba3cd893f03d63f234fadf65a2f5","unresolved":false,"context_lines":[{"line_number":762,"context_line":"            subnet, changes \u003d self.ipam.update_db_subnet(context, id, s,"},{"line_number":763,"context_line":"                                                         db_pools)"},{"line_number":764,"context_line":"        registry.notify(resources.STANDARD_ATTR,"},{"line_number":765,"context_line":"                        events.AFTER_UPDATE,"},{"line_number":766,"context_line":"                        self,"},{"line_number":767,"context_line":"                        context\u003dcontext,"},{"line_number":768,"context_line":"                        core_model\u003dmodels_v2.Network,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_70a93c7b","line":765,"updated":"2015-11-30 18:43:12.000000000","message":"ditto","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c2a0b9d29bfdba3cd893f03d63f234fadf65a2f5","unresolved":false,"context_lines":[{"line_number":994,"context_line":"                self._create_subnetpool_prefix(context,"},{"line_number":995,"context_line":"                                               prefix,"},{"line_number":996,"context_line":"                                               subnetpool.id)"},{"line_number":997,"context_line":"        registry.notify(resources.STANDARD_ATTR,"},{"line_number":998,"context_line":"                        events.AFTER_CREATE,"},{"line_number":999,"context_line":"                        self,"},{"line_number":1000,"context_line":"                        context\u003dcontext,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_10b550cf","line":997,"updated":"2015-11-30 18:43:12.000000000","message":"ditto","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c2a0b9d29bfdba3cd893f03d63f234fadf65a2f5","unresolved":false,"context_lines":[{"line_number":1052,"context_line":""},{"line_number":1053,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1054,"context_line":"            orig_sp \u003d self._get_subnetpool(context, id)"},{"line_number":1055,"context_line":"            registry.notify(resources.STANDARD_ATTR,"},{"line_number":1056,"context_line":"                            events.AFTER_UPDATE,"},{"line_number":1057,"context_line":"                            self,"},{"line_number":1058,"context_line":"                            context\u003dcontext,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_f0ea0cac","line":1055,"updated":"2015-11-30 18:43:12.000000000","message":"ditto","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c2a0b9d29bfdba3cd893f03d63f234fadf65a2f5","unresolved":false,"context_lines":[{"line_number":1238,"context_line":""},{"line_number":1239,"context_line":"        if \u0027dns_name\u0027 in p:"},{"line_number":1240,"context_line":"            db_port[\u0027dns_assignment\u0027] \u003d dns_assignment"},{"line_number":1241,"context_line":"        registry.notify(resources.STANDARD_ATTR,"},{"line_number":1242,"context_line":"                        events.AFTER_CREATE,"},{"line_number":1243,"context_line":"                        self,"},{"line_number":1244,"context_line":"                        context\u003dcontext,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_50daf818","line":1241,"updated":"2015-11-30 18:43:12.000000000","message":"ditto","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c2a0b9d29bfdba3cd893f03d63f234fadf65a2f5","unresolved":false,"context_lines":[{"line_number":1294,"context_line":"                dns_assignment \u003d self._get_dns_names_for_updated_port("},{"line_number":1295,"context_line":"                    context, original_ips, original_dns_name,"},{"line_number":1296,"context_line":"                    request_dns_name, changes)"},{"line_number":1297,"context_line":"        registry.notify(resources.STANDARD_ATTR,"},{"line_number":1298,"context_line":"                        events.AFTER_UPDATE,"},{"line_number":1299,"context_line":"                        self,"},{"line_number":1300,"context_line":"                        context\u003dcontext,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_30089491","line":1297,"updated":"2015-11-30 18:43:12.000000000","message":"ditto","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ed27653ee4ed273d99e4028fc64656146dd2b26c","unresolved":false,"context_lines":[{"line_number":331,"context_line":"                    target_tenant\u003d\u0027*\u0027, tenant_id\u003dnetwork[\u0027tenant_id\u0027])"},{"line_number":332,"context_line":"                context.session.add(entry)"},{"line_number":333,"context_line":"            context.session.add(network)"},{"line_number":334,"context_line":"        registry.notify(resources.STANDARD_ATTR, events.AFTER_CREATE,"},{"line_number":335,"context_line":"                        self, context\u003dcontext, db_model\u003dnetwork)"},{"line_number":336,"context_line":"        return self._make_network_dict(network, process_extensions\u003dFalse,"},{"line_number":337,"context_line":"                                       context\u003dcontext)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_38e86d7c","line":334,"updated":"2015-12-04 02:02:06.000000000","message":"the standard attrs need to be updated as part of the same transaction.","commit_id":"77f212e5ac8dc63eb4930cf3c4922e525b954745"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"266f16b9b75bb17dccf2765f5f45cd38dad6fc81","unresolved":false,"context_lines":[{"line_number":331,"context_line":"                    target_tenant\u003d\u0027*\u0027, tenant_id\u003dnetwork[\u0027tenant_id\u0027])"},{"line_number":332,"context_line":"                context.session.add(entry)"},{"line_number":333,"context_line":"            context.session.add(network)"},{"line_number":334,"context_line":"        registry.notify(resources.STANDARD_ATTR, events.AFTER_CREATE,"},{"line_number":335,"context_line":"                        self, context\u003dcontext, db_model\u003dnetwork)"},{"line_number":336,"context_line":"        return self._make_network_dict(network, process_extensions\u003dFalse,"},{"line_number":337,"context_line":"                                       context\u003dcontext)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_c11db067","line":334,"in_reply_to":"7a740942_38e86d7c","updated":"2015-12-04 03:29:20.000000000","message":"@Kevin, thanks, but if we still add code here, when we want to add some extension attributes to resources, the code here will be larger and larger. Should we just move the add operation into extension themselves? So I bring this way here. If you are interested in it, please see [1], it is about timestamp realize base on this way. And 1 more question, if we use standard attr table like \"resource.standard_attr.XXX(what you have increased attrs in db and model)\", and set our wished data into the resources?\n\n[1]https://review.openstack.org/#/c/213586/","commit_id":"77f212e5ac8dc63eb4930cf3c4922e525b954745"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"86da2a52e42f29f6bf64afa76dad7591a585a46d","unresolved":false,"context_lines":[{"line_number":331,"context_line":"                    target_tenant\u003d\u0027*\u0027, tenant_id\u003dnetwork[\u0027tenant_id\u0027])"},{"line_number":332,"context_line":"                context.session.add(entry)"},{"line_number":333,"context_line":"            context.session.add(network)"},{"line_number":334,"context_line":"        registry.notify(resources.STANDARD_ATTR, events.AFTER_CREATE,"},{"line_number":335,"context_line":"                        self, context\u003dcontext, db_model\u003dnetwork)"},{"line_number":336,"context_line":"        return self._make_network_dict(network, process_extensions\u003dFalse,"},{"line_number":337,"context_line":"                                       context\u003dcontext)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_77078581","line":334,"updated":"2016-01-08 22:49:21.000000000","message":"This notificaiton doesn\u0027t make sense. It\u0027s for the resource \u0027standard_attr\u0027, which implies that this is a notificaiton that a standard attribute was just created. However, it was just a network that was created, not a standard attr. The resource should be \u0027network\u0027.\n\nAlso, are you sure this should be done outside of the transaction? If this callback fails it will not rollback the transaction but an error will be returned to the user so you will have a half-formed object in the database that the user doesn\u0027t know was created. \nThis should be converted into a CREATE_PRECOMMIT event, moved inside the transaction, and the resource should match the resource being created.\n\nSame for the other resources and events.","commit_id":"a898a737d10ffab5bada886676e47be20e170dfa"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"1cbcb5b9706b9b09f1047463bccb0d547995c5d6","unresolved":false,"context_lines":[{"line_number":331,"context_line":"                    target_tenant\u003d\u0027*\u0027, tenant_id\u003dnetwork[\u0027tenant_id\u0027])"},{"line_number":332,"context_line":"                context.session.add(entry)"},{"line_number":333,"context_line":"            context.session.add(network)"},{"line_number":334,"context_line":"        registry.notify(resources.STANDARD_ATTR, events.AFTER_CREATE,"},{"line_number":335,"context_line":"                        self, context\u003dcontext, db_model\u003dnetwork)"},{"line_number":336,"context_line":"        return self._make_network_dict(network, process_extensions\u003dFalse,"},{"line_number":337,"context_line":"                                       context\u003dcontext)"}],"source_content_type":"text/x-python","patch_set":8,"id":"da6ed579_7c298f36","line":334,"in_reply_to":"fa69d971_77078581","updated":"2016-01-14 08:26:55.000000000","message":"Thanks for your analysis. It is true there is a big issue here, the current code can not cover the view if outside call is fail it will store a half object and not rollback. Thanks again for your suggestion towards when operate the resource  should notify the related resource info, but no another one, I will update this patch and make the following patches base on it.","commit_id":"a898a737d10ffab5bada886676e47be20e170dfa"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"af484fa569dfc284621d4791b80cc34288a074d5","unresolved":false,"context_lines":[{"line_number":1012,"context_line":"                    \u0027shared\u0027, \u0027default_quota\u0027, \u0027address_scope_id\u0027,"},{"line_number":1013,"context_line":"                    \u0027standard_attr\u0027]:"},{"line_number":1014,"context_line":"            self._write_key(key, updated, model, new_pool)"},{"line_number":1015,"context_line":"        if updated.get(\u0027standard_attr\u0027, None):"},{"line_number":1016,"context_line":"            self._apply_dict_extend_functions(attributes.SUBNETPOOLS,"},{"line_number":1017,"context_line":"                                              updated, model)"},{"line_number":1018,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_e7800849","line":1015,"updated":"2016-02-03 09:38:53.000000000","message":"Can you explain what this does? I don\u0027t understand when this would be None","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"219c398ced88a739817b70cb25c0a2be4f995830","unresolved":false,"context_lines":[{"line_number":1012,"context_line":"                    \u0027shared\u0027, \u0027default_quota\u0027, \u0027address_scope_id\u0027,"},{"line_number":1013,"context_line":"                    \u0027standard_attr\u0027]:"},{"line_number":1014,"context_line":"            self._write_key(key, updated, model, new_pool)"},{"line_number":1015,"context_line":"        if updated.get(\u0027standard_attr\u0027, None):"},{"line_number":1016,"context_line":"            self._apply_dict_extend_functions(attributes.SUBNETPOOLS,"},{"line_number":1017,"context_line":"                                              updated, model)"},{"line_number":1018,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_0282f252","line":1015,"in_reply_to":"5a5ae5dd_e7800849","updated":"2016-02-03 10:07:19.000000000","message":"It will never None now. This logic is for make the code more stable, but it will be removed now. I will remove it.","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"af3759583ea6316a41f5f028901938fb950180b2","unresolved":false,"context_lines":[{"line_number":1030,"context_line":""},{"line_number":1031,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1032,"context_line":"            orig_sp \u003d self._get_subnetpool(context, id)"},{"line_number":1033,"context_line":"            registry.notify(resources.SUBNETPOOL, events.UPDATE_PRECOMMIT,"},{"line_number":1034,"context_line":"                            self, context\u003dcontext, db_model\u003dorig_sp)"},{"line_number":1035,"context_line":"            updated \u003d self._updated_subnetpool_dict(orig_sp, new_sp)"},{"line_number":1036,"context_line":"            updated[\u0027tenant_id\u0027] \u003d orig_sp.tenant_id"}],"source_content_type":"text/x-python","patch_set":14,"id":"5a5ae5dd_5bf2de70","line":1033,"updated":"2016-02-04 08:34:50.000000000","message":"It seems like this notification should go after the actual update right before the context manager exits.","commit_id":"28150aecde2fa5c718b5b231e760fbd002e96be9"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"f6900bab69b3aa49d747688119a185de349aad28","unresolved":false,"context_lines":[{"line_number":1030,"context_line":""},{"line_number":1031,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1032,"context_line":"            orig_sp \u003d self._get_subnetpool(context, id)"},{"line_number":1033,"context_line":"            registry.notify(resources.SUBNETPOOL, events.UPDATE_PRECOMMIT,"},{"line_number":1034,"context_line":"                            self, context\u003dcontext, db_model\u003dorig_sp)"},{"line_number":1035,"context_line":"            updated \u003d self._updated_subnetpool_dict(orig_sp, new_sp)"},{"line_number":1036,"context_line":"            updated[\u0027tenant_id\u0027] \u003d orig_sp.tenant_id"}],"source_content_type":"text/x-python","patch_set":14,"id":"5a5ae5dd_5b409da5","line":1033,"in_reply_to":"5a5ae5dd_5bf2de70","updated":"2016-02-04 09:11:02.000000000","message":"But this function return the \"updated\"(return body) by orig_sp, and the following code just update this orig_sp, then updated(return body) will contain the old timestamp to return users. So I think change the field before \u0027updated\u0027 read from orig_sp, the db and return body will contain the new timestamp field directly. Or this way maybe not appropriate, need your review? Thanks","commit_id":"28150aecde2fa5c718b5b231e760fbd002e96be9"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"79cfd9517c11a4abc67016b66dd366fc8a4792cb","unresolved":false,"context_lines":[{"line_number":1012,"context_line":"                    \u0027shared\u0027, \u0027default_quota\u0027, \u0027address_scope_id\u0027,"},{"line_number":1013,"context_line":"                    \u0027standard_attr\u0027]:"},{"line_number":1014,"context_line":"            self._write_key(key, updated, model, new_pool)"},{"line_number":1015,"context_line":"        self._apply_dict_extend_functions(attributes.SUBNETPOOLS,"},{"line_number":1016,"context_line":"                                          updated, model)"},{"line_number":1017,"context_line":""},{"line_number":1018,"context_line":"        return updated"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a5ae5dd_03c7dd96","line":1015,"updated":"2016-02-05 09:32:24.000000000","message":"Lets move this to the next patch. it doesn\u0027t make much sense in the context of this patch that is mainly about adding the events","commit_id":"51bb1874a81ebb07741c74db4150962e03cfc09a"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"d2e04356883d86caac34f2a3062ed1fc49ddba74","unresolved":false,"context_lines":[{"line_number":1012,"context_line":"                    \u0027shared\u0027, \u0027default_quota\u0027, \u0027address_scope_id\u0027,"},{"line_number":1013,"context_line":"                    \u0027standard_attr\u0027]:"},{"line_number":1014,"context_line":"            self._write_key(key, updated, model, new_pool)"},{"line_number":1015,"context_line":"        self._apply_dict_extend_functions(attributes.SUBNETPOOLS,"},{"line_number":1016,"context_line":"                                          updated, model)"},{"line_number":1017,"context_line":""},{"line_number":1018,"context_line":"        return updated"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a5ae5dd_230c5940","line":1015,"in_reply_to":"5a5ae5dd_03c7dd96","updated":"2016-02-05 09:46:59.000000000","message":"Thanks , kevin. I will update this patch soon.","commit_id":"51bb1874a81ebb07741c74db4150962e03cfc09a"}],"neutron/db/standard_attr_common.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c2a0b9d29bfdba3cd893f03d63f234fadf65a2f5","unresolved":false,"context_lines":[{"line_number":14,"context_line":"import six"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def check_standardattr(plugin, context):"},{"line_number":18,"context_line":"    def args_decorator(func):"},{"line_number":19,"context_line":"        @functools.wraps(func)"},{"line_number":20,"context_line":"        def func_wrapper(result):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_f070ccde","line":17,"updated":"2015-11-30 18:43:12.000000000","message":"Can you tell me why you think this decorator is necessary? This is not readable and more importantly unnecessary. A \u0027standard attribute\u0027 should be treated just as any regular attribute of a resource. I don\u0027t understand why this level of dynamic indirection is necessary.","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"6013e8f144f153cec793ed55e1cb136450878eec","unresolved":false,"context_lines":[{"line_number":14,"context_line":"import six"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def check_standardattr(plugin, context):"},{"line_number":18,"context_line":"    def args_decorator(func):"},{"line_number":19,"context_line":"        @functools.wraps(func)"},{"line_number":20,"context_line":"        def func_wrapper(result):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_0572e27c","line":17,"in_reply_to":"9a8ffd7b_f070ccde","updated":"2015-12-01 02:56:00.000000000","message":"It is used for add the common attributes into returned info, as after the resources creation, the make_resource_dict function will specify the option \u0027process_extension\u0027 is False, this will lead to the returned info not contain the info from common attributes which as extensions. So these codes is used for add the related info to returned dict which is supported by core plugin.","commit_id":"0d5608db56e3ff6b7789dd818dfd8b5094301fd8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"af484fa569dfc284621d4791b80cc34288a074d5","unresolved":false,"context_lines":[{"line_number":14,"context_line":"import six"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def check_standardattr(plugin, context):"},{"line_number":18,"context_line":"    def args_decorator(func):"},{"line_number":19,"context_line":"        @functools.wraps(func)"},{"line_number":20,"context_line":"        def func_wrapper(result):"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_8796f492","line":17,"updated":"2016-02-03 09:38:53.000000000","message":"I think \u0027populate_standardattr\u0027 would probably be a more descriptive name for this. \u0027check\u0027 doesn\u0027t imply that it will add data","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"219c398ced88a739817b70cb25c0a2be4f995830","unresolved":false,"context_lines":[{"line_number":14,"context_line":"import six"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def check_standardattr(plugin, context):"},{"line_number":18,"context_line":"    def args_decorator(func):"},{"line_number":19,"context_line":"        @functools.wraps(func)"},{"line_number":20,"context_line":"        def func_wrapper(result):"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_22ee0e23","line":17,"in_reply_to":"5a5ae5dd_8796f492","updated":"2016-02-03 10:07:19.000000000","message":"Agree. I will modify it more correct.","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"125704b81c8da3a5a87c900908109d827a34c4b0","unresolved":false,"context_lines":[{"line_number":17,"context_line":"def check_standardattr(plugin, context):"},{"line_number":18,"context_line":"    def args_decorator(func):"},{"line_number":19,"context_line":"        @functools.wraps(func)"},{"line_number":20,"context_line":"        def func_wrapper(result):"},{"line_number":21,"context_line":"            add_standardattr_if_need(plugin, context, result)"},{"line_number":22,"context_line":"            return func(result)"},{"line_number":23,"context_line":"        return func_wrapper"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_6852a5df","line":20,"updated":"2016-02-03 10:26:56.000000000","message":"Whoops. This was half of a comment. After what I said in the API later, this decorator should just go away completely.","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"af484fa569dfc284621d4791b80cc34288a074d5","unresolved":false,"context_lines":[{"line_number":17,"context_line":"def check_standardattr(plugin, context):"},{"line_number":18,"context_line":"    def args_decorator(func):"},{"line_number":19,"context_line":"        @functools.wraps(func)"},{"line_number":20,"context_line":"        def func_wrapper(result):"},{"line_number":21,"context_line":"            add_standardattr_if_need(plugin, context, result)"},{"line_number":22,"context_line":"            return func(result)"},{"line_number":23,"context_line":"        return func_wrapper"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_a793f0a2","line":20,"updated":"2016-02-03 09:38:53.000000000","message":"even though this is only used in one place, you probably want to","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"8c853ae89968e6b75565252ae58e40a8a1dada54","unresolved":false,"context_lines":[{"line_number":17,"context_line":"def check_standardattr(plugin, context):"},{"line_number":18,"context_line":"    def args_decorator(func):"},{"line_number":19,"context_line":"        @functools.wraps(func)"},{"line_number":20,"context_line":"        def func_wrapper(result):"},{"line_number":21,"context_line":"            add_standardattr_if_need(plugin, context, result)"},{"line_number":22,"context_line":"            return func(result)"},{"line_number":23,"context_line":"        return func_wrapper"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_c8b5d97e","line":20,"in_reply_to":"5a5ae5dd_6852a5df","updated":"2016-02-03 10:46:32.000000000","message":"Yeah, this decorator should be removed.","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"219c398ced88a739817b70cb25c0a2be4f995830","unresolved":false,"context_lines":[{"line_number":17,"context_line":"def check_standardattr(plugin, context):"},{"line_number":18,"context_line":"    def args_decorator(func):"},{"line_number":19,"context_line":"        @functools.wraps(func)"},{"line_number":20,"context_line":"        def func_wrapper(result):"},{"line_number":21,"context_line":"            add_standardattr_if_need(plugin, context, result)"},{"line_number":22,"context_line":"            return func(result)"},{"line_number":23,"context_line":"        return func_wrapper"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_c2e61ae8","line":20,"in_reply_to":"5a5ae5dd_a793f0a2","updated":"2016-02-03 10:07:19.000000000","message":"This function is for add timestamp info in returned creation info when core plugin support timestamp, as if the extension just can be showed like \u0027net-show\u0027. So I think the creation info should contain the timestamp or other fields which based on standard_attr.","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"af484fa569dfc284621d4791b80cc34288a074d5","unresolved":false,"context_lines":[{"line_number":31,"context_line":"RESOURCE_CHECK_MAP \u003d {}"},{"line_number":32,"context_line":"PROCESS \u003d \u0027process\u0027"},{"line_number":33,"context_line":"FIELDS \u003d \u0027fields\u0027"},{"line_number":34,"context_line":"enabled_standard_attrs \u003d []"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def set_check_map(resourse_alias, process_func, fields):"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_4790fc95","line":34,"updated":"2016-02-03 09:38:53.000000000","message":"I would capitalize this since it\u0027s being handled like a global variable","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"af484fa569dfc284621d4791b80cc34288a074d5","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            enabled_standard_attrs.append(RESOURCE_CHECK_MAP[alias])"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"def check_1_standardattr_is_in_result(result, fields_list):"},{"line_number":52,"context_line":"    if any([field for field in fields_list if result.get(field, None)]):"},{"line_number":53,"context_line":"        return True"},{"line_number":54,"context_line":"    return False"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_678df87a","line":51,"updated":"2016-02-03 09:38:53.000000000","message":"this logic isn\u0027t standardattr specific so the name should just be something like \u0027result_contains_field\u0027\n\ndef result_contains_any_field(result, fields_list):\n    return any(field for field in fields_list if result.get(field))","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"219c398ced88a739817b70cb25c0a2be4f995830","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            enabled_standard_attrs.append(RESOURCE_CHECK_MAP[alias])"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"def check_1_standardattr_is_in_result(result, fields_list):"},{"line_number":52,"context_line":"    if any([field for field in fields_list if result.get(field, None)]):"},{"line_number":53,"context_line":"        return True"},{"line_number":54,"context_line":"    return False"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_826d8234","line":51,"in_reply_to":"5a5ae5dd_678df87a","updated":"2016-02-03 10:07:19.000000000","message":"Thanks. This name is too pool before. I will update this function name.:-)","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"125704b81c8da3a5a87c900908109d827a34c4b0","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def add_standardattr_if_need(plugin, context, result):"},{"line_number":58,"context_line":"    resource_type \u003d six.next(six.iterkeys(result))"},{"line_number":59,"context_line":"    # get the enabled plugin\u0027s extension which is standardattr of resources"},{"line_number":60,"context_line":"    # enabled_standard_attrs \u003d [{\u0027process\u0027: process_func, \u0027fields\u0027: fields}]"},{"line_number":61,"context_line":"    check_plugin_enabled_resource(plugin)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_085e91e9","line":58,"updated":"2016-02-03 10:26:56.000000000","message":"See my suggestion in the api file. The api is the only user of this and it can tell you the resource type.","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"af484fa569dfc284621d4791b80cc34288a074d5","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def add_standardattr_if_need(plugin, context, result):"},{"line_number":58,"context_line":"    resource_type \u003d six.next(six.iterkeys(result))"},{"line_number":59,"context_line":"    # get the enabled plugin\u0027s extension which is standardattr of resources"},{"line_number":60,"context_line":"    # enabled_standard_attrs \u003d [{\u0027process\u0027: process_func, \u0027fields\u0027: fields}]"},{"line_number":61,"context_line":"    check_plugin_enabled_resource(plugin)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_07e9a41a","line":58,"updated":"2016-02-03 09:38:53.000000000","message":"have caller pass in resource type","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"219c398ced88a739817b70cb25c0a2be4f995830","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def add_standardattr_if_need(plugin, context, result):"},{"line_number":58,"context_line":"    resource_type \u003d six.next(six.iterkeys(result))"},{"line_number":59,"context_line":"    # get the enabled plugin\u0027s extension which is standardattr of resources"},{"line_number":60,"context_line":"    # enabled_standard_attrs \u003d [{\u0027process\u0027: process_func, \u0027fields\u0027: fields}]"},{"line_number":61,"context_line":"    check_plugin_enabled_resource(plugin)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_cd6debcd","line":58,"in_reply_to":"5a5ae5dd_07e9a41a","updated":"2016-02-03 10:07:19.000000000","message":"Original, this function is used for 4 core resource type. We may don\u0027t know which resource type should pass in. It could be confirmed by result body. It get from the result the first key. This is the reason this line code here.","commit_id":"4f1d71245699812af530005b4543d715fca46de4"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"af3759583ea6316a41f5f028901938fb950180b2","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                                            resource_type)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def add_standard_attr_if_needed(context, plugin, resource_type, result):"},{"line_number":54,"context_line":"    resource_value \u003d None"},{"line_number":55,"context_line":"    resource_values_list \u003d None"},{"line_number":56,"context_line":"    # get the enabled plugin\u0027s extension which is standardattr of resources"}],"source_content_type":"text/x-python","patch_set":14,"id":"5a5ae5dd_fbe86a7e","line":53,"updated":"2016-02-04 08:34:50.000000000","message":"now that I understand we are going to use the regular dictionary extension functions, it\u0027s not clear to me why any of this is needed. Why would the API encounter a resource that has not been properly populated with the standard attr values?","commit_id":"28150aecde2fa5c718b5b231e760fbd002e96be9"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c72f3f583f4add547bb319b94902e65863a65c12","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                                            resource_type)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def add_standard_attr_if_needed(context, plugin, resource_type, result):"},{"line_number":54,"context_line":"    resource_value \u003d None"},{"line_number":55,"context_line":"    resource_values_list \u003d None"},{"line_number":56,"context_line":"    # get the enabled plugin\u0027s extension which is standardattr of resources"}],"source_content_type":"text/x-python","patch_set":14,"id":"5a5ae5dd_0f073b1d","line":53,"in_reply_to":"5a5ae5dd_fbe86a7e","updated":"2016-02-04 10:06:08.000000000","message":"Oh sorry, kevin. It must be relate with make_XXX_dict(process_extensions\u003dFalse), As this default option is True, but the return body will be processed by this func with process_extensions\u003dFalse specific, so the logic now is just set the field in db , it will not call the extend_XXX_dict. So the creation body doesn\u0027t contain the fields.","commit_id":"28150aecde2fa5c718b5b231e760fbd002e96be9"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"f6900bab69b3aa49d747688119a185de349aad28","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                                            resource_type)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def add_standard_attr_if_needed(context, plugin, resource_type, result):"},{"line_number":54,"context_line":"    resource_value \u003d None"},{"line_number":55,"context_line":"    resource_values_list \u003d None"},{"line_number":56,"context_line":"    # get the enabled plugin\u0027s extension which is standardattr of resources"}],"source_content_type":"text/x-python","patch_set":14,"id":"5a5ae5dd_febdb7d7","line":53,"in_reply_to":"5a5ae5dd_fbe86a7e","updated":"2016-02-04 09:11:02.000000000","message":"This maybe because that I set the timestamp access like:\nTIMESTAMP_BODY \u003d {\n    CREATED: {\u0027allow_post\u0027: False, \u0027allow_put\u0027: False,\n              \u0027is_visible\u0027: True, \u0027default\u0027: None\n              },\n    UPDATED: {\u0027allow_post\u0027: False, \u0027allow_put\u0027: False,\n              \u0027is_visible\u0027: True, \u0027default\u0027: None\n              },\n}\nSo the timestamp will not allow to set in request. The creation body returned should not contain the timestamp, it can be showed in show and list request. I saw the network_availability_zone extension is just like this case. So if we want to see timestamp field in creation body , we may do this.","commit_id":"28150aecde2fa5c718b5b231e760fbd002e96be9"}]}
