)]}'
{"neutron/objects/rbac_db.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1834543e773452a7c915dcaa3a729a67a3fac23f","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    @staticmethod"},{"line_number":55,"context_line":"    def is_network_shared(context, rbac_entries):"},{"line_number":56,"context_line":"        # NOTE(korzen) this method is copied from db_base_plugin_common."},{"line_number":57,"context_line":"        # The shared attribute for a network now reflects if the network"},{"line_number":58,"context_line":"        # is shared to the calling tenant via an RBAC entry."},{"line_number":59,"context_line":"        matches \u003d (\u0027*\u0027,) + ((context.tenant_id,) if context else ())"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_fcdf8c37","line":56,"updated":"2016-07-06 17:37:59.000000000","message":"why copying it? see comment on next PS","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"cadfbfc64105b08c9bf464c94f9dc62fdda2b96d","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    @staticmethod"},{"line_number":55,"context_line":"    def is_network_shared(context, rbac_entries):"},{"line_number":56,"context_line":"        # NOTE(korzen) this method is copied from db_base_plugin_common."},{"line_number":57,"context_line":"        # The shared attribute for a network now reflects if the network"},{"line_number":58,"context_line":"        # is shared to the calling tenant via an RBAC entry."},{"line_number":59,"context_line":"        matches \u003d (\u0027*\u0027,) + ((context.tenant_id,) if context else ())"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_3e974c91","line":56,"in_reply_to":"1aa78d24_fcdf8c37","updated":"2016-07-12 11:04:52.000000000","message":"I wanted it to be included in RBAC db code for single point of truth about RBAC. The other options is to use the code from db_base_plugin_common - what do you prefer?","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"52d83d17dcb736bc6de3b00197bf3230b37f46bf","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return False"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @staticmethod"},{"line_number":67,"context_line":"    def get_shared_with_tenant(context, rbac_db_model, obj_id, tenant_id):"},{"line_number":68,"context_line":"        # NOTE(korzen) This method enables to query within already started"},{"line_number":69,"context_line":"        # session"},{"line_number":70,"context_line":"        return (common_db_mixin.model_query(context, rbac_db_model).filter("}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_bfb8ffe9","line":67,"range":{"start_line":67,"start_character":63,"end_line":67,"end_character":72},"updated":"2016-07-07 22:47:38.000000000","message":"Shouldn\u0027t be better to start using project_id instead of tenant_id to help keystone V3 implementation?","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"cadfbfc64105b08c9bf464c94f9dc62fdda2b96d","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return False"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @staticmethod"},{"line_number":67,"context_line":"    def get_shared_with_tenant(context, rbac_db_model, obj_id, tenant_id):"},{"line_number":68,"context_line":"        # NOTE(korzen) This method enables to query within already started"},{"line_number":69,"context_line":"        # session"},{"line_number":70,"context_line":"        return (common_db_mixin.model_query(context, rbac_db_model).filter("}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_be821c50","line":67,"range":{"start_line":67,"start_character":63,"end_line":67,"end_character":72},"in_reply_to":"1aa78d24_bfb8ffe9","updated":"2016-07-12 11:04:52.000000000","message":"I can rename it to get_shared_with_project and project_id, but I\u0027m not sure how Rossella will feel about it. It will be mixing the tenant_id/project_id in one place...","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"c95f71fb777a80da886a46db905bf7ad7332be7b","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @classmethod"},{"line_number":77,"context_line":"    def is_shared_with_tenant(cls, context, obj_id, tenant_id):"},{"line_number":78,"context_line":"        ctx \u003d context.elevated()"},{"line_number":79,"context_line":"        rbac_db_model \u003d cls.rbac_db_model"},{"line_number":80,"context_line":"        with ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":81,"context_line":"            return cls.get_shared_with_tenant(ctx, rbac_db_model,"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_a849c18d","line":78,"updated":"2016-07-18 21:13:02.000000000","message":"FYI: coverage report shows this method isn\u0027t tested at all.","commit_id":"bd6d454154500039ee023ea515b8401a062cb8b2"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"ba0db04763f9cbf68bea6fdebb5204d61fe50814","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @classmethod"},{"line_number":77,"context_line":"    def is_shared_with_tenant(cls, context, obj_id, tenant_id):"},{"line_number":78,"context_line":"        ctx \u003d context.elevated()"},{"line_number":79,"context_line":"        rbac_db_model \u003d cls.rbac_db_model"},{"line_number":80,"context_line":"        with ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":81,"context_line":"            return cls.get_shared_with_tenant(ctx, rbac_db_model,"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_409a9064","line":78,"in_reply_to":"dada55a8_a849c18d","updated":"2016-07-19 06:13:26.000000000","message":"This method is not part of this patch, we can add UT in follow-up patch.","commit_id":"bd6d454154500039ee023ea515b8401a062cb8b2"}],"neutron/objects/subnet.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1834543e773452a7c915dcaa3a729a67a3fac23f","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        \u0027allocation_pools\u0027: obj_fields.ListOfObjectsField(\u0027IPAllocationPool\u0027,"},{"line_number":159,"context_line":"                                                          nullable\u003dTrue),"},{"line_number":160,"context_line":"        \u0027enable_dhcp\u0027: obj_fields.BooleanField(),"},{"line_number":161,"context_line":"        \u0027shared\u0027: obj_fields.BooleanField(nullable\u003dTrue),"},{"line_number":162,"context_line":"        \u0027dns_nameservers\u0027: obj_fields.ListOfObjectsField(\u0027DNSNameServer\u0027,"},{"line_number":163,"context_line":"                                                         nullable\u003dTrue),"},{"line_number":164,"context_line":"        \u0027host_routes\u0027: obj_fields.ListOfObjectsField(\u0027Route\u0027, nullable\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_7c727c12","line":161,"range":{"start_line":161,"start_character":8,"end_line":161,"end_character":16},"updated":"2016-07-06 17:37:59.000000000","message":"it should be in fields_no_update right?","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"cadfbfc64105b08c9bf464c94f9dc62fdda2b96d","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        \u0027allocation_pools\u0027: obj_fields.ListOfObjectsField(\u0027IPAllocationPool\u0027,"},{"line_number":159,"context_line":"                                                          nullable\u003dTrue),"},{"line_number":160,"context_line":"        \u0027enable_dhcp\u0027: obj_fields.BooleanField(),"},{"line_number":161,"context_line":"        \u0027shared\u0027: obj_fields.BooleanField(nullable\u003dTrue),"},{"line_number":162,"context_line":"        \u0027dns_nameservers\u0027: obj_fields.ListOfObjectsField(\u0027DNSNameServer\u0027,"},{"line_number":163,"context_line":"                                                         nullable\u003dTrue),"},{"line_number":164,"context_line":"        \u0027host_routes\u0027: obj_fields.ListOfObjectsField(\u0027Route\u0027, nullable\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_08c7ba98","line":161,"range":{"start_line":161,"start_character":8,"end_line":161,"end_character":16},"in_reply_to":"1aa78d24_7c727c12","updated":"2016-07-12 11:04:52.000000000","message":"shared is in synthetic_fields, so it is not update-able by default behavior in base class.","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"52d83d17dcb736bc6de3b00197bf3230b37f46bf","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            return self.load_shared()"},{"line_number":185,"context_line":"        super(Subnet, self).obj_load_attr(attrname)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def load_shared(self, db_model\u003dNone):"},{"line_number":188,"context_line":"        if db_model:"},{"line_number":189,"context_line":"            # NOTE(korzen) db_model is passed when Subnet object is loaded"},{"line_number":190,"context_line":"            # from DB"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_7a4a2557","line":187,"range":{"start_line":187,"start_character":9,"end_line":187,"end_character":19},"updated":"2016-07-07 22:47:38.000000000","message":"Isn\u0027t this method private?","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1834543e773452a7c915dcaa3a729a67a3fac23f","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            return self.load_shared()"},{"line_number":185,"context_line":"        super(Subnet, self).obj_load_attr(attrname)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def load_shared(self, db_model\u003dNone):"},{"line_number":188,"context_line":"        if db_model:"},{"line_number":189,"context_line":"            # NOTE(korzen) db_model is passed when Subnet object is loaded"},{"line_number":190,"context_line":"            # from DB"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_371aca7d","line":187,"range":{"start_line":187,"start_character":26,"end_line":187,"end_character":34},"updated":"2016-07-06 17:37:59.000000000","message":"the name is confusing it should be db_obj","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"cadfbfc64105b08c9bf464c94f9dc62fdda2b96d","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            return self.load_shared()"},{"line_number":185,"context_line":"        super(Subnet, self).obj_load_attr(attrname)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def load_shared(self, db_model\u003dNone):"},{"line_number":188,"context_line":"        if db_model:"},{"line_number":189,"context_line":"            # NOTE(korzen) db_model is passed when Subnet object is loaded"},{"line_number":190,"context_line":"            # from DB"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_9e2be081","line":187,"range":{"start_line":187,"start_character":9,"end_line":187,"end_character":19},"in_reply_to":"1aa78d24_7a4a2557","updated":"2016-07-12 11:04:52.000000000","message":"I guess it can be private, you should not be using load_shared outside of Subnet object code.","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1834543e773452a7c915dcaa3a729a67a3fac23f","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        if db_model:"},{"line_number":189,"context_line":"            # NOTE(korzen) db_model is passed when Subnet object is loaded"},{"line_number":190,"context_line":"            # from DB"},{"line_number":191,"context_line":"            rbac_entries \u003d db_model.get(\u0027rbac_entries\u0027) or {}"},{"line_number":192,"context_line":"            shared \u003d (rbac_db.RbacNeutronDbObjectMixin."},{"line_number":193,"context_line":"                      is_network_shared(self.obj_context, rbac_entries))"},{"line_number":194,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_fa32e7f0","line":191,"range":{"start_line":191,"start_character":40,"end_line":191,"end_character":54},"updated":"2016-07-06 17:37:59.000000000","message":"you could get \u0027networks\u0027 here and avoid to copy/paste the is_network_shared method","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"cadfbfc64105b08c9bf464c94f9dc62fdda2b96d","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        if db_model:"},{"line_number":189,"context_line":"            # NOTE(korzen) db_model is passed when Subnet object is loaded"},{"line_number":190,"context_line":"            # from DB"},{"line_number":191,"context_line":"            rbac_entries \u003d db_model.get(\u0027rbac_entries\u0027) or {}"},{"line_number":192,"context_line":"            shared \u003d (rbac_db.RbacNeutronDbObjectMixin."},{"line_number":193,"context_line":"                      is_network_shared(self.obj_context, rbac_entries))"},{"line_number":194,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_28a1d694","line":191,"range":{"start_line":191,"start_character":40,"end_line":191,"end_character":54},"in_reply_to":"1aa78d24_fa32e7f0","updated":"2016-07-12 11:04:52.000000000","message":"I do not understand, how get \u0027networks\u0027 here will resolve the need to copying the is_network_shared method? \u0027networks\u0027 does not have magical \u0027shared\u0027 attribute, \u0027networks\u0027 has also rbac_entries, which is the same as subnet rbac_entries, and we will still need to compute the shared state using the is_network_shared method.","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1834543e773452a7c915dcaa3a729a67a3fac23f","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            # NOTE(korzen) this case is used when Subnet object was"},{"line_number":196,"context_line":"            # instantiated and without DB interaction (get_object(s), update,"},{"line_number":197,"context_line":"            # create), it should be rare case to load \u0027shared\u0027 by that method"},{"line_number":198,"context_line":"            shared \u003d (rbac_db.RbacNeutronDbObjectMixin."},{"line_number":199,"context_line":"                      get_shared_with_tenant(self.obj_context.elevated(),"},{"line_number":200,"context_line":"                                             rbac_db_models.NetworkRBAC,"},{"line_number":201,"context_line":"                                             self.network_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_17386eee","line":198,"updated":"2016-07-06 17:37:59.000000000","message":"simply return self.shared? why do we need to go back to the db again? We should probably improve obj_load_attr in NeutronDbObject to take care of synthetic fields, but that\u0027s another story","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"cadfbfc64105b08c9bf464c94f9dc62fdda2b96d","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            # NOTE(korzen) this case is used when Subnet object was"},{"line_number":196,"context_line":"            # instantiated and without DB interaction (get_object(s), update,"},{"line_number":197,"context_line":"            # create), it should be rare case to load \u0027shared\u0027 by that method"},{"line_number":198,"context_line":"            shared \u003d (rbac_db.RbacNeutronDbObjectMixin."},{"line_number":199,"context_line":"                      get_shared_with_tenant(self.obj_context.elevated(),"},{"line_number":200,"context_line":"                                             rbac_db_models.NetworkRBAC,"},{"line_number":201,"context_line":"                                             self.network_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_6b8d98d2","line":198,"in_reply_to":"1aa78d24_17386eee","updated":"2016-07-12 11:04:52.000000000","message":"loading shared with extra db access will be triggered only when user of an object will try to access the shared attribute without calling create/update/get_object(s). for example:\n\nsubnet_obj \u003d subnet.Subnet(**subnet_data)\nsubnet_obj.shared\n\nIn above example, we cannot return self.shared because in object instantiated the \u0027shared\u0027 attribute is not set, so we do not have data to calculate the value, thus we need to query DB for network rbac entries.\n\nobj_load_attr in NeutronDbObject class will be called only when field is not set. For loading synthetic fields, we should provide a loading method to properly fill the field. Without source of data, we cannot do anything about what value should be set, we need to call the DB or whatever.","commit_id":"b03f6bb7689ecf645bf8d092463f4a78662667b6"}]}
