)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"278c452e3241f1632549d338a6e62bb8bc46d14b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Stricter checks for registry API calls"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the configuration options for Glance API and"},{"line_number":10,"context_line":"registry APIs are left with defaults, v1 glance"},{"line_number":11,"context_line":"API makes a call to v2 registry."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch performs a stricter check to ensure"},{"line_number":14,"context_line":"that only if both API and registry are set to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3a461143_78e3f105","line":11,"range":{"start_line":9,"start_character":0,"end_line":11,"end_character":32},"updated":"2017-01-26 16:48:24.000000000","message":"I think you mean:\n\nif the current defaults are left as it is, and if v2 API is enabled, a call made to Glance v2 API will be routed to Glance v1 Registry irrespective of what the value is set for enable_v2_registry. This in unintended behavior and we need to ensure that only v2 registry is used if enabled and when v2 API is being used, same for v1 API and registry.","commit_id":"9884f943ec06b9e42c1065a7b6a83822cfb2ef40"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"3124b4e24c1bc41184cdd78e1b4c3b52aedf10d6","unresolved":false,"context_lines":[{"line_number":17,"context_line":"API calls as follows:"},{"line_number":18,"context_line":"* If enable_v1_api is set to True, enable_v1_registry"},{"line_number":19,"context_line":"  MUST be set to True."},{"line_number":20,"context_line":"  So make a call to v1 registry only if both enable_v1_api"},{"line_number":21,"context_line":"  and enable_v1_registry are set to True."},{"line_number":22,"context_line":"* enable_v2_registry need not be set to True even if"},{"line_number":23,"context_line":"  enable_v2_api is set to True."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3a461143_ad492462","line":20,"range":{"start_line":20,"start_character":2,"end_line":20,"end_character":5},"updated":"2017-01-30 22:12:34.000000000","message":"the word \"so\" is not needed as this point is not a consequence of the sentence on line 18. as someone may misconfigure v1_reg with v2_api (although to not effect).","commit_id":"e3cd66e8b465549c0caabd3f0b18f2f17ee78250"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"f936098d2fe3c43a451619b26dd670760b286a46","unresolved":false,"context_lines":[{"line_number":18,"context_line":"* If enable_v1_api is set to True, enable_v1_registry"},{"line_number":19,"context_line":"  MUST be set to True."},{"line_number":20,"context_line":"  So make a call to v1 registry only if both enable_v1_api"},{"line_number":21,"context_line":"  and enable_v1_registry are set to True."},{"line_number":22,"context_line":"* enable_v2_registry need not be set to True even if"},{"line_number":23,"context_line":"  enable_v2_api is set to True."},{"line_number":24,"context_line":"  So only if enable_v2_registry and enable_v2_api are set"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3a461143_4d8600dc","line":21,"updated":"2017-01-30 22:14:15.000000000","message":"v1 registry is allowed to be enabled only if v1 api is enabled.","commit_id":"e3cd66e8b465549c0caabd3f0b18f2f17ee78250"}],"glance/registry/api/__init__.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"f22ab9ad96f1b2c994ebc5493b44c1cecd330123","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        if CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":35,"context_line":"            v1.init(mapper)"},{"line_number":36,"context_line":"        if CONF.enable_v2_registry and CONF.enable_v2_api:"},{"line_number":37,"context_line":"            v2.init(mapper)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        super(API, self).__init__(mapper)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a461143_385b2930","line":37,"updated":"2017-01-26 16:43:50.000000000","message":"may be add another couple cases where someone is trying to use v1 with v2 reg and v2 with v1 registry simply because they are new to openstack (ops).\n\nWe can add a log and fail to start. Seems harmless.","commit_id":"9884f943ec06b9e42c1065a7b6a83822cfb2ef40"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"0837c4b60519443893b7ab516fee9ea103d7aa96","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def __init__(self, mapper):"},{"line_number":38,"context_line":"        mapper \u003d mapper or wsgi.APIMapper()"},{"line_number":39,"context_line":"        # NOTE(dharinic): Log a warning in case of a misconfiguration."},{"line_number":40,"context_line":"        if((CONF.enable_v1_registry and CONF.enable_v2_api) or"},{"line_number":41,"context_line":"           (CONF.enable_v2_registry and CONF.enable_v1_api)):"},{"line_number":42,"context_line":"            msg \u003d _LW(\u0027Please make sure to configure the same versions to \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a461143_e512ca08","line":39,"updated":"2017-01-26 22:28:37.000000000","message":"come to think of it: I still don\u0027t think this is holistic.\n\nThere\u0027s a case when the operator still has deployed v1 and v2 together. This is pretty real given v1 is in deprecation path and people will take their time to move to v2.\n\nSo, in case when v1 and v2 both are enabled the configuration that can be supported given the current glance architecture is v1 used with registry and v2 as is (w/o registry). The line#39 if clause will break things for the operator.\n\n\nIf there\u0027s a strong case for v2 registry we will have to think of alternative.","commit_id":"bf630d3ae42811db644c222817b32937bffceb27"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"f0bb7b54e251220782748c216b77bc5a4a0bc5f2","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def __init__(self, mapper):"},{"line_number":38,"context_line":"        mapper \u003d mapper or wsgi.APIMapper()"},{"line_number":39,"context_line":"        # NOTE(dharinic): Log a warning in case of a misconfiguration."},{"line_number":40,"context_line":"        if((CONF.enable_v1_registry and CONF.enable_v2_api) or"},{"line_number":41,"context_line":"           (CONF.enable_v2_registry and CONF.enable_v1_api)):"},{"line_number":42,"context_line":"            msg \u003d _LW(\u0027Please make sure to configure the same versions to \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a461143_d0090a2e","line":39,"in_reply_to":"3a461143_e512ca08","updated":"2017-01-26 22:46:31.000000000","message":"Nikhil, the check in L40 will not break anything cos of the \"or\". As long as the combination exists correctly, either L46 or L48 or both will go through. \nPlease see my test in L202 in [1]. \nOne thing to note here (and I will update it) is that we might be logging warnings unnecessarily sometimes as in the case stated.","commit_id":"bf630d3ae42811db644c222817b32937bffceb27"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"74ee6a17f838505c8aa0a36485167a629d18b5b9","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        # NOTE(dharinic): Ensure we call v1_registry only if v1_api is enabled."},{"line_number":39,"context_line":"        # (It is mandatory to use v1_registry if using v1_api)"},{"line_number":40,"context_line":"        if CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":41,"context_line":"                v1.init(mapper)"},{"line_number":42,"context_line":"        elif not CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":43,"context_line":"            msg \u003d _LW(\u0027It is mandatory to use v1 registry while using v1 api.\u0027)"},{"line_number":44,"context_line":"            LOG.warn(msg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a461143_31f96d81","line":41,"range":{"start_line":41,"start_character":12,"end_line":41,"end_character":16},"updated":"2017-01-27 03:03:48.000000000","message":"extra tab crept in. Will remove it.","commit_id":"467e2946a3cf1ed76f523bbc25d144c76bdf2896"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"89b71630f4d92e6ee0d939e7902d20c1c9a40d2c","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        # NOTE(dharinic): v1 and v2 can exist individually."},{"line_number":39,"context_line":"        # Ensure we call v1_registry only if v1_api is enabled."},{"line_number":40,"context_line":"        # (It is mandatory to use v1_registry if using v1_api)"},{"line_number":41,"context_line":"        if CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":42,"context_line":"            v1.init(mapper)"},{"line_number":43,"context_line":"        elif not CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":44,"context_line":"            msg \u003d _LW(\u0027It is mandatory to use v1 registry while using v1 api.\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_cbae9884","line":41,"range":{"start_line":41,"start_character":8,"end_line":41,"end_character":57},"updated":"2017-01-27 20:07:48.000000000","message":"What happens if v2 is also enabled,\n\ncalls to v2 API not being routed to v1 registry to get the metadata?","commit_id":"e3cd66e8b465549c0caabd3f0b18f2f17ee78250"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"3124b4e24c1bc41184cdd78e1b4c3b52aedf10d6","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        # NOTE(dharinic): v1 and v2 can exist individually."},{"line_number":39,"context_line":"        # Ensure we call v1_registry only if v1_api is enabled."},{"line_number":40,"context_line":"        # (It is mandatory to use v1_registry if using v1_api)"},{"line_number":41,"context_line":"        if CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":42,"context_line":"            v1.init(mapper)"},{"line_number":43,"context_line":"        elif not CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":44,"context_line":"            msg \u003d _LW(\u0027It is mandatory to use v1 registry while using v1 api.\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_92af2329","line":41,"range":{"start_line":41,"start_character":8,"end_line":41,"end_character":57},"in_reply_to":"3a461143_05ba480a","updated":"2017-01-30 22:12:34.000000000","message":"you are right. the ANDs on line 41 and 47 does scope out the expected bugs.","commit_id":"e3cd66e8b465549c0caabd3f0b18f2f17ee78250"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"021e72be142d1a64483a5db16b60d18301382052","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        # NOTE(dharinic): v1 and v2 can exist individually."},{"line_number":39,"context_line":"        # Ensure we call v1_registry only if v1_api is enabled."},{"line_number":40,"context_line":"        # (It is mandatory to use v1_registry if using v1_api)"},{"line_number":41,"context_line":"        if CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":42,"context_line":"            v1.init(mapper)"},{"line_number":43,"context_line":"        elif not CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":44,"context_line":"            msg \u003d _LW(\u0027It is mandatory to use v1 registry while using v1 api.\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_05ba480a","line":41,"range":{"start_line":41,"start_character":8,"end_line":41,"end_character":57},"in_reply_to":"3a461143_cbae9884","updated":"2017-01-27 22:57:26.000000000","message":"if v2 api is also enabled: (both v1_api and v2_api are enabled)\n* v2 registry is enabled, we route through v2 registry which is the  obvious.\n* v2 registry is not enabled, we do not want \"enable_v1_registry \u003d True\" to cause routing from v2 api to go to v1 reg (this is the vice versa case of the bug filed); hence the \"AND\" usage. \n\ni.e.,\nv1 api will be routed ONLY through v1 reg to the db.\nv2 api will be routed through v2 reg to the db IFF enable_v2_registry opt is set to True. (The scope of this file is to handle all incoming registry requests only)","commit_id":"e3cd66e8b465549c0caabd3f0b18f2f17ee78250"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"3124b4e24c1bc41184cdd78e1b4c3b52aedf10d6","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        # (It is mandatory to use v1_registry if using v1_api)"},{"line_number":41,"context_line":"        if CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":42,"context_line":"            v1.init(mapper)"},{"line_number":43,"context_line":"        elif not CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":44,"context_line":"            msg \u003d _LW(\u0027It is mandatory to use v1 registry while using v1 api.\u0027)"},{"line_number":45,"context_line":"            LOG.warn(msg)"},{"line_number":46,"context_line":"        # Ensure we call v2_registry only if v2_api is enabled"},{"line_number":47,"context_line":"        if CONF.enable_v2_registry and CONF.enable_v2_api:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_2de534db","line":44,"range":{"start_line":43,"start_character":8,"end_line":44,"end_character":79},"updated":"2017-01-30 22:12:34.000000000","message":"may be have this as:\n\n    elif CONF.enable_v1_registry ^ CONF.enable_v1_api:\n        msg \u003d _LW(\u0027It is mandatory to run v1 API and v1 registry together\u0027)","commit_id":"e3cd66e8b465549c0caabd3f0b18f2f17ee78250"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"6a3f5c1710c57cea181155fa7c84af789da429a9","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        # (It is mandatory to use v1_registry if using v1_api)"},{"line_number":41,"context_line":"        if CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":42,"context_line":"            v1.init(mapper)"},{"line_number":43,"context_line":"        elif not CONF.enable_v1_registry and CONF.enable_v1_api:"},{"line_number":44,"context_line":"            msg \u003d _LW(\u0027It is mandatory to use v1 registry while using v1 api.\u0027)"},{"line_number":45,"context_line":"            LOG.warn(msg)"},{"line_number":46,"context_line":"        # Ensure we call v2_registry only if v2_api is enabled"},{"line_number":47,"context_line":"        if CONF.enable_v2_registry and CONF.enable_v2_api:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_b03f0dd5","line":44,"range":{"start_line":43,"start_character":8,"end_line":44,"end_character":79},"in_reply_to":"3a461143_2de534db","updated":"2017-02-06 16:37:04.000000000","message":"the xor operator in Python is fairly uncommon. I prefer what Dharini has here.","commit_id":"e3cd66e8b465549c0caabd3f0b18f2f17ee78250"}]}
