)]}'
{"glance_store/_drivers/cinder.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"04180c38498325c410fd7443034392077e137f75","unresolved":true,"context_lines":[{"line_number":428,"context_line":"                    enabled_backends.pop(\u0027os_glance_staging_store\u0027)"},{"line_number":429,"context_line":"                if \u0027os_glance_tasks_store\u0027 in enabled_backends:"},{"line_number":430,"context_line":"                    enabled_backends.pop(\u0027os_glance_tasks_store\u0027)"},{"line_number":431,"context_line":"                if len(enabled_backends) \u003e 1:"},{"line_number":432,"context_line":"                    LOG.error(reason)"},{"line_number":433,"context_line":"                    raise exceptions.BadStoreConfiguration("},{"line_number":434,"context_line":"                        store_name\u003dself.backend_group, reason\u003dreason)"}],"source_content_type":"text/x-python","patch_set":2,"id":"033380f6_3fd4e2b6","line":431,"range":{"start_line":431,"start_character":16,"end_line":431,"end_character":44},"updated":"2021-02-11 05:44:51.000000000","message":"I would suggest that instead of popping the stores you should modify this condition;\nsomething like\nreserved_stores \u003d set([\u0027os_glance_staging_store\u0027, \u0027os_glance_tasks_store\u0027])\nif reserved_stores.issubset(enabled_backends.keys()) and len(enabled_backends) \u003e 3:\n    logic\n\nAlso add comment as a note why we are doing this and give reference of launchpad bug you have filed for this.","commit_id":"d90318d474b4f0106a62661228164cb725ae13ba"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"a3f32d853a267e4865c0d0e9e0195404930032bd","unresolved":false,"context_lines":[{"line_number":428,"context_line":"                    enabled_backends.pop(\u0027os_glance_staging_store\u0027)"},{"line_number":429,"context_line":"                if \u0027os_glance_tasks_store\u0027 in enabled_backends:"},{"line_number":430,"context_line":"                    enabled_backends.pop(\u0027os_glance_tasks_store\u0027)"},{"line_number":431,"context_line":"                if len(enabled_backends) \u003e 1:"},{"line_number":432,"context_line":"                    LOG.error(reason)"},{"line_number":433,"context_line":"                    raise exceptions.BadStoreConfiguration("},{"line_number":434,"context_line":"                        store_name\u003dself.backend_group, reason\u003dreason)"}],"source_content_type":"text/x-python","patch_set":2,"id":"aff6e0ea_e1397d37","line":431,"range":{"start_line":431,"start_character":16,"end_line":431,"end_character":44},"in_reply_to":"033380f6_3fd4e2b6","updated":"2021-02-11 09:16:09.000000000","message":"Done","commit_id":"d90318d474b4f0106a62661228164cb725ae13ba"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7305552549b3e36777fcef4de06b10f81c8efbbd","unresolved":true,"context_lines":[{"line_number":427,"context_line":"                # This is done because when configuring multiple stores,"},{"line_number":428,"context_line":"                # `os_glance_staging_store` and `os_glance_tasks_store` are"},{"line_number":429,"context_line":"                # added to self.conf.enabled_backends, see Bug: #1915263"},{"line_number":430,"context_line":"                reserved_stores \u003d set([\u0027os_glance_staging_store\u0027,"},{"line_number":431,"context_line":"                                       \u0027os_glance_tasks_store\u0027])"},{"line_number":432,"context_line":"                if (reserved_stores.issubset(enabled_backends.keys())"},{"line_number":433,"context_line":"                        and len(enabled_backends) \u003e 3):"},{"line_number":434,"context_line":"                    LOG.error(reason)"},{"line_number":435,"context_line":"                    raise exceptions.BadStoreConfiguration("},{"line_number":436,"context_line":"                        store_name\u003dself.backend_group, reason\u003dreason)"},{"line_number":437,"context_line":"            LOG.critical(reason)"},{"line_number":438,"context_line":"            raise exceptions.BackendException(reason)"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    def is_image_associated_with_store(self, context, volume_id):"},{"line_number":441,"context_line":"        \"\"\""},{"line_number":442,"context_line":"        Updates legacy images URL to respective stores."}],"source_content_type":"text/x-python","patch_set":3,"id":"7bef8a77_b88923ca","line":439,"range":{"start_line":430,"start_character":16,"end_line":439,"end_character":0},"updated":"2021-02-11 14:50:54.000000000","message":"Sorry I forgot why we added this check in configure_add.\n\nThe reason we were raising BackendException is for stopping glance-api to start if there is only one backend is configured, as now we move this check here there is no need to raise two separate exceptions.\n\nAlso this will cause performance overhead as we are checking volume type for each create call.","commit_id":"00e1040a0962b455ca70011e1119e84f9ef41824"},{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"e96ace80ec68d25dd8b5c7009ca013b69b20f737","unresolved":true,"context_lines":[{"line_number":427,"context_line":"                # This is done because when configuring multiple stores,"},{"line_number":428,"context_line":"                # `os_glance_staging_store` and `os_glance_tasks_store` are"},{"line_number":429,"context_line":"                # added to self.conf.enabled_backends, see Bug: #1915263"},{"line_number":430,"context_line":"                reserved_stores \u003d set([\u0027os_glance_staging_store\u0027,"},{"line_number":431,"context_line":"                                       \u0027os_glance_tasks_store\u0027])"},{"line_number":432,"context_line":"                if (reserved_stores.issubset(enabled_backends.keys())"},{"line_number":433,"context_line":"                        and len(enabled_backends) \u003e 3):"},{"line_number":434,"context_line":"                    LOG.error(reason)"},{"line_number":435,"context_line":"                    raise exceptions.BadStoreConfiguration("},{"line_number":436,"context_line":"                        store_name\u003dself.backend_group, reason\u003dreason)"},{"line_number":437,"context_line":"            LOG.critical(reason)"},{"line_number":438,"context_line":"            raise exceptions.BackendException(reason)"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    def is_image_associated_with_store(self, context, volume_id):"},{"line_number":441,"context_line":"        \"\"\""},{"line_number":442,"context_line":"        Updates legacy images URL to respective stores."}],"source_content_type":"text/x-python","patch_set":3,"id":"a96836e1_ccac1365","line":439,"range":{"start_line":430,"start_character":16,"end_line":439,"end_character":0},"in_reply_to":"7bef8a77_b88923ca","updated":"2021-02-11 14:58:38.000000000","message":"I can\u0027t speak to what sort of exceptions are used, but hopefully there\u0027s a way to mitigate the performance overhead. Maybe add a \"have I validated the volume type\" sort of flag, so the performance hit would happen once, then update the flag to skip subsequent checks.\n\nThe key point is the check must be moved out of the service startup phase.","commit_id":"00e1040a0962b455ca70011e1119e84f9ef41824"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1ac4142c1c3802ee1e01c79f017c37518a75c131","unresolved":true,"context_lines":[{"line_number":427,"context_line":"                # This is done because when configuring multiple stores,"},{"line_number":428,"context_line":"                # `os_glance_staging_store` and `os_glance_tasks_store` are"},{"line_number":429,"context_line":"                # added to self.conf.enabled_backends, see Bug: #1915263"},{"line_number":430,"context_line":"                reserved_stores \u003d set([\u0027os_glance_staging_store\u0027,"},{"line_number":431,"context_line":"                                       \u0027os_glance_tasks_store\u0027])"},{"line_number":432,"context_line":"                if (reserved_stores.issubset(enabled_backends.keys())"},{"line_number":433,"context_line":"                        and len(enabled_backends) \u003e 3):"},{"line_number":434,"context_line":"                    LOG.error(reason)"},{"line_number":435,"context_line":"                    raise exceptions.BadStoreConfiguration("},{"line_number":436,"context_line":"                        store_name\u003dself.backend_group, reason\u003dreason)"},{"line_number":437,"context_line":"            LOG.critical(reason)"},{"line_number":438,"context_line":"            raise exceptions.BackendException(reason)"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    def is_image_associated_with_store(self, context, volume_id):"},{"line_number":441,"context_line":"        \"\"\""},{"line_number":442,"context_line":"        Updates legacy images URL to respective stores."}],"source_content_type":"text/x-python","patch_set":3,"id":"bd5e20da_f6e06d2c","line":439,"range":{"start_line":430,"start_character":16,"end_line":439,"end_character":0},"in_reply_to":"a96836e1_ccac1365","updated":"2021-02-11 15:11:10.000000000","message":"Agree, One way I think of is;\n\n1. define one flag while initializing the driver and set it to false\n2. In configure_add if validation is performed then set it to true\n3. in add/create call\n   3.1 check if flag is true the skip the validation\n   3.2 if flag is false validate and set the flag to true","commit_id":"00e1040a0962b455ca70011e1119e84f9ef41824"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"45240e2f2b7817338f32264e8ac96e540ad45f8a","unresolved":false,"context_lines":[{"line_number":427,"context_line":"                # This is done because when configuring multiple stores,"},{"line_number":428,"context_line":"                # `os_glance_staging_store` and `os_glance_tasks_store` are"},{"line_number":429,"context_line":"                # added to self.conf.enabled_backends, see Bug: #1915263"},{"line_number":430,"context_line":"                reserved_stores \u003d set([\u0027os_glance_staging_store\u0027,"},{"line_number":431,"context_line":"                                       \u0027os_glance_tasks_store\u0027])"},{"line_number":432,"context_line":"                if (reserved_stores.issubset(enabled_backends.keys())"},{"line_number":433,"context_line":"                        and len(enabled_backends) \u003e 3):"},{"line_number":434,"context_line":"                    LOG.error(reason)"},{"line_number":435,"context_line":"                    raise exceptions.BadStoreConfiguration("},{"line_number":436,"context_line":"                        store_name\u003dself.backend_group, reason\u003dreason)"},{"line_number":437,"context_line":"            LOG.critical(reason)"},{"line_number":438,"context_line":"            raise exceptions.BackendException(reason)"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    def is_image_associated_with_store(self, context, volume_id):"},{"line_number":441,"context_line":"        \"\"\""},{"line_number":442,"context_line":"        Updates legacy images URL to respective stores."}],"source_content_type":"text/x-python","patch_set":3,"id":"1cafe54d_6a017679","line":439,"range":{"start_line":430,"start_character":16,"end_line":439,"end_character":0},"in_reply_to":"bd5e20da_f6e06d2c","updated":"2021-02-11 17:04:36.000000000","message":"Done","commit_id":"00e1040a0962b455ca70011e1119e84f9ef41824"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"30cadbbcd75a9936ce98940e0e15f968f0dc0250","unresolved":true,"context_lines":[{"line_number":425,"context_line":"            reason \u003d _(\"Invalid `cinder_volume_type %s`\""},{"line_number":426,"context_line":"                       % volume_type)"},{"line_number":427,"context_line":"            LOG.error(reason)"},{"line_number":428,"context_line":"            raise exceptions.BackendException(reason)"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"    def is_image_associated_with_store(self, context, volume_id):"},{"line_number":431,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"399e7977_e2ec0730","line":428,"updated":"2021-02-11 17:32:43.000000000","message":"This is good, IMHO, in that we will continue to fail until the volume type exists. When it does, we start to work, which is exactly what the operator would expect: glance says \"this volume type doesn\u0027t exist in cinder\", you go create it, and glance starts working. No service restarts required, unless you just typo\u0027d the glance config or something.\n\nNote that you could also do this from inside configure_add() but not fail if the exception is raised. That would be a hybrid between Erno\u0027s desire to have this validated at store-add time, eliminating the synchronous API call in the main path, if the volume type is already there.\n\nHowever, see my point below.","commit_id":"1e9d920c64f608d8e663a2ceef012111ad27ca48"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"30cadbbcd75a9936ce98940e0e15f968f0dc0250","unresolved":true,"context_lines":[{"line_number":834,"context_line":"        if volume_type and not self.valid_volume_type:"},{"line_number":835,"context_line":"            # NOTE: `cinder_volume_type` is configured, check"},{"line_number":836,"context_line":"            # configured volume_type is available in cinder or not"},{"line_number":837,"context_line":"            self._validate_volume_type(client, volume_type)"},{"line_number":838,"context_line":""},{"line_number":839,"context_line":"        LOG.debug(\u0027Creating a new volume: image_size\u003d%d size_gb\u003d%d type\u003d%s\u0027,"},{"line_number":840,"context_line":"                  image_size, size_gb, volume_type or \u0027None\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"6fae3c7b_af99d22b","line":837,"updated":"2021-02-11 17:32:43.000000000","message":"Just curious, but do we even need to do this? Surely the volumes.create() call on L845 will fail with some characteristic error code indicating that the problem was an invalid volume type right? If the concern is one additional validation API call, can\u0027t we just eliminate this and make sure we log the actual problem correctly below?","commit_id":"1e9d920c64f608d8e663a2ceef012111ad27ca48"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"f51a9121d62ba9ba62d9a45142ad312919559fd0","unresolved":true,"context_lines":[{"line_number":420,"context_line":"                # No need to worry NoUniqueMatch as volume type name is"},{"line_number":421,"context_line":"                # unique"},{"line_number":422,"context_line":"            except cinder_exception.NotFound:"},{"line_number":423,"context_line":"                reason \u003d _(\"Invalid `cinder_volume_type %s`\""},{"line_number":424,"context_line":"                           % cinder_volume_type)"},{"line_number":425,"context_line":"                LOG.warning(reason)"},{"line_number":426,"context_line":"            except cinder_exception.ClientException:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7d38cb38_4de82748","line":423,"range":{"start_line":423,"start_character":25,"end_line":423,"end_character":27},"updated":"2021-02-12 17:57:46.000000000","message":"_LE(","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"454bd258bff4dfd13a04963ee7cccdda2fd4bb91","unresolved":false,"context_lines":[{"line_number":420,"context_line":"                # No need to worry NoUniqueMatch as volume type name is"},{"line_number":421,"context_line":"                # unique"},{"line_number":422,"context_line":"            except cinder_exception.NotFound:"},{"line_number":423,"context_line":"                reason \u003d _(\"Invalid `cinder_volume_type %s`\""},{"line_number":424,"context_line":"                           % cinder_volume_type)"},{"line_number":425,"context_line":"                LOG.warning(reason)"},{"line_number":426,"context_line":"            except cinder_exception.ClientException:"}],"source_content_type":"text/x-python","patch_set":6,"id":"f33ca0c1_b478653e","line":423,"range":{"start_line":423,"start_character":25,"end_line":423,"end_character":27},"in_reply_to":"7d38cb38_4de82748","updated":"2021-02-15 13:48:16.000000000","message":"Done","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"f51a9121d62ba9ba62d9a45142ad312919559fd0","unresolved":true,"context_lines":[{"line_number":422,"context_line":"            except cinder_exception.NotFound:"},{"line_number":423,"context_line":"                reason \u003d _(\"Invalid `cinder_volume_type %s`\""},{"line_number":424,"context_line":"                           % cinder_volume_type)"},{"line_number":425,"context_line":"                LOG.warning(reason)"},{"line_number":426,"context_line":"            except cinder_exception.ClientException:"},{"line_number":427,"context_line":"                pass"},{"line_number":428,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"64cb1b11_7aadd111","line":425,"range":{"start_line":425,"start_character":20,"end_line":425,"end_character":27},"updated":"2021-02-12 17:57:46.000000000","message":"We probably should raise the \u0027BadStoreConfiguration\u0027 here as Cinder is clearly up and responding?","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a14fa2ff18b54b8fc6564dee13c9c9b0196c9b4b","unresolved":true,"context_lines":[{"line_number":422,"context_line":"            except cinder_exception.NotFound:"},{"line_number":423,"context_line":"                reason \u003d _(\"Invalid `cinder_volume_type %s`\""},{"line_number":424,"context_line":"                           % cinder_volume_type)"},{"line_number":425,"context_line":"                LOG.warning(reason)"},{"line_number":426,"context_line":"            except cinder_exception.ClientException:"},{"line_number":427,"context_line":"                pass"},{"line_number":428,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"43035fbb_e8643c73","line":425,"range":{"start_line":425,"start_character":20,"end_line":425,"end_character":27},"in_reply_to":"64cb1b11_7aadd111","updated":"2021-02-12 18:10:47.000000000","message":"No, that\u0027s the point here - we don\u0027t want to fail just because the volume type isn\u0027t created. We\u0027re checking to see if the volume_type is there, and logging (instead of raising) if it\u0027s not. The goal is not just to make glance tolerant of cinder not being running (although it should be tolerant of that too), but rather tolerant of the volume type not being created or available yet.","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"f51a9121d62ba9ba62d9a45142ad312919559fd0","unresolved":true,"context_lines":[{"line_number":423,"context_line":"                reason \u003d _(\"Invalid `cinder_volume_type %s`\""},{"line_number":424,"context_line":"                           % cinder_volume_type)"},{"line_number":425,"context_line":"                LOG.warning(reason)"},{"line_number":426,"context_line":"            except cinder_exception.ClientException:"},{"line_number":427,"context_line":"                pass"},{"line_number":428,"context_line":""},{"line_number":429,"context_line":"    def is_image_associated_with_store(self, context, volume_id):"}],"source_content_type":"text/x-python","patch_set":6,"id":"aaad7fe0_391292ff","line":426,"range":{"start_line":426,"start_character":36,"end_line":426,"end_character":51},"updated":"2021-02-12 17:57:46.000000000","message":"what\u0027s whe ClientException from cinderclient? In which cases we are expecting to see this happening? My main question, I guess, is why we should not log these?","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a14fa2ff18b54b8fc6564dee13c9c9b0196c9b4b","unresolved":true,"context_lines":[{"line_number":423,"context_line":"                reason \u003d _(\"Invalid `cinder_volume_type %s`\""},{"line_number":424,"context_line":"                           % cinder_volume_type)"},{"line_number":425,"context_line":"                LOG.warning(reason)"},{"line_number":426,"context_line":"            except cinder_exception.ClientException:"},{"line_number":427,"context_line":"                pass"},{"line_number":428,"context_line":""},{"line_number":429,"context_line":"    def is_image_associated_with_store(self, context, volume_id):"}],"source_content_type":"text/x-python","patch_set":6,"id":"e4314223_5aa2c1ba","line":426,"range":{"start_line":426,"start_character":36,"end_line":426,"end_character":51},"in_reply_to":"aaad7fe0_391292ff","updated":"2021-02-12 18:10:47.000000000","message":"Presumably this would be if c-api is down. We could log \"couldn\u0027t validate volume type\" I guess, but we can\u0027t say anything more definitive than that. I guess my preference would be to keep what Rajat has here, and not complain too loudly in the glance logs that cinder is not running. It\u0027s not a failure, we\u0027ll report the real failure later, it\u0027s just that we couldn\u0027t run the convenience validation at startup time.","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"f51a9121d62ba9ba62d9a45142ad312919559fd0","unresolved":true,"context_lines":[{"line_number":842,"context_line":"                                           metadata\u003dmetadata,"},{"line_number":843,"context_line":"                                           volume_type\u003dvolume_type)"},{"line_number":844,"context_line":"        except cinder_exception.NotFound:"},{"line_number":845,"context_line":"            LOG.error(\"Invalid volume type %s configured. Please check \""},{"line_number":846,"context_line":"                      \"`cinder_volume_type` configuration parameter.\""},{"line_number":847,"context_line":"                      % volume_type)"},{"line_number":848,"context_line":"            raise exceptions.BackendException"}],"source_content_type":"text/x-python","patch_set":6,"id":"0e24dedc_0694c0e4","line":845,"range":{"start_line":845,"start_character":21,"end_line":845,"end_character":23},"updated":"2021-02-12 17:57:46.000000000","message":"Translation (_LE( here too.","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0c40a3600896218bece55fa8f780a40bde8cb67f","unresolved":true,"context_lines":[{"line_number":842,"context_line":"                                           metadata\u003dmetadata,"},{"line_number":843,"context_line":"                                           volume_type\u003dvolume_type)"},{"line_number":844,"context_line":"        except cinder_exception.NotFound:"},{"line_number":845,"context_line":"            LOG.error(\"Invalid volume type %s configured. Please check \""},{"line_number":846,"context_line":"                      \"`cinder_volume_type` configuration parameter.\""},{"line_number":847,"context_line":"                      % volume_type)"},{"line_number":848,"context_line":"            raise exceptions.BackendException"}],"source_content_type":"text/x-python","patch_set":6,"id":"0b709245_f9d65183","line":845,"range":{"start_line":845,"start_character":65,"end_line":845,"end_character":70},"updated":"2021-02-12 17:36:45.000000000","message":"s/check/check the/","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"454bd258bff4dfd13a04963ee7cccdda2fd4bb91","unresolved":false,"context_lines":[{"line_number":842,"context_line":"                                           metadata\u003dmetadata,"},{"line_number":843,"context_line":"                                           volume_type\u003dvolume_type)"},{"line_number":844,"context_line":"        except cinder_exception.NotFound:"},{"line_number":845,"context_line":"            LOG.error(\"Invalid volume type %s configured. Please check \""},{"line_number":846,"context_line":"                      \"`cinder_volume_type` configuration parameter.\""},{"line_number":847,"context_line":"                      % volume_type)"},{"line_number":848,"context_line":"            raise exceptions.BackendException"}],"source_content_type":"text/x-python","patch_set":6,"id":"74227b48_522e9398","line":845,"range":{"start_line":845,"start_character":65,"end_line":845,"end_character":70},"in_reply_to":"0b709245_f9d65183","updated":"2021-02-15 13:48:16.000000000","message":"Done","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"454bd258bff4dfd13a04963ee7cccdda2fd4bb91","unresolved":false,"context_lines":[{"line_number":842,"context_line":"                                           metadata\u003dmetadata,"},{"line_number":843,"context_line":"                                           volume_type\u003dvolume_type)"},{"line_number":844,"context_line":"        except cinder_exception.NotFound:"},{"line_number":845,"context_line":"            LOG.error(\"Invalid volume type %s configured. Please check \""},{"line_number":846,"context_line":"                      \"`cinder_volume_type` configuration parameter.\""},{"line_number":847,"context_line":"                      % volume_type)"},{"line_number":848,"context_line":"            raise exceptions.BackendException"}],"source_content_type":"text/x-python","patch_set":6,"id":"3b2f77aa_8286e40b","line":845,"range":{"start_line":845,"start_character":21,"end_line":845,"end_character":23},"in_reply_to":"0e24dedc_0694c0e4","updated":"2021-02-15 13:48:16.000000000","message":"Done","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0c40a3600896218bece55fa8f780a40bde8cb67f","unresolved":true,"context_lines":[{"line_number":845,"context_line":"            LOG.error(\"Invalid volume type %s configured. Please check \""},{"line_number":846,"context_line":"                      \"`cinder_volume_type` configuration parameter.\""},{"line_number":847,"context_line":"                      % volume_type)"},{"line_number":848,"context_line":"            raise exceptions.BackendException"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"        volume \u003d self._wait_volume_status(volume, \u0027creating\u0027, \u0027available\u0027)"},{"line_number":851,"context_line":"        size_gb \u003d volume.size"}],"source_content_type":"text/x-python","patch_set":6,"id":"c10bf775_ee7ac446","line":848,"updated":"2021-02-12 17:36:45.000000000","message":"Did you mean to raise an instance instead of a class, and presumably with a message?","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"454bd258bff4dfd13a04963ee7cccdda2fd4bb91","unresolved":false,"context_lines":[{"line_number":845,"context_line":"            LOG.error(\"Invalid volume type %s configured. Please check \""},{"line_number":846,"context_line":"                      \"`cinder_volume_type` configuration parameter.\""},{"line_number":847,"context_line":"                      % volume_type)"},{"line_number":848,"context_line":"            raise exceptions.BackendException"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"        volume \u003d self._wait_volume_status(volume, \u0027creating\u0027, \u0027available\u0027)"},{"line_number":851,"context_line":"        size_gb \u003d volume.size"}],"source_content_type":"text/x-python","patch_set":6,"id":"f0093f98_f9aa0274","line":848,"in_reply_to":"7ba3878d_0bdf6073","updated":"2021-02-15 13:48:16.000000000","message":"Done","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"f51a9121d62ba9ba62d9a45142ad312919559fd0","unresolved":true,"context_lines":[{"line_number":845,"context_line":"            LOG.error(\"Invalid volume type %s configured. Please check \""},{"line_number":846,"context_line":"                      \"`cinder_volume_type` configuration parameter.\""},{"line_number":847,"context_line":"                      % volume_type)"},{"line_number":848,"context_line":"            raise exceptions.BackendException"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"        volume \u003d self._wait_volume_status(volume, \u0027creating\u0027, \u0027available\u0027)"},{"line_number":851,"context_line":"        size_gb \u003d volume.size"}],"source_content_type":"text/x-python","patch_set":6,"id":"7ba3878d_0bdf6073","line":848,"in_reply_to":"c10bf775_ee7ac446","updated":"2021-02-12 17:57:46.000000000","message":"++","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"16484371321ac92c9e1fd7c06c599fdbf42d70c9","unresolved":true,"context_lines":[{"line_number":417,"context_line":"                # We don\u0027t even need the volume type object, as long"},{"line_number":418,"context_line":"                # as this returns clean, we know the name is good."},{"line_number":419,"context_line":"                cinder_client.volume_types.find(name\u003dcinder_volume_type)"},{"line_number":420,"context_line":"                # No need to worry NoUniqueMatch as volume type name is"},{"line_number":421,"context_line":"                # unique"},{"line_number":422,"context_line":"            except cinder_exception.NotFound:"},{"line_number":423,"context_line":"                reason \u003d (_LE(\"Invalid `cinder_volume_type %s`\""}],"source_content_type":"text/x-python","patch_set":7,"id":"2490c025_669200cf","line":420,"range":{"start_line":420,"start_character":29,"end_line":420,"end_character":35},"updated":"2021-02-15 13:59:49.000000000","message":"s/worry/worry for","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33bd20d113760aab6ae44ad892234c4e30ebed43","unresolved":false,"context_lines":[{"line_number":417,"context_line":"                # We don\u0027t even need the volume type object, as long"},{"line_number":418,"context_line":"                # as this returns clean, we know the name is good."},{"line_number":419,"context_line":"                cinder_client.volume_types.find(name\u003dcinder_volume_type)"},{"line_number":420,"context_line":"                # No need to worry NoUniqueMatch as volume type name is"},{"line_number":421,"context_line":"                # unique"},{"line_number":422,"context_line":"            except cinder_exception.NotFound:"},{"line_number":423,"context_line":"                reason \u003d (_LE(\"Invalid `cinder_volume_type %s`\""}],"source_content_type":"text/x-python","patch_set":7,"id":"d392d7b6_d5e90886","line":420,"range":{"start_line":420,"start_character":29,"end_line":420,"end_character":35},"in_reply_to":"2490c025_669200cf","updated":"2021-02-15 14:16:09.000000000","message":"Done","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"9a0e102e50cc47c9004b0fed6b77a85e3686f882","unresolved":true,"context_lines":[{"line_number":420,"context_line":"                # No need to worry NoUniqueMatch as volume type name is"},{"line_number":421,"context_line":"                # unique"},{"line_number":422,"context_line":"            except cinder_exception.NotFound:"},{"line_number":423,"context_line":"                reason \u003d (_LE(\"Invalid `cinder_volume_type %s`\""},{"line_number":424,"context_line":"                              % cinder_volume_type))"},{"line_number":425,"context_line":"                LOG.warning(reason)"},{"line_number":426,"context_line":"            except cinder_exception.ClientException:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3cec3cc9_4c7f7f09","line":423,"range":{"start_line":423,"start_character":26,"end_line":423,"end_character":29},"updated":"2021-02-15 14:15:43.000000000","message":"This should be _LW","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"b834752d4071417935b9df3cbb0b1af1ada3b9c1","unresolved":false,"context_lines":[{"line_number":420,"context_line":"                # No need to worry NoUniqueMatch as volume type name is"},{"line_number":421,"context_line":"                # unique"},{"line_number":422,"context_line":"            except cinder_exception.NotFound:"},{"line_number":423,"context_line":"                reason \u003d (_LE(\"Invalid `cinder_volume_type %s`\""},{"line_number":424,"context_line":"                              % cinder_volume_type))"},{"line_number":425,"context_line":"                LOG.warning(reason)"},{"line_number":426,"context_line":"            except cinder_exception.ClientException:"}],"source_content_type":"text/x-python","patch_set":7,"id":"dfa30b6a_dd8e0c7c","line":423,"range":{"start_line":423,"start_character":26,"end_line":423,"end_character":29},"in_reply_to":"3cec3cc9_4c7f7f09","updated":"2021-02-15 14:40:27.000000000","message":"Done","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"16484371321ac92c9e1fd7c06c599fdbf42d70c9","unresolved":true,"context_lines":[{"line_number":424,"context_line":"                              % cinder_volume_type))"},{"line_number":425,"context_line":"                LOG.warning(reason)"},{"line_number":426,"context_line":"            except cinder_exception.ClientException:"},{"line_number":427,"context_line":"                pass"},{"line_number":428,"context_line":""},{"line_number":429,"context_line":"    def is_image_associated_with_store(self, context, volume_id):"},{"line_number":430,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"75fbc9c9_38e247c3","line":427,"range":{"start_line":427,"start_character":16,"end_line":427,"end_character":20},"updated":"2021-02-15 13:59:49.000000000","message":"Instead of using pass, can we log warning or at least a debug message here;\nexcept cinder_exception.ClientException as e:\n    LOG.debug(e.msg) or LOG.debug(\"Something went wrong while validating cinder_volume_type\", e)","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"db2d5046bc69c4e79f32b9e8c7c9e40273b292f9","unresolved":true,"context_lines":[{"line_number":424,"context_line":"                              % cinder_volume_type))"},{"line_number":425,"context_line":"                LOG.warning(reason)"},{"line_number":426,"context_line":"            except cinder_exception.ClientException:"},{"line_number":427,"context_line":"                pass"},{"line_number":428,"context_line":""},{"line_number":429,"context_line":"    def is_image_associated_with_store(self, context, volume_id):"},{"line_number":430,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"98863ecd_9a1747e7","line":427,"range":{"start_line":427,"start_character":16,"end_line":427,"end_character":20},"in_reply_to":"75fbc9c9_38e247c3","updated":"2021-02-15 14:09:32.000000000","message":"My reason for this pass is cinder isn\u0027t up yet so i didn\u0027t see much value is glance logging about it since there can be lots of reason for the same.\nAlso this was discussed in the last PS and Dan said it\u0027s better to leave it as it is.\nLet me know if everyone thinks this needs to be logged and i will update.","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"9a0e102e50cc47c9004b0fed6b77a85e3686f882","unresolved":false,"context_lines":[{"line_number":424,"context_line":"                              % cinder_volume_type))"},{"line_number":425,"context_line":"                LOG.warning(reason)"},{"line_number":426,"context_line":"            except cinder_exception.ClientException:"},{"line_number":427,"context_line":"                pass"},{"line_number":428,"context_line":""},{"line_number":429,"context_line":"    def is_image_associated_with_store(self, context, volume_id):"},{"line_number":430,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"e57d4af8_ca09ecc3","line":427,"range":{"start_line":427,"start_character":16,"end_line":427,"end_character":20},"in_reply_to":"98863ecd_9a1747e7","updated":"2021-02-15 14:15:43.000000000","message":"Ok","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dbd7553f4ec82eec6bc2704e2556a4cef38e0b87","unresolved":false,"context_lines":[{"line_number":424,"context_line":"                              % cinder_volume_type))"},{"line_number":425,"context_line":"                LOG.warning(reason)"},{"line_number":426,"context_line":"            except cinder_exception.ClientException:"},{"line_number":427,"context_line":"                pass"},{"line_number":428,"context_line":""},{"line_number":429,"context_line":"    def is_image_associated_with_store(self, context, volume_id):"},{"line_number":430,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"8575f4da_115e58c9","line":427,"range":{"start_line":427,"start_character":16,"end_line":427,"end_character":20},"in_reply_to":"e57d4af8_ca09ecc3","updated":"2021-02-15 14:41:57.000000000","message":"Yeah, if this can only be raised when cinder is down, I wouldn\u0027t really think it was worth the log noise, especially since it\u0027s a perfectly valid scenario, given we will just handle it at runtime.\n\nNow, if there are other things that could be raised here that are useful, it would be good to log those (maybe we could get an auth error here?) but otherwise I think this makes sense.","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dbd7553f4ec82eec6bc2704e2556a4cef38e0b87","unresolved":true,"context_lines":[{"line_number":406,"context_line":"    def configure_add(self):"},{"line_number":407,"context_line":"        \"\"\""},{"line_number":408,"context_line":"        Check to verify if the volume types configured for the cinder store"},{"line_number":409,"context_line":"        exists in deployment and if not, log a warning."},{"line_number":410,"context_line":"        \"\"\""},{"line_number":411,"context_line":"        cinder_volume_type \u003d self.store_conf.cinder_volume_type"},{"line_number":412,"context_line":"        if cinder_volume_type:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7fd31e28_78e38d64","line":409,"range":{"start_line":409,"start_character":8,"end_line":409,"end_character":14},"updated":"2021-02-15 14:41:57.000000000","message":"nit: If \"types\" is pluralized, this should not be.","commit_id":"1a4f56f01a376c9c9f9823724b383c8884b1194d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"b3472476a9ad6d96546da34e1e96fd34a9737dc5","unresolved":false,"context_lines":[{"line_number":406,"context_line":"    def configure_add(self):"},{"line_number":407,"context_line":"        \"\"\""},{"line_number":408,"context_line":"        Check to verify if the volume types configured for the cinder store"},{"line_number":409,"context_line":"        exists in deployment and if not, log a warning."},{"line_number":410,"context_line":"        \"\"\""},{"line_number":411,"context_line":"        cinder_volume_type \u003d self.store_conf.cinder_volume_type"},{"line_number":412,"context_line":"        if cinder_volume_type:"}],"source_content_type":"text/x-python","patch_set":8,"id":"0a118132_dae0b9e9","line":409,"range":{"start_line":409,"start_character":8,"end_line":409,"end_character":14},"in_reply_to":"7fd31e28_78e38d64","updated":"2021-02-15 17:32:10.000000000","message":"Done","commit_id":"1a4f56f01a376c9c9f9823724b383c8884b1194d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dbd7553f4ec82eec6bc2704e2556a4cef38e0b87","unresolved":true,"context_lines":[{"line_number":417,"context_line":"                # We don\u0027t even need the volume type object, as long"},{"line_number":418,"context_line":"                # as this returns clean, we know the name is good."},{"line_number":419,"context_line":"                cinder_client.volume_types.find(name\u003dcinder_volume_type)"},{"line_number":420,"context_line":"                # No need to worry for NoUniqueMatch as volume type name is"},{"line_number":421,"context_line":"                # unique"},{"line_number":422,"context_line":"            except cinder_exception.NotFound:"},{"line_number":423,"context_line":"                reason \u003d (_LE(\"Invalid `cinder_volume_type %s`\""}],"source_content_type":"text/x-python","patch_set":8,"id":"fec3bf15_d55bba02","line":420,"range":{"start_line":420,"start_character":35,"end_line":420,"end_character":38},"updated":"2021-02-15 14:41:57.000000000","message":"Technically, this should be \"about a\", but this wasn\u0027t changing this comment anyway, just moving it so not important :)","commit_id":"1a4f56f01a376c9c9f9823724b383c8884b1194d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"b3472476a9ad6d96546da34e1e96fd34a9737dc5","unresolved":false,"context_lines":[{"line_number":417,"context_line":"                # We don\u0027t even need the volume type object, as long"},{"line_number":418,"context_line":"                # as this returns clean, we know the name is good."},{"line_number":419,"context_line":"                cinder_client.volume_types.find(name\u003dcinder_volume_type)"},{"line_number":420,"context_line":"                # No need to worry for NoUniqueMatch as volume type name is"},{"line_number":421,"context_line":"                # unique"},{"line_number":422,"context_line":"            except cinder_exception.NotFound:"},{"line_number":423,"context_line":"                reason \u003d (_LE(\"Invalid `cinder_volume_type %s`\""}],"source_content_type":"text/x-python","patch_set":8,"id":"6edee551_75d665af","line":420,"range":{"start_line":420,"start_character":35,"end_line":420,"end_character":38},"in_reply_to":"fec3bf15_d55bba02","updated":"2021-02-15 17:32:10.000000000","message":"Done","commit_id":"1a4f56f01a376c9c9f9823724b383c8884b1194d"}],"glance_store/tests/unit/test_cinder_store.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"04180c38498325c410fd7443034392077e137f75","unresolved":true,"context_lines":[{"line_number":327,"context_line":"            image_size \u003d self.store.get_size(loc, context\u003dself.context)"},{"line_number":328,"context_line":"            self.assertEqual(expected_image_size, image_size)"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    @mock.patch.object(cinder.Store, \u0027_validate_volume_type\u0027)"},{"line_number":331,"context_line":"    def _test_cinder_add(self, fake_volume, volume_file, mock_validate_type,"},{"line_number":332,"context_line":"                         size_kb\u003d5, verifier\u003dNone):"},{"line_number":333,"context_line":"        expected_image_id \u003d str(uuid.uuid4())"}],"source_content_type":"text/x-python","patch_set":2,"id":"354ed1cb_1555c077","line":330,"range":{"start_line":330,"start_character":4,"end_line":330,"end_character":47},"updated":"2021-02-11 05:44:51.000000000","message":"I guess you need to add test to cover _is_volume_type for single store as well.","commit_id":"d90318d474b4f0106a62661228164cb725ae13ba"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"a3f32d853a267e4865c0d0e9e0195404930032bd","unresolved":false,"context_lines":[{"line_number":327,"context_line":"            image_size \u003d self.store.get_size(loc, context\u003dself.context)"},{"line_number":328,"context_line":"            self.assertEqual(expected_image_size, image_size)"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    @mock.patch.object(cinder.Store, \u0027_validate_volume_type\u0027)"},{"line_number":331,"context_line":"    def _test_cinder_add(self, fake_volume, volume_file, mock_validate_type,"},{"line_number":332,"context_line":"                         size_kb\u003d5, verifier\u003dNone):"},{"line_number":333,"context_line":"        expected_image_id \u003d str(uuid.uuid4())"}],"source_content_type":"text/x-python","patch_set":2,"id":"d6441508_bf29401f","line":330,"range":{"start_line":330,"start_character":4,"end_line":330,"end_character":47},"in_reply_to":"354ed1cb_1555c077","updated":"2021-02-11 09:16:09.000000000","message":"Done","commit_id":"d90318d474b4f0106a62661228164cb725ae13ba"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"30cadbbcd75a9936ce98940e0e15f968f0dc0250","unresolved":true,"context_lines":[{"line_number":419,"context_line":"            raise ex"},{"line_number":420,"context_line":"        fake_client \u003d FakeObject(volume_types\u003dFakeObject("},{"line_number":421,"context_line":"            find\u003dlambda name: \u0027some_type\u0027 if name \u003d\u003d \u0027some_type\u0027"},{"line_number":422,"context_line":"            else raise_(cinder.cinder_exception.NotFound(code\u003d404))))"},{"line_number":423,"context_line":"        cinder_volume_type \u003d \u0027some_type\u0027"},{"line_number":424,"context_line":"        # If volume type exists, no exception is raised"},{"line_number":425,"context_line":"        self.store._validate_volume_type(fake_client, cinder_volume_type)"}],"source_content_type":"text/x-python","patch_set":4,"id":"36e8bd35_f4d166dd","line":422,"updated":"2021-02-11 17:32:43.000000000","message":"This lambda is pretty brutal for readability, so I\u0027d recommend pulling it out so it\u0027s easier to eye-parse.\n\nBonus points for your compact functional programming skills though :)","commit_id":"1e9d920c64f608d8e663a2ceef012111ad27ca48"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"30cadbbcd75a9936ce98940e0e15f968f0dc0250","unresolved":true,"context_lines":[{"line_number":426,"context_line":"        # setting cinder_volume_type to non-existent value will raise"},{"line_number":427,"context_line":"        # BadStoreConfiguration exception"},{"line_number":428,"context_line":"        cinder_volume_type \u003d \u0027some_random_type\u0027"},{"line_number":429,"context_line":"        self.assertRaises(exceptions.BackendException,"},{"line_number":430,"context_line":"                          self.store._validate_volume_type,"},{"line_number":431,"context_line":"                          fake_client, cinder_volume_type)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9ede8005_4034256c","line":429,"updated":"2021-02-11 17:32:43.000000000","message":"This returns the exception, which you can examine to make sure it\u0027s the exact reason you\u0027re expecting (and properly formatted, since it\u0027s important for understanding what the problem is).","commit_id":"1e9d920c64f608d8e663a2ceef012111ad27ca48"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0c40a3600896218bece55fa8f780a40bde8cb67f","unresolved":true,"context_lines":[{"line_number":419,"context_line":"        with mock.patch.object(self.store, \u0027get_cinderclient\u0027) as mocked_cc:"},{"line_number":420,"context_line":"            mocked_cc.return_value \u003d FakeObject(volume_types\u003dFakeObject("},{"line_number":421,"context_line":"                find\u003dlambda name: \u0027some_type\u0027 if name \u003d\u003d \u0027some_type\u0027"},{"line_number":422,"context_line":"                else raise_(cinder.cinder_exception.NotFound(code\u003d404))))"},{"line_number":423,"context_line":"            self.config(cinder_volume_type\u003d\u0027some_type\u0027)"},{"line_number":424,"context_line":"            # If volume type exists, no exception is raised"},{"line_number":425,"context_line":"            self.store.configure_add()"}],"source_content_type":"text/x-python","patch_set":6,"id":"a5952ee7_7af88920","line":422,"updated":"2021-02-12 17:36:45.000000000","message":"I still think this is too hard to read :)","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"454bd258bff4dfd13a04963ee7cccdda2fd4bb91","unresolved":false,"context_lines":[{"line_number":419,"context_line":"        with mock.patch.object(self.store, \u0027get_cinderclient\u0027) as mocked_cc:"},{"line_number":420,"context_line":"            mocked_cc.return_value \u003d FakeObject(volume_types\u003dFakeObject("},{"line_number":421,"context_line":"                find\u003dlambda name: \u0027some_type\u0027 if name \u003d\u003d \u0027some_type\u0027"},{"line_number":422,"context_line":"                else raise_(cinder.cinder_exception.NotFound(code\u003d404))))"},{"line_number":423,"context_line":"            self.config(cinder_volume_type\u003d\u0027some_type\u0027)"},{"line_number":424,"context_line":"            # If volume type exists, no exception is raised"},{"line_number":425,"context_line":"            self.store.configure_add()"}],"source_content_type":"text/x-python","patch_set":6,"id":"ccbf7f91_05a26414","line":422,"in_reply_to":"a5952ee7_7af88920","updated":"2021-02-15 13:48:16.000000000","message":"Sorry i missed your earlier comment, Done.","commit_id":"4a679ab79155f5a640a0688da6766b86ce1df922"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"16484371321ac92c9e1fd7c06c599fdbf42d70c9","unresolved":true,"context_lines":[{"line_number":379,"context_line":"                                     size\u003d1)"},{"line_number":380,"context_line":"        volume_file \u003d six.BytesIO()"},{"line_number":381,"context_line":"        verifier \u003d mock.MagicMock()"},{"line_number":382,"context_line":"        self._test_cinder_add(fake_volume, volume_file, size_kb\u003d1,"},{"line_number":383,"context_line":"                              verifier\u003dverifier)"},{"line_number":384,"context_line":"        verifier.update.assert_called_with(b\"*\" * units.Ki)"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"    def test_cinder_add_volume_full(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"c9cd1d49_128f7011","line":383,"range":{"start_line":382,"start_character":56,"end_line":383,"end_character":47},"updated":"2021-02-15 13:59:49.000000000","message":"Why this change?","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"9a0e102e50cc47c9004b0fed6b77a85e3686f882","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                                     size\u003d1)"},{"line_number":380,"context_line":"        volume_file \u003d six.BytesIO()"},{"line_number":381,"context_line":"        verifier \u003d mock.MagicMock()"},{"line_number":382,"context_line":"        self._test_cinder_add(fake_volume, volume_file, size_kb\u003d1,"},{"line_number":383,"context_line":"                              verifier\u003dverifier)"},{"line_number":384,"context_line":"        verifier.update.assert_called_with(b\"*\" * units.Ki)"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"    def test_cinder_add_volume_full(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"a6abad4f_4d0eeb35","line":383,"range":{"start_line":382,"start_character":56,"end_line":383,"end_character":47},"in_reply_to":"60952f55_ed6990ea","updated":"2021-02-15 14:15:43.000000000","message":"Ack","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33bd20d113760aab6ae44ad892234c4e30ebed43","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                                     size\u003d1)"},{"line_number":380,"context_line":"        volume_file \u003d six.BytesIO()"},{"line_number":381,"context_line":"        verifier \u003d mock.MagicMock()"},{"line_number":382,"context_line":"        self._test_cinder_add(fake_volume, volume_file, size_kb\u003d1,"},{"line_number":383,"context_line":"                              verifier\u003dverifier)"},{"line_number":384,"context_line":"        verifier.update.assert_called_with(b\"*\" * units.Ki)"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"    def test_cinder_add_volume_full(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"6bf54576_a79bc600","line":383,"range":{"start_line":382,"start_character":56,"end_line":383,"end_character":47},"in_reply_to":"60952f55_ed6990ea","updated":"2021-02-15 14:16:09.000000000","message":"Done","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"db2d5046bc69c4e79f32b9e8c7c9e40273b292f9","unresolved":true,"context_lines":[{"line_number":379,"context_line":"                                     size\u003d1)"},{"line_number":380,"context_line":"        volume_file \u003d six.BytesIO()"},{"line_number":381,"context_line":"        verifier \u003d mock.MagicMock()"},{"line_number":382,"context_line":"        self._test_cinder_add(fake_volume, volume_file, size_kb\u003d1,"},{"line_number":383,"context_line":"                              verifier\u003dverifier)"},{"line_number":384,"context_line":"        verifier.update.assert_called_with(b\"*\" * units.Ki)"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"    def test_cinder_add_volume_full(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"60952f55_ed6990ea","line":383,"range":{"start_line":382,"start_character":56,"end_line":383,"end_character":47},"in_reply_to":"c9cd1d49_128f7011","updated":"2021-02-15 14:09:32.000000000","message":"This was done because i was mocking validate method previously in _test_cinder_add and i kept it now since it\u0027s the right way to pass optional arguments but i think it\u0027s better to do the refactoring in a separate patch, will remove in next PS.","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dbd7553f4ec82eec6bc2704e2556a4cef38e0b87","unresolved":true,"context_lines":[{"line_number":418,"context_line":""},{"line_number":419,"context_line":"        def fake_volume_type(name):"},{"line_number":420,"context_line":"            if name !\u003d \u0027some_type\u0027:"},{"line_number":421,"context_line":"                raise_(cinder.cinder_exception.NotFound(code\u003d404))"},{"line_number":422,"context_line":""},{"line_number":423,"context_line":"        with mock.patch.object(self.store, \u0027get_cinderclient\u0027) as mocked_cc:"},{"line_number":424,"context_line":"            mocked_cc.return_value \u003d FakeObject(volume_types\u003dFakeObject("}],"source_content_type":"text/x-python","patch_set":8,"id":"f9b7424b_4f85dc19","line":421,"range":{"start_line":421,"start_character":16,"end_line":421,"end_character":22},"updated":"2021-02-15 14:41:57.000000000","message":"You don\u0027t need this anymore now that you are not using a lambda","commit_id":"1a4f56f01a376c9c9f9823724b383c8884b1194d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"b3472476a9ad6d96546da34e1e96fd34a9737dc5","unresolved":false,"context_lines":[{"line_number":418,"context_line":""},{"line_number":419,"context_line":"        def fake_volume_type(name):"},{"line_number":420,"context_line":"            if name !\u003d \u0027some_type\u0027:"},{"line_number":421,"context_line":"                raise_(cinder.cinder_exception.NotFound(code\u003d404))"},{"line_number":422,"context_line":""},{"line_number":423,"context_line":"        with mock.patch.object(self.store, \u0027get_cinderclient\u0027) as mocked_cc:"},{"line_number":424,"context_line":"            mocked_cc.return_value \u003d FakeObject(volume_types\u003dFakeObject("}],"source_content_type":"text/x-python","patch_set":8,"id":"a6297191_18b1586d","line":421,"range":{"start_line":421,"start_character":16,"end_line":421,"end_character":22},"in_reply_to":"f9b7424b_4f85dc19","updated":"2021-02-15 17:32:10.000000000","message":"Done","commit_id":"1a4f56f01a376c9c9f9823724b383c8884b1194d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dbd7553f4ec82eec6bc2704e2556a4cef38e0b87","unresolved":true,"context_lines":[{"line_number":432,"context_line":"            with mock.patch.object(cinder, \u0027LOG\u0027) as mock_log:"},{"line_number":433,"context_line":"                self.store.configure_add()"},{"line_number":434,"context_line":"                mock_log.warning.assert_called_with("},{"line_number":435,"context_line":"                    \"Invalid `cinder_volume_type some_random_type`\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"23f04b5f_48354c3c","line":435,"updated":"2021-02-15 14:41:57.000000000","message":"Can we have a test for a cinder client exception being ignored? And also an unexpected one being raised?","commit_id":"1a4f56f01a376c9c9f9823724b383c8884b1194d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"b3472476a9ad6d96546da34e1e96fd34a9737dc5","unresolved":false,"context_lines":[{"line_number":432,"context_line":"            with mock.patch.object(cinder, \u0027LOG\u0027) as mock_log:"},{"line_number":433,"context_line":"                self.store.configure_add()"},{"line_number":434,"context_line":"                mock_log.warning.assert_called_with("},{"line_number":435,"context_line":"                    \"Invalid `cinder_volume_type some_random_type`\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"f36f8e64_d069e8a3","line":435,"in_reply_to":"23f04b5f_48354c3c","updated":"2021-02-15 17:32:10.000000000","message":"Done","commit_id":"1a4f56f01a376c9c9f9823724b383c8884b1194d"}],"glance_store/tests/unit/test_multistore_cinder.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"04180c38498325c410fd7443034392077e137f75","unresolved":true,"context_lines":[{"line_number":271,"context_line":""},{"line_number":272,"context_line":"        self.store._check_context(FakeObject(service_catalog\u003d\u0027fake\u0027))"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"    def test__validate_volume_type(self):"},{"line_number":275,"context_line":"        def raise_(ex):"},{"line_number":276,"context_line":"            raise ex"},{"line_number":277,"context_line":"        fake_client \u003d FakeObject(volume_types\u003dFakeObject("}],"source_content_type":"text/x-python","patch_set":2,"id":"84da0548_e6c26e6b","line":274,"range":{"start_line":274,"start_character":12,"end_line":274,"end_character":13},"updated":"2021-02-11 05:44:51.000000000","message":"extra _","commit_id":"d90318d474b4f0106a62661228164cb725ae13ba"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"a3f32d853a267e4865c0d0e9e0195404930032bd","unresolved":true,"context_lines":[{"line_number":271,"context_line":""},{"line_number":272,"context_line":"        self.store._check_context(FakeObject(service_catalog\u003d\u0027fake\u0027))"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"    def test__validate_volume_type(self):"},{"line_number":275,"context_line":"        def raise_(ex):"},{"line_number":276,"context_line":"            raise ex"},{"line_number":277,"context_line":"        fake_client \u003d FakeObject(volume_types\u003dFakeObject("}],"source_content_type":"text/x-python","patch_set":2,"id":"528f51f8_a3295ee6","line":274,"range":{"start_line":274,"start_character":12,"end_line":274,"end_character":13},"in_reply_to":"84da0548_e6c26e6b","updated":"2021-02-11 09:16:09.000000000","message":"the method name is `_validate_volume_type` (private method) and the convention we follow to start a testcase is `test_` therefore we\u0027ve 2 __ here. The same we follow in cinder[1]\n\n[1] https://github.com/openstack/cinder/blob/master/cinder/tests/unit/volume/test_volume.py#L2163","commit_id":"d90318d474b4f0106a62661228164cb725ae13ba"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"16484371321ac92c9e1fd7c06c599fdbf42d70c9","unresolved":true,"context_lines":[{"line_number":451,"context_line":"                                     size\u003d1)"},{"line_number":452,"context_line":"        volume_file \u003d six.BytesIO()"},{"line_number":453,"context_line":"        verifier \u003d mock.MagicMock()"},{"line_number":454,"context_line":"        self._test_cinder_add(fake_volume, volume_file, size_kb\u003d1,"},{"line_number":455,"context_line":"                              verifier\u003dverifier)"},{"line_number":456,"context_line":"        verifier.update.assert_called_with(b\"*\" * units.Ki)"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    def test_cinder_add_volume_full(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3c6c6824_ae17a372","line":455,"range":{"start_line":454,"start_character":56,"end_line":455,"end_character":47},"updated":"2021-02-15 13:59:49.000000000","message":"ditto","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33bd20d113760aab6ae44ad892234c4e30ebed43","unresolved":false,"context_lines":[{"line_number":451,"context_line":"                                     size\u003d1)"},{"line_number":452,"context_line":"        volume_file \u003d six.BytesIO()"},{"line_number":453,"context_line":"        verifier \u003d mock.MagicMock()"},{"line_number":454,"context_line":"        self._test_cinder_add(fake_volume, volume_file, size_kb\u003d1,"},{"line_number":455,"context_line":"                              verifier\u003dverifier)"},{"line_number":456,"context_line":"        verifier.update.assert_called_with(b\"*\" * units.Ki)"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    def test_cinder_add_volume_full(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"b1dfc6de_395eebac","line":455,"range":{"start_line":454,"start_character":56,"end_line":455,"end_character":47},"in_reply_to":"3c6c6824_ae17a372","updated":"2021-02-15 14:16:09.000000000","message":"Done","commit_id":"89185badf997dd22c8ab860b67c2bdadabd22e50"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dbd7553f4ec82eec6bc2704e2556a4cef38e0b87","unresolved":true,"context_lines":[{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        def fake_volume_type(name):"},{"line_number":279,"context_line":"            if name !\u003d \u0027some_type\u0027:"},{"line_number":280,"context_line":"                raise_(cinder.cinder_exception.NotFound(code\u003d404))"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        with mock.patch.object(self.store, \u0027get_cinderclient\u0027) as mocked_cc:"},{"line_number":283,"context_line":"            mocked_cc.return_value \u003d FakeObject(volume_types\u003dFakeObject("}],"source_content_type":"text/x-python","patch_set":8,"id":"14791930_a8ea8222","line":280,"range":{"start_line":280,"start_character":16,"end_line":280,"end_character":22},"updated":"2021-02-15 14:41:57.000000000","message":"Same, no longer needed","commit_id":"1a4f56f01a376c9c9f9823724b383c8884b1194d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"b3472476a9ad6d96546da34e1e96fd34a9737dc5","unresolved":false,"context_lines":[{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        def fake_volume_type(name):"},{"line_number":279,"context_line":"            if name !\u003d \u0027some_type\u0027:"},{"line_number":280,"context_line":"                raise_(cinder.cinder_exception.NotFound(code\u003d404))"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        with mock.patch.object(self.store, \u0027get_cinderclient\u0027) as mocked_cc:"},{"line_number":283,"context_line":"            mocked_cc.return_value \u003d FakeObject(volume_types\u003dFakeObject("}],"source_content_type":"text/x-python","patch_set":8,"id":"2026853a_c83f59a5","line":280,"range":{"start_line":280,"start_character":16,"end_line":280,"end_character":22},"in_reply_to":"14791930_a8ea8222","updated":"2021-02-15 17:32:10.000000000","message":"Done","commit_id":"1a4f56f01a376c9c9f9823724b383c8884b1194d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f1ad8c4fa3e2f327a236ceab533f3ca21094519f","unresolved":true,"context_lines":[{"line_number":320,"context_line":"            # Anything apart from invalid volume type or cinder service"},{"line_number":321,"context_line":"            # down will raise an exception"},{"line_number":322,"context_line":"            self.assertRaises(cinder.exceptions.AuthorizationFailure,"},{"line_number":323,"context_line":"                              self.store.configure_add)"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"    def test_is_image_associated_with_store(self):"},{"line_number":326,"context_line":"        with mock.patch.object(self.store, \u0027get_cinderclient\u0027) as mocked_cc:"}],"source_content_type":"text/x-python","patch_set":10,"id":"e9d2c781_fb5c5292","line":323,"updated":"2021-02-15 17:34:51.000000000","message":"Nice, two birds with one stone :)","commit_id":"6467e574ac9c34d4ba372c5e42465b7d09b8ed24"}],"releasenotes/notes/volume-type-validation-check-011a400d7fb3b307.yaml":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d913320e5427f141c3978ebff1b3d3975b7d4df6","unresolved":true,"context_lines":[{"line_number":7,"context_line":"    startup. It now logs a warning and the glance service starts normally."},{"line_number":8,"context_line":"fixes:"},{"line_number":9,"context_line":"  - |"},{"line_number":10,"context_line":"    Added handling to log and raise proper exception during image create when"},{"line_number":11,"context_line":"    an invalid volume type is configured."}],"source_content_type":"text/x-yaml","patch_set":10,"id":"62dc4a96_3bf03b97","line":10,"updated":"2021-02-16 07:36:46.000000000","message":"This needs reference to launchpad bug\nfixes:\n  - |\n    * Bug 1915163_: Dependency on cinder API can cause deployment failure\n\n    .. _1915163: https://bugs.launchpad.net/glance-store/+bug/1915163","commit_id":"6467e574ac9c34d4ba372c5e42465b7d09b8ed24"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"e96a53017ef1cc2f7713d855e0c38dc6083d63e7","unresolved":false,"context_lines":[{"line_number":7,"context_line":"    startup. It now logs a warning and the glance service starts normally."},{"line_number":8,"context_line":"fixes:"},{"line_number":9,"context_line":"  - |"},{"line_number":10,"context_line":"    Added handling to log and raise proper exception during image create when"},{"line_number":11,"context_line":"    an invalid volume type is configured."}],"source_content_type":"text/x-yaml","patch_set":10,"id":"0c40529f_23635801","line":10,"in_reply_to":"62dc4a96_3bf03b97","updated":"2021-02-16 07:54:06.000000000","message":"This format was raising exception so used one from previously merged patch","commit_id":"6467e574ac9c34d4ba372c5e42465b7d09b8ed24"}]}
