)]}'
{"glance/db/sqlalchemy/metadef_api/namespace.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"4f806dd774cbb8e0da94ea76691fc389e84a1799","unresolved":false,"context_lines":[{"line_number":259,"context_line":"    return namespace_rec.as_dict()"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"def delete_cascade(context, name, session):"},{"line_number":263,"context_line":"    \"\"\"Raise if not found, has references or not visible\"\"\""},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    namespace_rec \u003d _get_by_name(context, name, session)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_7b6116d2","line":262,"updated":"2014-10-08 10:00:34.000000000","message":"to keep consistent with the delete logic for resource_type.py , I trend to think we can rename this interface just to \u0027delete\u0027.","commit_id":"fbb3da5a7b7dfa017a8f56a220b5de4a65ed445b"},{"author":{"_account_id":10383,"name":"Wayne Okuma","email":"wayne.okuma@hpe.com","username":"okumaw"},"change_message_id":"f55fbcba53b6609b88c7e498f53d6b331981fbdc","unresolved":false,"context_lines":[{"line_number":259,"context_line":"    return namespace_rec.as_dict()"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"def delete_cascade(context, name, session):"},{"line_number":263,"context_line":"    \"\"\"Raise if not found, has references or not visible\"\"\""},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    namespace_rec \u003d _get_by_name(context, name, session)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_d246e5be","line":262,"in_reply_to":"baa201ad_7b6116d2","updated":"2015-07-07 03:03:26.000000000","message":"Done","commit_id":"fbb3da5a7b7dfa017a8f56a220b5de4a65ed445b"}],"glance/db/sqlalchemy/metadef_api/object.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"c8394e98e659ceb5df3c8d6e1d146085f2fd78c6","unresolved":false,"context_lines":[{"line_number":126,"context_line":"def delete(context, namespace_name, object_name, session):"},{"line_number":127,"context_line":"    namespace_api.get(context, namespace_name, session)"},{"line_number":128,"context_line":"    md_object \u003d _get_by_name(context, namespace_name, object_name, session)"},{"line_number":129,"context_line":"    md_object.delete(session\u003dsession)"},{"line_number":130,"context_line":"    return md_object.to_dict()"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_1fc1f1e3","line":129,"updated":"2015-07-09 18:30:38.000000000","message":"Alexey, I disagree. Keyword arguments are used elsewhere and often increase the clarity of the intent behind the code. Wayne is also not defining a variable here.","commit_id":"1238e2a3f95cba4db50385a095e1c3ea368fcd4a"},{"author":{"_account_id":16683,"name":"Alexey Galkin","email":"agalkin@mirantis.com","username":"agalkin"},"change_message_id":"31e9b036dc57eb6f23359b18fcc94088af8b35dc","unresolved":false,"context_lines":[{"line_number":126,"context_line":"def delete(context, namespace_name, object_name, session):"},{"line_number":127,"context_line":"    namespace_api.get(context, namespace_name, session)"},{"line_number":128,"context_line":"    md_object \u003d _get_by_name(context, namespace_name, object_name, session)"},{"line_number":129,"context_line":"    md_object.delete(session\u003dsession)"},{"line_number":130,"context_line":"    return md_object.to_dict()"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_ab578024","line":129,"updated":"2015-07-02 23:42:41.000000000","message":"It is not necessary to define a variable, it can be easier: md_object.delete(session)","commit_id":"1238e2a3f95cba4db50385a095e1c3ea368fcd4a"},{"author":{"_account_id":10383,"name":"Wayne Okuma","email":"wayne.okuma@hpe.com","username":"okumaw"},"change_message_id":"9dd130ac6fc7bed01aa0ff41d40da90d8b603ed2","unresolved":false,"context_lines":[{"line_number":126,"context_line":"def delete(context, namespace_name, object_name, session):"},{"line_number":127,"context_line":"    namespace_api.get(context, namespace_name, session)"},{"line_number":128,"context_line":"    md_object \u003d _get_by_name(context, namespace_name, object_name, session)"},{"line_number":129,"context_line":"    md_object.delete(session\u003dsession)"},{"line_number":130,"context_line":"    return md_object.to_dict()"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_155adb2a","line":129,"in_reply_to":"ba3cc151_ab578024","updated":"2015-07-07 03:03:36.000000000","message":"Done","commit_id":"1238e2a3f95cba4db50385a095e1c3ea368fcd4a"}],"glance/db/sqlalchemy/metadef_api/property.py":[{"author":{"_account_id":16683,"name":"Alexey Galkin","email":"agalkin@mirantis.com","username":"agalkin"},"change_message_id":"31e9b036dc57eb6f23359b18fcc94088af8b35dc","unresolved":false,"context_lines":[{"line_number":137,"context_line":"def delete(context, namespace_name, property_name, session):"},{"line_number":138,"context_line":"    property_rec \u003d _get_by_name("},{"line_number":139,"context_line":"        context, namespace_name, property_name, session)"},{"line_number":140,"context_line":"    property_rec.delete(session\u003dsession)"},{"line_number":141,"context_line":"    return property_rec.to_dict()"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_462269a4","line":140,"updated":"2015-07-02 23:42:41.000000000","message":"It is not necessary to define a variable, it can be easier: property_rec.delete(session)","commit_id":"1238e2a3f95cba4db50385a095e1c3ea368fcd4a"},{"author":{"_account_id":10383,"name":"Wayne Okuma","email":"wayne.okuma@hpe.com","username":"okumaw"},"change_message_id":"9dd130ac6fc7bed01aa0ff41d40da90d8b603ed2","unresolved":false,"context_lines":[{"line_number":137,"context_line":"def delete(context, namespace_name, property_name, session):"},{"line_number":138,"context_line":"    property_rec \u003d _get_by_name("},{"line_number":139,"context_line":"        context, namespace_name, property_name, session)"},{"line_number":140,"context_line":"    property_rec.delete(session\u003dsession)"},{"line_number":141,"context_line":"    return property_rec.to_dict()"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_d53c73c1","line":140,"in_reply_to":"ba3cc151_462269a4","updated":"2015-07-07 03:03:36.000000000","message":"Done","commit_id":"1238e2a3f95cba4db50385a095e1c3ea368fcd4a"}],"glance/db/sqlalchemy/metadef_api/resource_type.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"4f806dd774cbb8e0da94ea76691fc389e84a1799","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        raise exc.ProtectedMetadefResourceTypeSystemDelete("},{"line_number":113,"context_line":"            resource_type_name\u003dname)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    count \u003d _get_association_count(context, db_rec.id, session)"},{"line_number":116,"context_line":"    if count \u003e 0:"},{"line_number":117,"context_line":"        msg \u003d (\"Could not delete Metadata definition resource-type %s\""},{"line_number":118,"context_line":"               \". It is still associated with namespaces.\") % name"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_80764904","line":115,"updated":"2014-10-08 10:00:34.000000000","message":"I\u0027m worried on this approach due to it depends on calling time-window/sequence and has concurrent issue since the association count query and checking is not an atomic operation.","commit_id":"fbb3da5a7b7dfa017a8f56a220b5de4a65ed445b"},{"author":{"_account_id":16683,"name":"Alexey Galkin","email":"agalkin@mirantis.com","username":"agalkin"},"change_message_id":"31e9b036dc57eb6f23359b18fcc94088af8b35dc","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    \"\"\"Get a resource type, raise if not found\"\"\""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    db_req \u003d _get(context, name, session)"},{"line_number":47,"context_line":"    return db_req.to_dict()"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"def get_all(context, session):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_266de5cb","line":47,"updated":"2015-07-02 23:42:41.000000000","message":"probably it would be better use this: return _get(context, name, session).to_dict()","commit_id":"1238e2a3f95cba4db50385a095e1c3ea368fcd4a"},{"author":{"_account_id":10383,"name":"Wayne Okuma","email":"wayne.okuma@hpe.com","username":"okumaw"},"change_message_id":"9dd130ac6fc7bed01aa0ff41d40da90d8b603ed2","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    \"\"\"Get a resource type, raise if not found\"\"\""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    db_req \u003d _get(context, name, session)"},{"line_number":47,"context_line":"    return db_req.to_dict()"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"def get_all(context, session):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_d51b131b","line":47,"in_reply_to":"ba3cc151_266de5cb","updated":"2015-07-07 03:03:36.000000000","message":"Done","commit_id":"1238e2a3f95cba4db50385a095e1c3ea368fcd4a"},{"author":{"_account_id":15501,"name":"Long Quan Sha","email":"shalq@cn.ibm.com","username":"shalq"},"change_message_id":"cc5539642ffe41f2cc18e92f47b6b5c691f21717","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def delete(context, name, session):"},{"line_number":93,"context_line":"    \"\"\"Delete a resource type. Raise if not found,protected,has references\"\"\""},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    db_rec \u003d _get(context, name, session)"},{"line_number":96,"context_line":"    if db_rec.protected is True:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_ca573459","line":93,"updated":"2015-07-10 05:42:53.000000000","message":"Raise if not found,or protected,or has references","commit_id":"5cbf3095f802975155d91448204e1c7b327bba9e"},{"author":{"_account_id":10383,"name":"Wayne Okuma","email":"wayne.okuma@hpe.com","username":"okumaw"},"change_message_id":"514634849d4e4c5e55c6fc60fe015ce2ba75b7b3","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def delete(context, name, session):"},{"line_number":93,"context_line":"    \"\"\"Delete a resource type. Raise if not found,protected,has references\"\"\""},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    db_rec \u003d _get(context, name, session)"},{"line_number":96,"context_line":"    if db_rec.protected is True:"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_0aa792aa","line":93,"in_reply_to":"ba3cc151_ca573459","updated":"2015-08-21 02:24:45.000000000","message":"Done","commit_id":"5cbf3095f802975155d91448204e1c7b327bba9e"}],"glance/db/sqlalchemy/metadef_api/resource_type_association.py":[{"author":{"_account_id":16683,"name":"Alexey Galkin","email":"agalkin@mirantis.com","username":"agalkin"},"change_message_id":"31e9b036dc57eb6f23359b18fcc94088af8b35dc","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    db_rec \u003d _get(context, namespace_name, resource_type_name,"},{"line_number":116,"context_line":"                  namespace_id, resource_type_id, session)"},{"line_number":117,"context_line":"    db_rec.delete(session\u003dsession)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    return db_rec.to_dict()"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_e66b7db5","line":117,"updated":"2015-07-02 23:42:41.000000000","message":"It is not necessary to define a variable, it can be easier: db_rec.delete(session)","commit_id":"1238e2a3f95cba4db50385a095e1c3ea368fcd4a"},{"author":{"_account_id":10383,"name":"Wayne Okuma","email":"wayne.okuma@hpe.com","username":"okumaw"},"change_message_id":"9dd130ac6fc7bed01aa0ff41d40da90d8b603ed2","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    db_rec \u003d _get(context, namespace_name, resource_type_name,"},{"line_number":116,"context_line":"                  namespace_id, resource_type_id, session)"},{"line_number":117,"context_line":"    db_rec.delete(session\u003dsession)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    return db_rec.to_dict()"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_f56df7cc","line":117,"in_reply_to":"ba3cc151_e66b7db5","updated":"2015-07-07 03:03:36.000000000","message":"Done","commit_id":"1238e2a3f95cba4db50385a095e1c3ea368fcd4a"}],"glance/db/sqlalchemy/models_metadef.py":[{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"4701f70170a9c5d22a3808583cc04c3a750a87d7","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    __protected_attributes__ \u003d set([\"created_at\", \"updated_at\"])"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def delete(self, session\u003dNone):"},{"line_number":55,"context_line":"        from glance.db.sqlalchemy import api as db_api"},{"line_number":56,"context_line":"        session \u003d session or db_api.get_session()"},{"line_number":57,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":58,"context_line":"            session.delete(self)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da9df570_9d5b4ff5","line":55,"updated":"2014-09-26 07:09:02.000000000","message":"Is there real need to do the import here rather than normally at the top of the file? If so, could you please add comment explaining that.","commit_id":"fbb3da5a7b7dfa017a8f56a220b5de4a65ed445b"},{"author":{"_account_id":10383,"name":"Wayne Okuma","email":"wayne.okuma@hpe.com","username":"okumaw"},"change_message_id":"ea44945b9e99d2606e65b34c45ba2b5a31fdf69a","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    __protected_attributes__ \u003d set([\"created_at\", \"updated_at\"])"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def delete(self, session\u003dNone):"},{"line_number":55,"context_line":"        from glance.db.sqlalchemy import api as db_api"},{"line_number":56,"context_line":"        session \u003d session or db_api.get_session()"},{"line_number":57,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":58,"context_line":"            session.delete(self)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da9df570_a580e4c0","line":55,"in_reply_to":"da9df570_9d5b4ff5","updated":"2014-10-03 22:29:25.000000000","message":"I had tried importing at the top of the file (both direct import and from...import), but, ran into circular dependency issues. I wound up following the same strategy used in the GlanceBase.save() def in model.py - i.e. to have the from..import within the delete def to get around the circular dependency.","commit_id":"fbb3da5a7b7dfa017a8f56a220b5de4a65ed445b"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"93755d8628de287c5fb31c35fe614d052b9e49ff","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    __protected_attributes__ \u003d set([\"created_at\", \"updated_at\"])"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def delete(self, session\u003dNone):"},{"line_number":55,"context_line":"        from glance.db.sqlalchemy import api as db_api"},{"line_number":56,"context_line":"        session \u003d session or db_api.get_session()"},{"line_number":57,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":58,"context_line":"            session.delete(self)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_81f856c4","line":55,"in_reply_to":"da9df570_a580e4c0","updated":"2014-10-05 01:55:12.000000000","message":"Thanks for the explanation. If this solves it, so be it ;)","commit_id":"fbb3da5a7b7dfa017a8f56a220b5de4a65ed445b"}],"glance/tests/functional/db/base_metadef.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"4f806dd774cbb8e0da94ea76691fc389e84a1799","unresolved":false,"context_lines":[{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        self.assertRaises(exception.NotFound,"},{"line_number":192,"context_line":"                          self.db_api.metadef_namespace_get,"},{"line_number":193,"context_line":"                          self.context, deleted_ns[\u0027namespace\u0027])"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"class MetadefPropertyTests(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_db3da290","line":193,"updated":"2014-10-08 10:00:34.000000000","message":"1. Can we add a negative test case for cascade deletion for namespace entry which like what you did in test_resource_type_delete_with_associations?\n\n2. IMO we could check if an exception.MetadefIntegrityError exception was raised up in this negative case, so I think we need to keep the conversion logic for sa_exc.IntegrityError\u0027 \u003d\u003e exc.MetadefIntegrityError in glance.db.sqlalchemy.metadef_api.namespace.def delete_cascade().","commit_id":"fbb3da5a7b7dfa017a8f56a220b5de4a65ed445b"}]}
