)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"26e1a35448212b3ef833afc19723d1ce8139d929","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"Few minor changes need to be added to Glance side:"},{"line_number":43,"context_line":"Change Ibbc85b6bc2ea98c564d316db2874d7df5aac32a6 ."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"docImpact"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"Change-Id: Iedf0d4f829e46ca64c3f4fc6a7dfee54d9b0605b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"1a930d6b_db27c862","line":44,"updated":"2015-01-23 17:42:28.000000000","message":"Should also mention: \"Implements: blueprint store-capabilities\"","commit_id":"b8e63c84ff8012218d347c3a7f2a2882d575e72a"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"044368f483e6e98137f095fc2621e685fa30e4b0","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"Few minor changes need to be added to Glance side:"},{"line_number":43,"context_line":"Change Ibbc85b6bc2ea98c564d316db2874d7df5aac32a6 ."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"docImpact"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"Change-Id: Iedf0d4f829e46ca64c3f4fc6a7dfee54d9b0605b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"1a930d6b_cce9d081","line":44,"in_reply_to":"1a930d6b_db27c862","updated":"2015-01-23 18:09:47.000000000","message":"Done","commit_id":"b8e63c84ff8012218d347c3a7f2a2882d575e72a"}],"glance_store/_drivers/cinder.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"53ac6f0152796ac653b2bbeab309d9a8cabe88da","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    \"\"\"Cinder backend store adapter.\"\"\""},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    _CAPABILITIES \u003d capabilities.DRIVER_REUSABLE"},{"line_number":135,"context_line":"    OPTIONS \u003d _CINDER_OPTS"},{"line_number":136,"context_line":"    EXAMPLE_URL \u003d \"cinder://\u003cVOLUME_ID\u003e\""},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_b85b47f5","line":134,"updated":"2014-12-26 15:29:07.000000000","message":"Why aren\u0027t we following the rest of the style and calling this \"CAPABILITIES\"?","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"93246312d3ffd0e188c06dca27ef8ff3c48e3908","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    \"\"\"Cinder backend store adapter.\"\"\""},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    _CAPABILITIES \u003d capabilities.DRIVER_REUSABLE"},{"line_number":135,"context_line":"    OPTIONS \u003d _CINDER_OPTS"},{"line_number":136,"context_line":"    EXAMPLE_URL \u003d \"cinder://\u003cVOLUME_ID\u003e\""},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_8b1e1b0c","line":134,"in_reply_to":"3a961159_4b351ada","updated":"2014-12-30 00:07:16.000000000","message":"Ah you meant the rest of the class attributes (OPTIONS, EXAMPLE_URL). The reason is that `driver.Store` *is* a public interface an we don\u0027t want implementations (or users of those stores, to manipulate `CAPABILITIES` in any way.\n\nIt can be argue that it doesn\u0027t need to be private because `_drivers` is a private package already. However, there could be external drivers implementations.\n\nIt\u0027s just re-enforcing the fact that `_CAPABILITIES` should be modified through the capabilities api and not by accessing this attribute.","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"bf78c2f66c173a5beacdbb432db7ef6aef82dc3a","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    \"\"\"Cinder backend store adapter.\"\"\""},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    _CAPABILITIES \u003d capabilities.DRIVER_REUSABLE"},{"line_number":135,"context_line":"    OPTIONS \u003d _CINDER_OPTS"},{"line_number":136,"context_line":"    EXAMPLE_URL \u003d \"cinder://\u003cVOLUME_ID\u003e\""},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_d150d0d6","line":134,"in_reply_to":"3a961159_8b1e1b0c","updated":"2014-12-30 03:55:53.000000000","message":"Thanks for all your explanations here flaper87.","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"45257c5d0105f6d4997cffc18a78040aedcc5cca","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    \"\"\"Cinder backend store adapter.\"\"\""},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    _CAPABILITIES \u003d capabilities.DRIVER_REUSABLE"},{"line_number":135,"context_line":"    OPTIONS \u003d _CINDER_OPTS"},{"line_number":136,"context_line":"    EXAMPLE_URL \u003d \"cinder://\u003cVOLUME_ID\u003e\""},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_df8b8b1c","line":134,"in_reply_to":"3a961159_b85b47f5","updated":"2014-12-29 10:02:45.000000000","message":"/me confused\n\nAll other stores have `_CAPABILITIES` :S","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"ed394362dafc18ffd7cd5b361f7e1b0a915bd44b","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    \"\"\"Cinder backend store adapter.\"\"\""},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    _CAPABILITIES \u003d capabilities.DRIVER_REUSABLE"},{"line_number":135,"context_line":"    OPTIONS \u003d _CINDER_OPTS"},{"line_number":136,"context_line":"    EXAMPLE_URL \u003d \"cinder://\u003cVOLUME_ID\u003e\""},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_4b351ada","line":134,"in_reply_to":"3a961159_df8b8b1c","updated":"2014-12-29 15:55:34.000000000","message":"I\u0027m confused as to why this is a private attribute across all of them. I didn\u0027t see a need to comment on each instance of this. :)","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"}],"glance_store/backend.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"dcfa32cd9d1918c182f544551361ff6db1672bb2","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        raise exceptions.UnknownScheme(scheme\u003dscheme)"},{"line_number":237,"context_line":"    scheme_info \u003d location.SCHEME_TO_CLS_MAP[scheme]"},{"line_number":238,"context_line":"    store \u003d scheme_info[\u0027store\u0027]"},{"line_number":239,"context_line":"    if not store.capable(capabilities.DRIVER_REUSABLE):"},{"line_number":240,"context_line":"        # Driver instance isn\u0027t stateless so it can\u0027t"},{"line_number":241,"context_line":"        # be reused safely and need recreation."},{"line_number":242,"context_line":"        store_entry \u003d scheme_info[\u0027store_entry\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_c860cca7","line":239,"updated":"2014-12-11 08:01:12.000000000","message":"In the refactor of this API, I\u0027d really like to make all store\u0027s stateless.","commit_id":"5bdd62cd8a08ef40a6f89fade434344db97ad60f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"554d9f06a62cd237f2c3f1c08d1af18d688c2b26","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        raise exceptions.UnknownScheme(scheme\u003dscheme)"},{"line_number":237,"context_line":"    scheme_info \u003d location.SCHEME_TO_CLS_MAP[scheme]"},{"line_number":238,"context_line":"    store \u003d scheme_info[\u0027store\u0027]"},{"line_number":239,"context_line":"    if not store.capable(capabilities.DRIVER_REUSABLE):"},{"line_number":240,"context_line":"        # Driver instance isn\u0027t stateless so it can\u0027t"},{"line_number":241,"context_line":"        # be reused safely and need recreation."},{"line_number":242,"context_line":"        store_entry \u003d scheme_info[\u0027store_entry\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_1ca808da","line":239,"in_reply_to":"3a961159_c860cca7","updated":"2014-12-13 15:22:16.000000000","message":"Sounds a nice plan.","commit_id":"5bdd62cd8a08ef40a6f89fade434344db97ad60f"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"83bd0ced438d1e30a68072a101014ff6b65a45f6","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                      \"defined by the \u0027stores\u0027 config option.\"),"},{"line_number":47,"context_line":"               deprecated_opts\u003d[_DEPRECATED_STORE_OPTS[1]]),"},{"line_number":48,"context_line":"    cfg.IntOpt(\u0027store_capabilities_update_min_interval\u0027, default\u003d60,"},{"line_number":49,"context_line":"               help\u003d_(\"Minimum interval seconds to execute updating \""},{"line_number":50,"context_line":"                      \"dynamic storage capabilities based on backend \""},{"line_number":51,"context_line":"                      \"status then. It\u0027s not a periodic routine, the \""},{"line_number":52,"context_line":"                      \"update logic will be executed only when interval \""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_88da0f76","line":49,"updated":"2014-12-22 22:32:21.000000000","message":"I still don\u0027t understand why we need this :(\n\nAlso, if we really need it, I\u0027d probably set it to 0 (off) by default.","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"6cef13e052d4e1c697f8a536f07da5b22743935f","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                      \"defined by the \u0027stores\u0027 config option.\"),"},{"line_number":47,"context_line":"               deprecated_opts\u003d[_DEPRECATED_STORE_OPTS[1]]),"},{"line_number":48,"context_line":"    cfg.IntOpt(\u0027store_capabilities_update_min_interval\u0027, default\u003d60,"},{"line_number":49,"context_line":"               help\u003d_(\"Minimum interval seconds to execute updating \""},{"line_number":50,"context_line":"                      \"dynamic storage capabilities based on backend \""},{"line_number":51,"context_line":"                      \"status then. It\u0027s not a periodic routine, the \""},{"line_number":52,"context_line":"                      \"update logic will be executed only when interval \""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_ccf33d71","line":49,"in_reply_to":"3a961159_88da0f76","updated":"2014-12-23 07:08:11.000000000","message":"Sorry, just forgot to set default value to 0.\n\nA main point of the requirement of this option is about performance, without this minmial internal, the update callback of store will be triggered by every call on store operation.","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"83bd0ced438d1e30a68072a101014ff6b65a45f6","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        store_entry \u003d scheme_info[\u0027store_entry\u0027]"},{"line_number":252,"context_line":"        store \u003d _load_store(store.conf, store_entry, invoke_load\u003dTrue)"},{"line_number":253,"context_line":"        store.configure()"},{"line_number":254,"context_line":"        store.update_capabilities()"},{"line_number":255,"context_line":"        try:"},{"line_number":256,"context_line":"            scheme_map \u003d {}"},{"line_number":257,"context_line":"            loc_cls \u003d store.get_store_location_class()"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_c8b7b71f","line":254,"updated":"2014-12-22 22:32:21.000000000","message":"can we move this `update_capabilities` call at the end of the `configure` method ?\n\nI\u0027d like to reduce the \"steps\" required to setup a `Store`","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"6cef13e052d4e1c697f8a536f07da5b22743935f","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        store_entry \u003d scheme_info[\u0027store_entry\u0027]"},{"line_number":252,"context_line":"        store \u003d _load_store(store.conf, store_entry, invoke_load\u003dTrue)"},{"line_number":253,"context_line":"        store.configure()"},{"line_number":254,"context_line":"        store.update_capabilities()"},{"line_number":255,"context_line":"        try:"},{"line_number":256,"context_line":"            scheme_map \u003d {}"},{"line_number":257,"context_line":"            loc_cls \u003d store.get_store_location_class()"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_2c7921c8","line":254,"in_reply_to":"3a961159_c8b7b71f","updated":"2014-12-23 07:08:11.000000000","message":"I think it could be, a little concern to me for that way is that that will requires store driver/sub-class calls super.configure() explicitly, without it `update_capabilities` call/logic of store driver/sub-class will miss, but I think we could accept it. Will do in next PS.","commit_id":"214d975c241cf31fdd864fb614267431240f0605"}],"glance_store/capabilities.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"dcfa32cd9d1918c182f544551361ff6db1672bb2","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"# Store capability constants"},{"line_number":28,"context_line":"READ_ACCESS \u003d 0x00000001"},{"line_number":29,"context_line":"WRITE_ACCESS \u003d 0x00000002"},{"line_number":30,"context_line":"RW_ACCESS \u003d 0x00000003  # READ_ACCESS | WRITE_ACCESS"},{"line_number":31,"context_line":"READ_OFFSET \u003d 0x00000005  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_0d6ca607","line":28,"updated":"2014-12-11 08:01:12.000000000","message":"What\u0027s the benefit of using bits? Can we just use an enum?\n\nI recently did something similar for Zaqar and I went with an enum.","commit_id":"5bdd62cd8a08ef40a6f89fade434344db97ad60f"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"f639cb75eff19ce614d599233848f16f6526a7b5","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"# Store capability constants"},{"line_number":28,"context_line":"READ_ACCESS \u003d 0x00000001"},{"line_number":29,"context_line":"WRITE_ACCESS \u003d 0x00000002"},{"line_number":30,"context_line":"RW_ACCESS \u003d 0x00000003  # READ_ACCESS | WRITE_ACCESS"},{"line_number":31,"context_line":"READ_OFFSET \u003d 0x00000005  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_f5c39554","line":28,"in_reply_to":"3a961159_0d6ca607","updated":"2014-12-11 12:44:36.000000000","message":"one more comment on this. If we really want to go down the route of using bits. Can we go with binary nibbles instead of hex numbers?","commit_id":"5bdd62cd8a08ef40a6f89fade434344db97ad60f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"554d9f06a62cd237f2c3f1c08d1af18d688c2b26","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"# Store capability constants"},{"line_number":28,"context_line":"READ_ACCESS \u003d 0x00000001"},{"line_number":29,"context_line":"WRITE_ACCESS \u003d 0x00000002"},{"line_number":30,"context_line":"RW_ACCESS \u003d 0x00000003  # READ_ACCESS | WRITE_ACCESS"},{"line_number":31,"context_line":"READ_OFFSET \u003d 0x00000005  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_5cad30e8","line":28,"in_reply_to":"3a961159_312efb43","updated":"2014-12-13 15:22:16.000000000","message":"Thanks for the inputs Flavio and Brian.\n\nAs I talked with Flavio in IRC, I will replace to use binary nibbles here to make it more clear, hopefully. And agreed the binary-bit way is a little hard to understand at first look.","commit_id":"5bdd62cd8a08ef40a6f89fade434344db97ad60f"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"33ad36d6c9af6a8d02f9bebb7fb6e82c0106360f","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"# Store capability constants"},{"line_number":28,"context_line":"READ_ACCESS \u003d 0x00000001"},{"line_number":29,"context_line":"WRITE_ACCESS \u003d 0x00000002"},{"line_number":30,"context_line":"RW_ACCESS \u003d 0x00000003  # READ_ACCESS | WRITE_ACCESS"},{"line_number":31,"context_line":"READ_OFFSET \u003d 0x00000005  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_312efb43","line":28,"in_reply_to":"3a961159_f5c39554","updated":"2014-12-11 23:32:38.000000000","message":"I agree, at least put the nibbles in a comment so it\u0027s obvious what\u0027s going on.\n\nAn enum would be more clear as a simple list of capabilities, but then we\u0027d lose the inclusion relationships between capabilities that you\u0027ve cleverly worked out in binary.","commit_id":"5bdd62cd8a08ef40a6f89fade434344db97ad60f"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"dcfa32cd9d1918c182f544551361ff6db1672bb2","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    def __init__(self):"},{"line_number":46,"context_line":"        # Static store capabilities base on"},{"line_number":47,"context_line":"        # current driver implementation."},{"line_number":48,"context_line":"        self._capabilities \u003d getattr(self.__class__, \"_CAPABILITIES\", 0)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    @property"},{"line_number":51,"context_line":"    def capabilities(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_48df7c69","line":48,"updated":"2014-12-11 08:01:12.000000000","message":"What about adding `_CAPABILITIES` to the base class?\n\nI mean, each store should define the base capabilities they support, then these capabilities list would be updated based on the configs and whatnot.\n\nTake a look at: https://review.openstack.org/#/c/135637/5/zaqar/storage/redis/driver.py,cm","commit_id":"5bdd62cd8a08ef40a6f89fade434344db97ad60f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"554d9f06a62cd237f2c3f1c08d1af18d688c2b26","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    def __init__(self):"},{"line_number":46,"context_line":"        # Static store capabilities base on"},{"line_number":47,"context_line":"        # current driver implementation."},{"line_number":48,"context_line":"        self._capabilities \u003d getattr(self.__class__, \"_CAPABILITIES\", 0)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    @property"},{"line_number":51,"context_line":"    def capabilities(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_fcf25c04","line":48,"in_reply_to":"3a961159_48df7c69","updated":"2014-12-13 15:22:16.000000000","message":"\u003e\u003e each store should define the base capabilities they support, then these capabilities list would be updated based on the configs and whatnot.\n\nIn this change, I added proper static/base capabilities to each store drive.\n\n\u003e\u003e What about adding `_CAPABILITIES` to the base class?\n\nHowever due to there\u0027s no intersection of their capability set under current implementation of drivers, I didn\u0027t add \u0027_CAPABILITIES\u0027 to base driver class, it\u0027s empty, so it\u0027s redundant, IMO.\n\nIf I miss anything pls let me know it, thanks.","commit_id":"5bdd62cd8a08ef40a6f89fade434344db97ad60f"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"dcfa32cd9d1918c182f544551361ff6db1672bb2","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    @staticmethod"},{"line_number":55,"context_line":"    def _x_contains_y(x, y):"},{"line_number":56,"context_line":"        return x \u0026 y \u003e 0"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def capable(self, *capabilities):"},{"line_number":59,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_68951886","line":56,"updated":"2014-12-11 08:01:12.000000000","message":"With an enum, this would be a matter of doing:\n\n   return y in x\n\nWhere `x` is the enum with the supported capabilities.","commit_id":"5bdd62cd8a08ef40a6f89fade434344db97ad60f"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"dcfa32cd9d1918c182f544551361ff6db1672bb2","unresolved":false,"context_lines":[{"line_number":105,"context_line":"def check(store_op_fun):"},{"line_number":106,"context_line":"    def op_checker(driver, *args, **kwargs):"},{"line_number":107,"context_line":"        op \u003d store_op_fun.__name__.lower()"},{"line_number":108,"context_line":"        if op \u003d\u003d \u0027get\u0027:"},{"line_number":109,"context_line":"            if not driver.capable(READ_ACCESS):"},{"line_number":110,"context_line":"                raise exceptions.StoreGetNotSupported"},{"line_number":111,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_e854a800","line":108,"updated":"2014-12-11 08:01:12.000000000","message":"We could have a dictionary mapping function names to capabilities.\n\n  mapping \u003d {\n    \u0027get\u0027: READ_ACCESS\n  }\n\n  driver.capable(mapping.get(op))\n\nWe could also make it return a list of tuples of things to check:\n\n   mapping \u003d {\n      \u0027get\u0027: [(None, READ_ACCESS), (\u0027offset\u0027, READ_OFFSET)...]\n   }\n\n\nIn the last example, None means it has to have that capability regardless of the params passed, whereas in the offset case, it\u0027d check for READ_OFFSET *just* if the offset kwarg is passed.\n\nIt\u0027s just a way to avoid all these `if`s and have something more descriptive.","commit_id":"5bdd62cd8a08ef40a6f89fade434344db97ad60f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"554d9f06a62cd237f2c3f1c08d1af18d688c2b26","unresolved":false,"context_lines":[{"line_number":105,"context_line":"def check(store_op_fun):"},{"line_number":106,"context_line":"    def op_checker(driver, *args, **kwargs):"},{"line_number":107,"context_line":"        op \u003d store_op_fun.__name__.lower()"},{"line_number":108,"context_line":"        if op \u003d\u003d \u0027get\u0027:"},{"line_number":109,"context_line":"            if not driver.capable(READ_ACCESS):"},{"line_number":110,"context_line":"                raise exceptions.StoreGetNotSupported"},{"line_number":111,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_9c14f8e9","line":108,"in_reply_to":"3a961159_e854a800","updated":"2014-12-13 15:22:16.000000000","message":"Done","commit_id":"5bdd62cd8a08ef40a6f89fade434344db97ad60f"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"29b6f0679b0d7f6b78402f59900c4046ad72d30b","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    def _x_contains_y(x, y):"},{"line_number":57,"context_line":"        return x \u0026 y \u003e 0"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def capable(self, *capabilities):"},{"line_number":60,"context_line":"        \"\"\""},{"line_number":61,"context_line":"        Check if requested capability(s) are supported by"},{"line_number":62,"context_line":"        current driver instance."}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_e16b621d","line":59,"updated":"2014-12-16 05:03:57.000000000","message":"nitpick: maybe this is not convention, but I think it would be easier to know what this function did if it said is_capable.  Otherwise, when I first read it, I thought that this might be how you set the capabilities.","commit_id":"d106e4a42cfdedc999c2bc3b444892c5c76f5f14"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"9a3b472f50fc2e112a47b3ba0414f693aa67e37e","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    def _x_contains_y(x, y):"},{"line_number":57,"context_line":"        return x \u0026 y \u003e 0"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def capable(self, *capabilities):"},{"line_number":60,"context_line":"        \"\"\""},{"line_number":61,"context_line":"        Check if requested capability(s) are supported by"},{"line_number":62,"context_line":"        current driver instance."}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_21056a14","line":59,"in_reply_to":"3a961159_e16b621d","updated":"2014-12-16 05:34:02.000000000","message":"Renamed.","commit_id":"d106e4a42cfdedc999c2bc3b444892c5c76f5f14"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"29b6f0679b0d7f6b78402f59900c4046ad72d30b","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    def set_capabilities(self, *capabilities):"},{"line_number":75,"context_line":"        \"\"\""},{"line_number":76,"context_line":"        Set dynamic storage capabilities base on current"},{"line_number":77,"context_line":"        driver configuration and backend status."},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        :param capabilities: dynamic storage capability(s)."},{"line_number":80,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_01694e25","line":77,"updated":"2014-12-16 05:03:57.000000000","message":"nitpick: base should be \"based\"","commit_id":"d106e4a42cfdedc999c2bc3b444892c5c76f5f14"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"9a3b472f50fc2e112a47b3ba0414f693aa67e37e","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    def set_capabilities(self, *capabilities):"},{"line_number":75,"context_line":"        \"\"\""},{"line_number":76,"context_line":"        Set dynamic storage capabilities base on current"},{"line_number":77,"context_line":"        driver configuration and backend status."},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        :param capabilities: dynamic storage capability(s)."},{"line_number":80,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_c1166655","line":77,"in_reply_to":"3a961159_01694e25","updated":"2014-12-16 05:34:02.000000000","message":"Done","commit_id":"d106e4a42cfdedc999c2bc3b444892c5c76f5f14"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"83bd0ced438d1e30a68072a101014ff6b65a45f6","unresolved":false,"context_lines":[{"line_number":29,"context_line":"_STORE_CAPABILITES_UPDATE_SCHEDULING_LOCK \u003d threading.Lock()"},{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE            \u003d 0b00000000  # flake8: noqa"},{"line_number":34,"context_line":"READ_ACCESS     \u003d 0b00000001"},{"line_number":35,"context_line":"WRITE_ACCESS    \u003d 0b00000010"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_830af787","line":32,"updated":"2014-12-22 22:32:21.000000000","message":"Can we group the bits in categories?\n\nInstead of having:\n      \n\n        \n\t0b00000000\n\t        ^^\n\t        |------------ read\n\t        |\n\t        ------------- write\n\n\nWe can group them by write permissions and read permissions. Therefore, the first nibble is used for read capabilities and the second one for write capabilities:\n\n\n\n\n\t0b00000000\n\t     ^   ^\n\t     |   ------------ read\n\t     |\n\t     -------------- write\n\n\nThis will make reading the nibbles easier and intuitive","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"352369bf5c928703ca3127d70d38f990d35ad895","unresolved":false,"context_lines":[{"line_number":29,"context_line":"_STORE_CAPABILITES_UPDATE_SCHEDULING_LOCK \u003d threading.Lock()"},{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE            \u003d 0b00000000  # flake8: noqa"},{"line_number":34,"context_line":"READ_ACCESS     \u003d 0b00000001"},{"line_number":35,"context_line":"WRITE_ACCESS    \u003d 0b00000010"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_3e6043a4","line":32,"in_reply_to":"3a961159_830af787","updated":"2014-12-24 08:43:01.000000000","message":"Done","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"83bd0ced438d1e30a68072a101014ff6b65a45f6","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE            \u003d 0b00000000  # flake8: noqa"},{"line_number":34,"context_line":"READ_ACCESS     \u003d 0b00000001"},{"line_number":35,"context_line":"WRITE_ACCESS    \u003d 0b00000010"},{"line_number":36,"context_line":"RW_ACCESS       \u003d 0b00000011  # noqa # READ_ACCESS | WRITE_ACCESS"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_c3379f4b","line":33,"updated":"2014-12-22 22:32:21.000000000","message":"Could you also add an `ALL` capability with all bits set?","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"6cef13e052d4e1c697f8a536f07da5b22743935f","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE            \u003d 0b00000000  # flake8: noqa"},{"line_number":34,"context_line":"READ_ACCESS     \u003d 0b00000001"},{"line_number":35,"context_line":"WRITE_ACCESS    \u003d 0b00000010"},{"line_number":36,"context_line":"RW_ACCESS       \u003d 0b00000011  # noqa # READ_ACCESS | WRITE_ACCESS"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_2f975349","line":33,"in_reply_to":"3a961159_c3379f4b","updated":"2014-12-23 07:08:11.000000000","message":"Done","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"83bd0ced438d1e30a68072a101014ff6b65a45f6","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        return self._capabilities"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    @staticmethod"},{"line_number":61,"context_line":"    def _x_contains_y(x, y):"},{"line_number":62,"context_line":"        return x \u0026 y \u003d\u003d y"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def update_capabilities(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_431acfc6","line":61,"updated":"2014-12-22 22:32:21.000000000","message":"can we rename this to `contains` ?","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"6cef13e052d4e1c697f8a536f07da5b22743935f","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        return self._capabilities"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    @staticmethod"},{"line_number":61,"context_line":"    def _x_contains_y(x, y):"},{"line_number":62,"context_line":"        return x \u0026 y \u003d\u003d y"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def update_capabilities(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_cf8def32","line":61,"in_reply_to":"3a961159_431acfc6","updated":"2014-12-23 07:08:11.000000000","message":"Done","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"83bd0ced438d1e30a68072a101014ff6b65a45f6","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        for cap in capabilities:"},{"line_number":91,"context_line":"            caps |\u003d int(cap)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        return StoreCapability._x_contains_y(self.capabilities, caps)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def set_capabilities(self, *dynamic_capabilites):"},{"line_number":96,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_c385dfcf","line":93,"updated":"2014-12-22 22:32:21.000000000","message":"nit: no need to use the class name here, you can also reference the static method with `self`.","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"6cef13e052d4e1c697f8a536f07da5b22743935f","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        for cap in capabilities:"},{"line_number":91,"context_line":"            caps |\u003d int(cap)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        return StoreCapability._x_contains_y(self.capabilities, caps)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def set_capabilities(self, *dynamic_capabilites):"},{"line_number":96,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_0f845709","line":93,"in_reply_to":"3a961159_c385dfcf","updated":"2014-12-23 07:08:11.000000000","message":"Done","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"83bd0ced438d1e30a68072a101014ff6b65a45f6","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        for cap in dynamic_capabilites:"},{"line_number":114,"context_line":"            caps |\u003d int(cap)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        if StoreCapability._x_contains_y(caps, READ_ACCESS):"},{"line_number":117,"context_line":"            # Cascaded unset all read access related capabilities"},{"line_number":118,"context_line":"            caps |\u003d READ_RANDOM"},{"line_number":119,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_43f64f5e","line":116,"updated":"2014-12-22 22:32:21.000000000","message":"Do we really need to support `cascading` ?\n\nif we unset `READ_ACCESS` then, `self_capabilities` won\u0027t contain `READ_RANDOM` either since the later requires `READ_ACCESS` to be set.\n\nI believe preventing things like \u0027missing capabilities removal\u0027 is why we\u0027re using bits here. That is, being able to combine capabilities and therefore create dependencies.","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"352369bf5c928703ca3127d70d38f990d35ad895","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        for cap in dynamic_capabilites:"},{"line_number":114,"context_line":"            caps |\u003d int(cap)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        if StoreCapability._x_contains_y(caps, READ_ACCESS):"},{"line_number":117,"context_line":"            # Cascaded unset all read access related capabilities"},{"line_number":118,"context_line":"            caps |\u003d READ_RANDOM"},{"line_number":119,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_93fcd073","line":116,"in_reply_to":"3a961159_43f64f5e","updated":"2014-12-24 08:43:01.000000000","message":"I thought so, but do you think cascading can make bits removal more complete? For example, if some test on \u0027driver.capabilities \u003d capabilites.NONE\u0027, the left bits will fail this, but READ_ACCESS may already removed (only read categories there before).\n\nAnd, btw, from details design level, I think this cascading removal logic at here is fine, due to from outside of store driver, the logic is internal details, it\u0027s a proper encapsulation layer for this kind of logic to me.\n\nDo you stick to your idea still? let me know it.","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"95520474ff29e56bd96fda4799cb3e7464ca2447","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        for cap in dynamic_capabilites:"},{"line_number":114,"context_line":"            caps |\u003d int(cap)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        if StoreCapability._x_contains_y(caps, READ_ACCESS):"},{"line_number":117,"context_line":"            # Cascaded unset all read access related capabilities"},{"line_number":118,"context_line":"            caps |\u003d READ_RANDOM"},{"line_number":119,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_9fb90318","line":116,"in_reply_to":"3a961159_93fcd073","updated":"2014-12-29 09:46:24.000000000","message":"I totally agree that encapsulating the logic here is what we want. However, I still don\u0027t think it\u0027s useful. When would we need to check if a store has *no* capabilities?\n\nOne more thing that worries me is that, if we ever need to remove `READ_ACCESS` and then put it back, there won\u0027t be a way to know what other `READ_*` bits were set before. That is, there won\u0027t be a way to bring the previous state back.\n\nI think I stick to my thoughts that we shouldn\u0027t cascade but I\u0027m happy to be proven wrong :)","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"4f8d5eaecbe8c55a4c153657e5042ace29b1b9fb","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        for cap in dynamic_capabilites:"},{"line_number":114,"context_line":"            caps |\u003d int(cap)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        if StoreCapability._x_contains_y(caps, READ_ACCESS):"},{"line_number":117,"context_line":"            # Cascaded unset all read access related capabilities"},{"line_number":118,"context_line":"            caps |\u003d READ_RANDOM"},{"line_number":119,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_b16a647f","line":116,"in_reply_to":"3a961159_9fb90318","updated":"2014-12-30 04:49:32.000000000","message":"OK, sure thing, will remove this in next PS, and when we have a real requirement later we can add it back :)","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"83bd0ced438d1e30a68072a101014ff6b65a45f6","unresolved":false,"context_lines":[{"line_number":171,"context_line":"    def op_checker(store, *args, **kwargs):"},{"line_number":172,"context_line":"        # NOTE(zhiyan): Trigger the hook of updating store"},{"line_number":173,"context_line":"        # dynamic capabilities based on current store status."},{"line_number":174,"context_line":"        if store.conf.glance_store.store_capabilities_update_min_interval \u003e 0:"},{"line_number":175,"context_line":"            _schedule_capabilities_update(store)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        op_cap_map \u003d {"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_883e8fb6","line":174,"updated":"2014-12-22 22:32:21.000000000","message":"I don\u0027t understand why we need this and I\u0027d like to avoid adding more config options.\n\nWould you mind providing more info about this option and the `_schedule_capabilities_update` function?","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"4f8d5eaecbe8c55a4c153657e5042ace29b1b9fb","unresolved":false,"context_lines":[{"line_number":171,"context_line":"    def op_checker(store, *args, **kwargs):"},{"line_number":172,"context_line":"        # NOTE(zhiyan): Trigger the hook of updating store"},{"line_number":173,"context_line":"        # dynamic capabilities based on current store status."},{"line_number":174,"context_line":"        if store.conf.glance_store.store_capabilities_update_min_interval \u003e 0:"},{"line_number":175,"context_line":"            _schedule_capabilities_update(store)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        op_cap_map \u003d {"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_f1b4ecd5","line":174,"in_reply_to":"3a961159_3fcc8f8a","updated":"2014-12-30 04:49:32.000000000","message":"Sure, for your question the key reason is that we need a way to makes store knows dynamic capability are back to available, for example, someone could write code in the driver so that when it\u0027s doing a write and catches an exception from the backend store, it calls unset_capabilities for WRITE_ACCESS, then as a dynamic capabilities, we need a way to turn WRITE_ACCESS back on, so the logic here is used to trigger a check by the driver to see if the write capability has become available again.\n\nOK, seems the update is necessary, will do it after we have a final idea on your \"interoperability\" concern.","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"6cef13e052d4e1c697f8a536f07da5b22743935f","unresolved":false,"context_lines":[{"line_number":171,"context_line":"    def op_checker(store, *args, **kwargs):"},{"line_number":172,"context_line":"        # NOTE(zhiyan): Trigger the hook of updating store"},{"line_number":173,"context_line":"        # dynamic capabilities based on current store status."},{"line_number":174,"context_line":"        if store.conf.glance_store.store_capabilities_update_min_interval \u003e 0:"},{"line_number":175,"context_line":"            _schedule_capabilities_update(store)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        op_cap_map \u003d {"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_8febe7a2","line":174,"in_reply_to":"3a961159_883e8fb6","updated":"2014-12-23 07:08:11.000000000","message":"I saw you added a comment at https://review.openstack.org/#/c/138310/1/specs/kilo/store-capabilities.rst , I think you probably already know the reason of this, right?","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"95520474ff29e56bd96fda4799cb3e7464ca2447","unresolved":false,"context_lines":[{"line_number":171,"context_line":"    def op_checker(store, *args, **kwargs):"},{"line_number":172,"context_line":"        # NOTE(zhiyan): Trigger the hook of updating store"},{"line_number":173,"context_line":"        # dynamic capabilities based on current store status."},{"line_number":174,"context_line":"        if store.conf.glance_store.store_capabilities_update_min_interval \u003e 0:"},{"line_number":175,"context_line":"            _schedule_capabilities_update(store)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        op_cap_map \u003d {"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_3fcc8f8a","line":174,"in_reply_to":"3a961159_8febe7a2","updated":"2014-12-29 09:46:24.000000000","message":"mmh, I think I still don\u0027t follow why this is needed :(\n\nmind elaborating on this? (probably updating the spec is a good idea)","commit_id":"214d975c241cf31fdd864fb614267431240f0605"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"53ac6f0152796ac653b2bbeab309d9a8cabe88da","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE            \u003d 0b00000000  # flake8: noqa"},{"line_number":34,"context_line":"ALL             \u003d 0b11111111"},{"line_number":35,"context_line":"READ_ACCESS     \u003d 0b00000001"},{"line_number":36,"context_line":"READ_OFFSET     \u003d 0b00000011  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_f8f30fe5","line":33,"updated":"2014-12-26 15:29:07.000000000","message":"`# flake8: noqa` turns off hacking for the *entire file*. I don\u0027t think you actually want to do that. I understand you want to disable the check so you can align these values but that isn\u0027t appropriate style and turning off all of the checks for the entire file is wrong.","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"bf78c2f66c173a5beacdbb432db7ef6aef82dc3a","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE            \u003d 0b00000000  # flake8: noqa"},{"line_number":34,"context_line":"ALL             \u003d 0b11111111"},{"line_number":35,"context_line":"READ_ACCESS     \u003d 0b00000001"},{"line_number":36,"context_line":"READ_OFFSET     \u003d 0b00000011  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_d1b9b016","line":33,"in_reply_to":"3a961159_3fcf2f59","updated":"2014-12-30 03:55:53.000000000","message":"I tried \u0027noqa\u0027 before actually, by adding \u0027  # noqa\u0027 at end of each line, but seems it doesn\u0027t work for me. I\u0027d really like to know a way to align them and pass flake8. Thanks!","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"22a1bffdfc750f9abe32fc37d0a3840016871cf3","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE            \u003d 0b00000000  # flake8: noqa"},{"line_number":34,"context_line":"ALL             \u003d 0b11111111"},{"line_number":35,"context_line":"READ_ACCESS     \u003d 0b00000001"},{"line_number":36,"context_line":"READ_OFFSET     \u003d 0b00000011  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_ca93af5a","line":33,"in_reply_to":"3a961159_aa110306","updated":"2014-12-30 16:22:01.000000000","message":"Yep, agreed, I just try to get a balance way before I remove these spaces around equal signs.","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"3ea6ed4e2e8476eed749d447b01714ec0f163a03","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE            \u003d 0b00000000  # flake8: noqa"},{"line_number":34,"context_line":"ALL             \u003d 0b11111111"},{"line_number":35,"context_line":"READ_ACCESS     \u003d 0b00000001"},{"line_number":36,"context_line":"READ_OFFSET     \u003d 0b00000011  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_ea66ab54","line":33,"in_reply_to":"3a961159_ca93af5a","updated":"2014-12-30 16:32:35.000000000","message":"removed.","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"90fa8af5b6ce834a9ac343c879cd3914d6534ae6","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE            \u003d 0b00000000  # flake8: noqa"},{"line_number":34,"context_line":"ALL             \u003d 0b11111111"},{"line_number":35,"context_line":"READ_ACCESS     \u003d 0b00000001"},{"line_number":36,"context_line":"READ_OFFSET     \u003d 0b00000011  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_aa110306","line":33,"in_reply_to":"3a961159_d1b9b016","updated":"2014-12-30 16:19:21.000000000","message":"This might be one of the errors that pep8 does not allow `# noqa` to silence. Even if that is the case, disabling hacking for the entire file is bad. I appreciate having these aligned but I don\u0027t think it\u0027s so important as to disable hacking for the entire file.","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"45257c5d0105f6d4997cffc18a78040aedcc5cca","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE            \u003d 0b00000000  # flake8: noqa"},{"line_number":34,"context_line":"ALL             \u003d 0b11111111"},{"line_number":35,"context_line":"READ_ACCESS     \u003d 0b00000001"},{"line_number":36,"context_line":"READ_OFFSET     \u003d 0b00000011  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_3fcf2f59","line":33,"in_reply_to":"3a961159_f8f30fe5","updated":"2014-12-29 10:02:45.000000000","message":"I don\u0027t think zhiyan disabled flake8 on purpose.\n\nzhiyan, could you use just `noqa` instead? I do appreciate these nibbles being aligned.","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"aed61b241be294e0f5d1eb31ce10569a5e49b7ef","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE \u003d 0b00000000"},{"line_number":34,"context_line":"ALL \u003d 0b11111111"},{"line_number":35,"context_line":"READ_ACCESS \u003d 0b00000001"},{"line_number":36,"context_line":"READ_OFFSET \u003d 0b00000011  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_b2bab4bd","line":33,"updated":"2015-01-08 16:10:51.000000000","message":"Just an idea so feel free to tell me it\u0027s a bad one ;)\n\nThese are all meant to be constants, but they\u0027re all very intimately related. enum34 is already in global-requirements and with it we could do something like:\n\n\n    class Capabilities(enum34.Enum):\n        NONE \u003d 0b00000000\n        ALL \u003d 0b11111111\n        # etc.\n\nThe difference would be referring to them as\n\n     Capabilities.ALL # instead of simply ALL\n\nThis is exactly what an Enum is for and I think it would be intuitively pleasing to take advantage of it here.\n\nWe could also then rename the declarations to be:\n\n    class Capabilities(enum34.Enum):\n        none \u003d 0b00000000\n        # etc.","commit_id":"dca981ac4b1c0f1867e36fb17e2ba0c4be8b52a8"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"cf22df3d6a910baea39c1956d269659af6496872","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE \u003d 0b00000000"},{"line_number":34,"context_line":"ALL \u003d 0b11111111"},{"line_number":35,"context_line":"READ_ACCESS \u003d 0b00000001"},{"line_number":36,"context_line":"READ_OFFSET \u003d 0b00000011  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_c6a098f5","line":33,"in_reply_to":"3a961159_279673f0","updated":"2015-01-15 15:53:06.000000000","message":"FWIW, what @Ian proposed is *exactly* what I meant when I brought enums up.\n\nAs I mentioned before, I think we should go with enums.","commit_id":"dca981ac4b1c0f1867e36fb17e2ba0c4be8b52a8"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"75cecca07ef40747abfeb0684cdfa490b7e7e7b2","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE \u003d 0b00000000"},{"line_number":34,"context_line":"ALL \u003d 0b11111111"},{"line_number":35,"context_line":"READ_ACCESS \u003d 0b00000001"},{"line_number":36,"context_line":"READ_OFFSET \u003d 0b00000011  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_8ef19b98","line":33,"in_reply_to":"3a961159_279673f0","updated":"2015-01-23 16:41:07.000000000","message":"What about naming it something a bit more clear:\n\n\n    class BitMasks(enum34.Enum):\n        NONE \u003d 0b00000000\n        ALL \u003d 0b11111111\n        # etc.","commit_id":"dca981ac4b1c0f1867e36fb17e2ba0c4be8b52a8"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"9646d6a42d667e3851f728491c77b51c815be9b8","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE \u003d 0b00000000"},{"line_number":34,"context_line":"ALL \u003d 0b11111111"},{"line_number":35,"context_line":"READ_ACCESS \u003d 0b00000001"},{"line_number":36,"context_line":"READ_OFFSET \u003d 0b00000011  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_279673f0","line":33,"in_reply_to":"3a961159_b2bab4bd","updated":"2015-01-09 07:54:05.000000000","message":"I\u0027m a little worried on the duplicated prefix on capability value reference in \u0027client\u0027 code, with enum we need to add \u0027Capabilities\u0027  prefix like:\n\n    from glance_store import capabilities\n    capabilities.Capabilities.ALL\n\ncurrently we will be easier:\n\n    capabilities.ALL\n\nSo I trend to use now way.\n\nThe value of making capability be readonly is a point.","commit_id":"dca981ac4b1c0f1867e36fb17e2ba0c4be8b52a8"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"63e900cdfc1c4f577a14d2a575c5ab70b9e6f069","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# Store capability constants"},{"line_number":33,"context_line":"NONE \u003d 0b00000000"},{"line_number":34,"context_line":"ALL \u003d 0b11111111"},{"line_number":35,"context_line":"READ_ACCESS \u003d 0b00000001"},{"line_number":36,"context_line":"READ_OFFSET \u003d 0b00000011  # Included READ_ACCESS"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a930d6b_b3c86a23","line":33,"in_reply_to":"3a961159_c6a098f5","updated":"2015-01-23 15:29:18.000000000","message":"I prefer the way Ian is proposing to implement the constants.\n\n\nAlthough, do we want to block the patch on this debate ? If there are no significant issues (performance, maintainability, etc) with whatever approach is proposed in the code; it might be easier to merge this spec now and amend it in future as necessary.","commit_id":"dca981ac4b1c0f1867e36fb17e2ba0c4be8b52a8"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"9f84f4fff23ade23245b6ded07a8155661b75ae7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2014 IBM, Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_37bd6d69","line":1,"updated":"2015-02-03 09:33:20.000000000","message":"2015*","commit_id":"25707c6db0e56d8a657531411179fbad5f4803ba"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"871f94bcfa6b699a42b66dfc1b94ecc62db5e9bb","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2014 IBM, Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_963bbf9b","line":1,"in_reply_to":"da86d52c_37bd6d69","updated":"2015-02-08 04:41:22.000000000","message":"Done","commit_id":"25707c6db0e56d8a657531411179fbad5f4803ba"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"f6d9d8063fdb3fd6b9362835afac48c7514934b5","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        This function shouldn\u0027t raise any exception out."},{"line_number":79,"context_line":"        \"\"\""},{"line_number":80,"context_line":"        pass"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def is_capable(self, *capabilities):"},{"line_number":83,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":13,"id":"1a930d6b_afbc71dd","line":80,"updated":"2015-02-03 16:15:27.000000000","message":"Can we add a debug here for default to give some information in case a driver does not support this call? (like the code being out of sync)","commit_id":"25707c6db0e56d8a657531411179fbad5f4803ba"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"871f94bcfa6b699a42b66dfc1b94ecc62db5e9bb","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        This function shouldn\u0027t raise any exception out."},{"line_number":79,"context_line":"        \"\"\""},{"line_number":80,"context_line":"        pass"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def is_capable(self, *capabilities):"},{"line_number":83,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_f6f79bd2","line":80,"in_reply_to":"1a930d6b_afbc71dd","updated":"2015-02-08 04:41:22.000000000","message":"Done","commit_id":"25707c6db0e56d8a657531411179fbad5f4803ba"}],"glance_store/exceptions.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"53ac6f0152796ac653b2bbeab309d9a8cabe88da","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    message \u003d _(\"Getting images from this store is not supported.\")"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"class StoreRandomGetNotSupported(StoreGetNotSupported):"},{"line_number":155,"context_line":"    message \u003d _(\"Getting images randomly from this store is not supported. \""},{"line_number":156,"context_line":"                \"Offset: %(offset)s, length: %(chunk_size)s\")"},{"line_number":157,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_1818db1d","line":154,"updated":"2014-12-26 15:29:07.000000000","message":"Why did you delete the StoreAddNotSupported exception? Is it never used?","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"45257c5d0105f6d4997cffc18a78040aedcc5cca","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    message \u003d _(\"Getting images from this store is not supported.\")"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"class StoreRandomGetNotSupported(StoreGetNotSupported):"},{"line_number":155,"context_line":"    message \u003d _(\"Getting images randomly from this store is not supported. \""},{"line_number":156,"context_line":"                \"Offset: %(offset)s, length: %(chunk_size)s\")"},{"line_number":157,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_ffe687af","line":154,"in_reply_to":"3a961159_1818db1d","updated":"2014-12-29 10:02:45.000000000","message":"On master:\n\n        $ git grep StoreAddNotSupported\n\tglance_store/backend.py\n\t346:        raise exceptions.StoreAddNotSupported\n\n\tglance_store/exceptions.py\n\t154:class StoreAddNotSupported(GlanceStoreException):\n\nIt was used in backend.py but, as per this change, it\u0027s not anymore. New, and more granular, exceptions will be raised based on the missing capabilities.","commit_id":"35099537eb62bdda78404a4800993c53ecbdaf72"}],"tests/unit/test_store_capabilities.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"e5876d28a3af0d45cac4544b4ca9cd2ffb6042fc","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    def test_combined_capability_bits(self):"},{"line_number":131,"context_line":"        # Test the RW_* capabilities"},{"line_number":132,"context_line":"        caps.RW_ACCESS \u003d (caps.READ_ACCESS | caps.WRITE_ACCESS)"},{"line_number":133,"context_line":"        caps.RW_OFFSET \u003d (caps.READ_OFFSET | caps.WRITE_OFFSET)"},{"line_number":134,"context_line":"        caps.RW_CHUNK \u003d (caps.READ_CHUNK | caps.WRITE_CHUNK)"},{"line_number":135,"context_line":"        caps.RW_RANDOM \u003d (caps.READ_RANDOM | caps.WRITE_RANDOM)"},{"line_number":136,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a930d6b_2c5a5450","line":133,"updated":"2015-01-23 18:15:57.000000000","message":"Why are you redefining these here?","commit_id":"4f13071f5435700593e6671e0ac0124913424dcc"}]}
