)]}'
{"cinder/db/sqlalchemy/api.py":[{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"620b25f46f2b6e7ec65a19b79323b6544c63e59b","unresolved":false,"context_lines":[{"line_number":1888,"context_line":"    return or_("},{"line_number":1889,"context_line":"        # If volume not in use"},{"line_number":1890,"context_line":"        models.Volume.status !\u003d \u0027in-use\u0027,"},{"line_number":1891,"context_line":"        # Or both volume types have the same qos specs"},{"line_number":1892,"context_line":"        sql.exists().where(and_("},{"line_number":1893,"context_line":"            ~models.VolumeTypes.deleted,"},{"line_number":1894,"context_line":"            models.VolumeTypes.id \u003d\u003d models.Volume.volume_type_id,"}],"source_content_type":"text/x-python","patch_set":13,"id":"da6ed579_1a9b3bcb","line":1891,"updated":"2016-01-12 08:36:30.000000000","message":"I think it should be\nmodels.Volume.status \u003d\u003d \u0027available\u0027, as if volume in other status like attaching, to change Qos at front-end is also not allowed from existed codes.","commit_id":"39e8b07117c73a3b479dac5e6670732dea956308"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"8d8a10f53798439be6e0d0de2be1b0301beca100","unresolved":false,"context_lines":[{"line_number":1888,"context_line":"    return or_("},{"line_number":1889,"context_line":"        # If volume not in use"},{"line_number":1890,"context_line":"        models.Volume.status !\u003d \u0027in-use\u0027,"},{"line_number":1891,"context_line":"        # Or both volume types have the same qos specs"},{"line_number":1892,"context_line":"        sql.exists().where(and_("},{"line_number":1893,"context_line":"            ~models.VolumeTypes.deleted,"},{"line_number":1894,"context_line":"            models.VolumeTypes.id \u003d\u003d models.Volume.volume_type_id,"}],"source_content_type":"text/x-python","patch_set":13,"id":"da6ed579_d3f47788","line":1891,"in_reply_to":"da6ed579_0c822153","updated":"2016-01-13 03:27:07.000000000","message":"Thanks.","commit_id":"39e8b07117c73a3b479dac5e6670732dea956308"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8b423bfe75df567dcf7b2893222abc5838779c96","unresolved":false,"context_lines":[{"line_number":1888,"context_line":"    return or_("},{"line_number":1889,"context_line":"        # If volume not in use"},{"line_number":1890,"context_line":"        models.Volume.status !\u003d \u0027in-use\u0027,"},{"line_number":1891,"context_line":"        # Or both volume types have the same qos specs"},{"line_number":1892,"context_line":"        sql.exists().where(and_("},{"line_number":1893,"context_line":"            ~models.VolumeTypes.deleted,"},{"line_number":1894,"context_line":"            models.VolumeTypes.id \u003d\u003d models.Volume.volume_type_id,"}],"source_content_type":"text/x-python","patch_set":13,"id":"da6ed579_0c822153","line":1891,"in_reply_to":"da6ed579_1a9b3bcb","updated":"2016-01-12 10:12:22.000000000","message":"I\u0027ll change it to \u0027available\u0027 for clarity, but the result will be the same, since this filter is used together with the restrictions imposed in the retype method which force status to be \u0027available\u0027 or \u0027in-use\u0027 only.  So this filter will be irrelevant if status is \u0027attaching\u0027 or anything else.","commit_id":"39e8b07117c73a3b479dac5e6670732dea956308"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"620b25f46f2b6e7ec65a19b79323b6544c63e59b","unresolved":false,"context_lines":[{"line_number":1909,"context_line":"                (models.VolumeTypes.qos_specs_id \u003d\u003d"},{"line_number":1910,"context_line":"                 models.QualityOfServiceSpecs.specs_id),"},{"line_number":1911,"context_line":"                models.QualityOfServiceSpecs.key \u003d\u003d \u0027consumer\u0027,"},{"line_number":1912,"context_line":"                models.QualityOfServiceSpecs.value !\u003d \u0027back-end\u0027))))"},{"line_number":1913,"context_line":""},{"line_number":1914,"context_line":""},{"line_number":1915,"context_line":"####################"}],"source_content_type":"text/x-python","patch_set":13,"id":"da6ed579_3ad87f53","line":1912,"updated":"2016-01-12 08:36:30.000000000","message":"I also did updates in retype function: https://review.openstack.org/#/c/245460/\n\nSeems that I need to update after your update.","commit_id":"39e8b07117c73a3b479dac5e6670732dea956308"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e5b5f3d61dc21fe5f4c71406a1f066dfc168e02c","unresolved":false,"context_lines":[{"line_number":1898,"context_line":"        ~models.Encryption.deleted,"},{"line_number":1899,"context_line":"        models.Encryption.volume_type_id \u003d\u003d models.Volume.volume_type_id))"},{"line_number":1900,"context_line":""},{"line_number":1901,"context_line":"    # NOTE(geguileo): This query is optimizable, but at this moment I can\u0027t"},{"line_number":1902,"context_line":"    #                 this moment I can\u0027t figure out how."},{"line_number":1903,"context_line":"    return or_(and_(new_enc.as_scalar().is_(None),"},{"line_number":1904,"context_line":"                    old_enc.as_scalar().is_(None)),"},{"line_number":1905,"context_line":"               new_enc.as_scalar() \u003d\u003d old_enc.as_scalar())"}],"source_content_type":"text/x-python","patch_set":18,"id":"7af24918_b8f31f72","line":1902,"range":{"start_line":1901,"start_character":53,"end_line":1902,"end_character":41},"updated":"2016-03-04 13:34:49.000000000","message":"I know you really, really can\u0027t figure it out. ;)","commit_id":"2ae6053b172445f10751823a519f67c90a8fcf77"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9d2dc014e3bcfc2a6950b20a7cfff0d8361cb678","unresolved":false,"context_lines":[{"line_number":1898,"context_line":"        ~models.Encryption.deleted,"},{"line_number":1899,"context_line":"        models.Encryption.volume_type_id \u003d\u003d models.Volume.volume_type_id))"},{"line_number":1900,"context_line":""},{"line_number":1901,"context_line":"    # NOTE(geguileo): This query is optimizable, but at this moment I can\u0027t"},{"line_number":1902,"context_line":"    #                 this moment I can\u0027t figure out how."},{"line_number":1903,"context_line":"    return or_(and_(new_enc.as_scalar().is_(None),"},{"line_number":1904,"context_line":"                    old_enc.as_scalar().is_(None)),"},{"line_number":1905,"context_line":"               new_enc.as_scalar() \u003d\u003d old_enc.as_scalar())"}],"source_content_type":"text/x-python","patch_set":18,"id":"7af24918_758fd574","line":1902,"range":{"start_line":1901,"start_character":53,"end_line":1902,"end_character":41},"in_reply_to":"7af24918_b8f31f72","updated":"2016-03-04 16:32:35.000000000","message":"I\u0027m glad I was able to stress my inability to do it, I don\u0027t want any misunderstandings  ;-)","commit_id":"2ae6053b172445f10751823a519f67c90a8fcf77"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e5b5f3d61dc21fe5f4c71406a1f066dfc168e02c","unresolved":false,"context_lines":[{"line_number":1930,"context_line":"        # it is not specified"},{"line_number":1931,"context_line":"        and_("},{"line_number":1932,"context_line":"            ~sql.exists().where(and_("},{"line_number":1933,"context_line":"                ~models.VolumeTypes.deleted,"},{"line_number":1934,"context_line":"                models.VolumeTypes.id \u003d\u003d models.Volume.volume_type_id,"},{"line_number":1935,"context_line":"                (models.VolumeTypes.qos_specs_id \u003d\u003d"},{"line_number":1936,"context_line":"                 models.QualityOfServiceSpecs.specs_id),"},{"line_number":1937,"context_line":"                models.QualityOfServiceSpecs.key \u003d\u003d \u0027consumer\u0027,"},{"line_number":1938,"context_line":"                models.QualityOfServiceSpecs.value !\u003d \u0027back-end\u0027)),"},{"line_number":1939,"context_line":"            ~sql.exists().where(and_("},{"line_number":1940,"context_line":"                ~models.VolumeTypes.deleted,"},{"line_number":1941,"context_line":"                models.VolumeTypes.id \u003d\u003d new_vol_type,"}],"source_content_type":"text/x-python","patch_set":18,"id":"7af24918_7bc23154","line":1938,"range":{"start_line":1933,"start_character":0,"end_line":1938,"end_character":67},"updated":"2016-03-04 13:34:49.000000000","message":"Won\u0027t it evaluate to: \"There exists at least one qos spec that\u0027s \u0027consumer\u0027 is set not to \u0027back-end\u0027? Shouldn\u0027t it be more like: \"There don\u0027t exist a qos_spec that\u0027s \u0027consumer\u0027 is set to \u0027back-end\u0027.\n\nThis is crazy-complicated piece of condition, but I think it is wrong here.","commit_id":"2ae6053b172445f10751823a519f67c90a8fcf77"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"504ae43d129c244cebbca6bf38c7b25bf5618c02","unresolved":false,"context_lines":[{"line_number":1930,"context_line":"        # it is not specified"},{"line_number":1931,"context_line":"        and_("},{"line_number":1932,"context_line":"            ~sql.exists().where(and_("},{"line_number":1933,"context_line":"                ~models.VolumeTypes.deleted,"},{"line_number":1934,"context_line":"                models.VolumeTypes.id \u003d\u003d models.Volume.volume_type_id,"},{"line_number":1935,"context_line":"                (models.VolumeTypes.qos_specs_id \u003d\u003d"},{"line_number":1936,"context_line":"                 models.QualityOfServiceSpecs.specs_id),"},{"line_number":1937,"context_line":"                models.QualityOfServiceSpecs.key \u003d\u003d \u0027consumer\u0027,"},{"line_number":1938,"context_line":"                models.QualityOfServiceSpecs.value !\u003d \u0027back-end\u0027)),"},{"line_number":1939,"context_line":"            ~sql.exists().where(and_("},{"line_number":1940,"context_line":"                ~models.VolumeTypes.deleted,"},{"line_number":1941,"context_line":"                models.VolumeTypes.id \u003d\u003d new_vol_type,"}],"source_content_type":"text/x-python","patch_set":18,"id":"5aef4532_894b5cb0","line":1938,"range":{"start_line":1933,"start_character":0,"end_line":1938,"end_character":67},"in_reply_to":"7af24918_6ef1c294","updated":"2016-03-07 10:41:14.000000000","message":"Oh, I probably missed the negation when evaluating the query. Yeah, this makes sense now. Thank you!","commit_id":"2ae6053b172445f10751823a519f67c90a8fcf77"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9d2dc014e3bcfc2a6950b20a7cfff0d8361cb678","unresolved":false,"context_lines":[{"line_number":1930,"context_line":"        # it is not specified"},{"line_number":1931,"context_line":"        and_("},{"line_number":1932,"context_line":"            ~sql.exists().where(and_("},{"line_number":1933,"context_line":"                ~models.VolumeTypes.deleted,"},{"line_number":1934,"context_line":"                models.VolumeTypes.id \u003d\u003d models.Volume.volume_type_id,"},{"line_number":1935,"context_line":"                (models.VolumeTypes.qos_specs_id \u003d\u003d"},{"line_number":1936,"context_line":"                 models.QualityOfServiceSpecs.specs_id),"},{"line_number":1937,"context_line":"                models.QualityOfServiceSpecs.key \u003d\u003d \u0027consumer\u0027,"},{"line_number":1938,"context_line":"                models.QualityOfServiceSpecs.value !\u003d \u0027back-end\u0027)),"},{"line_number":1939,"context_line":"            ~sql.exists().where(and_("},{"line_number":1940,"context_line":"                ~models.VolumeTypes.deleted,"},{"line_number":1941,"context_line":"                models.VolumeTypes.id \u003d\u003d new_vol_type,"}],"source_content_type":"text/x-python","patch_set":18,"id":"7af24918_6ef1c294","line":1938,"range":{"start_line":1933,"start_character":0,"end_line":1938,"end_character":67},"in_reply_to":"7af24918_7bc23154","updated":"2016-03-04 16:32:35.000000000","message":"I think it is right, and yes, this is a crazy condition that took me a while to get right in the smallest possible query I could think of (you don\u0027t want to see what it was like when trying to manually match for \u0027front\u0027end\u0027 and NULL), but since it\u0027s what we have in the code it\u0027s what I had to mimic in the DB.\n\nWe are negating this whole exists subquery at L1932, so it\u0027s saying that there must NOT exist a QoS \u0027consumer\u0027 key for the type of the volume where the value is not \u0027back-end\u0027 or NULL. As mentioned in the comments.\n\nThere is some SQL implicit knowledge needed here to understand it, and that is that when evaluating value !\u003d \u0027back-end\u0027 it will be False when value is \u0027back-end\u0027 as well as when it is NULL, because that\u0027s how comparison works in SQL.  ;-)\n\nIf we wanted to check for it being \u0027front-end\u0027 or NULL we would end up with an or expression, which I think it\u0027s worse.","commit_id":"2ae6053b172445f10751823a519f67c90a8fcf77"}],"cinder/tests/unit/api/contrib/test_volume_actions.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"00f0700cc983ed55e7118ec840c6a008995a8f4e","unresolved":false,"context_lines":[{"line_number":733,"context_line":""},{"line_number":734,"context_line":"        self._retype_volume_exec(expected_status, vol_type_new, vol.id)"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"    def test_retype_volume_orig_no_type_dest_no_enc(self):"},{"line_number":737,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 202, False, False, False)"},{"line_number":738,"context_line":""},{"line_number":739,"context_line":"    def test_retype_volume_orig_no_type_dest_enc(self):"},{"line_number":740,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400, False, False)"},{"line_number":741,"context_line":""},{"line_number":742,"context_line":"    def test_retype_volume_orig_type_no_enc_dest_no_enc(self):"},{"line_number":743,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 202, True, False, False)"},{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_retype_volume_orig_type_no_enc_dest_enc(self):"},{"line_number":746,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400, True, False)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"    def test_retype_volume_orig_type_enc_dest_enc(self):"},{"line_number":749,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400)"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":""},{"line_number":752,"context_line":"def stub_volume_get(self, context, volume_id):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9abb7d3a_6654c6fe","line":749,"range":{"start_line":736,"start_character":0,"end_line":749,"end_character":56},"updated":"2016-05-31 14:39:24.000000000","message":"Is there also a case where both volume types point ot the same encryption?","commit_id":"2f41523f5e21d14e4dfbf1be08584eb0810f0eff"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"6a4bee4fc4e6ee12e77c22f873315fcba1d3a3dd","unresolved":false,"context_lines":[{"line_number":733,"context_line":""},{"line_number":734,"context_line":"        self._retype_volume_exec(expected_status, vol_type_new, vol.id)"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"    def test_retype_volume_orig_no_type_dest_no_enc(self):"},{"line_number":737,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 202, False, False, False)"},{"line_number":738,"context_line":""},{"line_number":739,"context_line":"    def test_retype_volume_orig_no_type_dest_enc(self):"},{"line_number":740,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400, False, False)"},{"line_number":741,"context_line":""},{"line_number":742,"context_line":"    def test_retype_volume_orig_type_no_enc_dest_no_enc(self):"},{"line_number":743,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 202, True, False, False)"},{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_retype_volume_orig_type_no_enc_dest_enc(self):"},{"line_number":746,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400, True, False)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"    def test_retype_volume_orig_type_enc_dest_enc(self):"},{"line_number":749,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400)"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":""},{"line_number":752,"context_line":"def stub_volume_get(self, context, volume_id):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9abb7d3a_336b19b9","line":749,"range":{"start_line":736,"start_character":0,"end_line":749,"end_character":56},"in_reply_to":"9abb7d3a_30d14f24","updated":"2016-05-31 15:33:16.000000000","message":"How can that happen???  AFAIK the same encryption cannot point to 2 different volume types.","commit_id":"2f41523f5e21d14e4dfbf1be08584eb0810f0eff"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"bb9edc5404eae2f2f3afb71791fdd01c7f0ae4b4","unresolved":false,"context_lines":[{"line_number":733,"context_line":""},{"line_number":734,"context_line":"        self._retype_volume_exec(expected_status, vol_type_new, vol.id)"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"    def test_retype_volume_orig_no_type_dest_no_enc(self):"},{"line_number":737,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 202, False, False, False)"},{"line_number":738,"context_line":""},{"line_number":739,"context_line":"    def test_retype_volume_orig_no_type_dest_enc(self):"},{"line_number":740,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400, False, False)"},{"line_number":741,"context_line":""},{"line_number":742,"context_line":"    def test_retype_volume_orig_type_no_enc_dest_no_enc(self):"},{"line_number":743,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 202, True, False, False)"},{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_retype_volume_orig_type_no_enc_dest_enc(self):"},{"line_number":746,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400, True, False)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"    def test_retype_volume_orig_type_enc_dest_enc(self):"},{"line_number":749,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400)"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":""},{"line_number":752,"context_line":"def stub_volume_get(self, context, volume_id):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9abb7d3a_a9283a87","line":749,"range":{"start_line":736,"start_character":0,"end_line":749,"end_character":56},"in_reply_to":"9abb7d3a_336b19b9","updated":"2016-05-31 15:59:18.000000000","message":"Looks like it isn\u0027t  a possible case when using cinderclient.","commit_id":"2f41523f5e21d14e4dfbf1be08584eb0810f0eff"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"f3931a2948f06346d80deabc1c953ab583df07bb","unresolved":false,"context_lines":[{"line_number":733,"context_line":""},{"line_number":734,"context_line":"        self._retype_volume_exec(expected_status, vol_type_new, vol.id)"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"    def test_retype_volume_orig_no_type_dest_no_enc(self):"},{"line_number":737,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 202, False, False, False)"},{"line_number":738,"context_line":""},{"line_number":739,"context_line":"    def test_retype_volume_orig_no_type_dest_enc(self):"},{"line_number":740,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400, False, False)"},{"line_number":741,"context_line":""},{"line_number":742,"context_line":"    def test_retype_volume_orig_type_no_enc_dest_no_enc(self):"},{"line_number":743,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 202, True, False, False)"},{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_retype_volume_orig_type_no_enc_dest_enc(self):"},{"line_number":746,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400, True, False)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"    def test_retype_volume_orig_type_enc_dest_enc(self):"},{"line_number":749,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400)"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":""},{"line_number":752,"context_line":"def stub_volume_get(self, context, volume_id):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9abb7d3a_30d14f24","line":749,"range":{"start_line":736,"start_character":0,"end_line":749,"end_character":56},"in_reply_to":"9abb7d3a_6654c6fe","updated":"2016-05-31 15:25:57.000000000","message":"+1, that\u0027s actually a possibility for any of the types","commit_id":"2f41523f5e21d14e4dfbf1be08584eb0810f0eff"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"0b90e1cf4bbde3d30d6cab84c5f6e26072e655de","unresolved":false,"context_lines":[{"line_number":733,"context_line":""},{"line_number":734,"context_line":"        self._retype_volume_exec(expected_status, vol_type_new, vol.id)"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"    def test_retype_volume_orig_no_type_dest_no_enc(self):"},{"line_number":737,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 202, False, False, False)"},{"line_number":738,"context_line":""},{"line_number":739,"context_line":"    def test_retype_volume_orig_no_type_dest_enc(self):"},{"line_number":740,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400, False, False)"},{"line_number":741,"context_line":""},{"line_number":742,"context_line":"    def test_retype_volume_orig_type_no_enc_dest_no_enc(self):"},{"line_number":743,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 202, True, False, False)"},{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_retype_volume_orig_type_no_enc_dest_enc(self):"},{"line_number":746,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400, True, False)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"    def test_retype_volume_orig_type_enc_dest_enc(self):"},{"line_number":749,"context_line":"        self._retype_volume_encryption(\u0027available\u0027, 400)"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":""},{"line_number":752,"context_line":"def stub_volume_get(self, context, volume_id):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9abb7d3a_50b5f32e","line":749,"range":{"start_line":736,"start_character":0,"end_line":749,"end_character":56},"in_reply_to":"9abb7d3a_6654c6fe","updated":"2016-05-31 15:22:36.000000000","message":"Our DB model doesn\u0027t allow that, each volume type has its own encryption record.","commit_id":"2f41523f5e21d14e4dfbf1be08584eb0810f0eff"}],"cinder/volume/api.py":[{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"620b25f46f2b6e7ec65a19b79323b6544c63e59b","unresolved":false,"context_lines":[{"line_number":1289,"context_line":"            updates[\u0027status\u0027] \u003d db.Case("},{"line_number":1290,"context_line":"                [(volume.model.status \u003d\u003d \u0027available\u0027, \u0027maintenance\u0027)],"},{"line_number":1291,"context_line":"                else_\u003dvolume.model.status)"},{"line_number":1292,"context_line":""},{"line_number":1293,"context_line":"        result \u003d volume.conditional_update(updates, expected, filters)"},{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"        if not result:"}],"source_content_type":"text/x-python","patch_set":13,"id":"da6ed579_da3a83e7","line":1292,"updated":"2016-01-12 08:36:30.000000000","message":"I looked into Case __init__(whens, value, else_), I am confused about update[\u0027status\u0027]. Should it be db.Case( [(volume.model.status \u003d\u003d \u0027available\u0027, \u0027maintenance\u0027)], \u0027maintenance\u0027, else_\u003dvolume.model.status)?\n\nOr db.Case([(volume.model.status \u003d\u003d \u0027available\u0027)], \u0027maintenance\u0027)?","commit_id":"39e8b07117c73a3b479dac5e6670732dea956308"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"8d8a10f53798439be6e0d0de2be1b0301beca100","unresolved":false,"context_lines":[{"line_number":1289,"context_line":"            updates[\u0027status\u0027] \u003d db.Case("},{"line_number":1290,"context_line":"                [(volume.model.status \u003d\u003d \u0027available\u0027, \u0027maintenance\u0027)],"},{"line_number":1291,"context_line":"                else_\u003dvolume.model.status)"},{"line_number":1292,"context_line":""},{"line_number":1293,"context_line":"        result \u003d volume.conditional_update(updates, expected, filters)"},{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"        if not result:"}],"source_content_type":"text/x-python","patch_set":13,"id":"da6ed579_13020f70","line":1292,"in_reply_to":"da6ed579_8cf8517e","updated":"2016-01-13 03:27:07.000000000","message":"Yes, you are correct.","commit_id":"39e8b07117c73a3b479dac5e6670732dea956308"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8b423bfe75df567dcf7b2893222abc5838779c96","unresolved":false,"context_lines":[{"line_number":1289,"context_line":"            updates[\u0027status\u0027] \u003d db.Case("},{"line_number":1290,"context_line":"                [(volume.model.status \u003d\u003d \u0027available\u0027, \u0027maintenance\u0027)],"},{"line_number":1291,"context_line":"                else_\u003dvolume.model.status)"},{"line_number":1292,"context_line":""},{"line_number":1293,"context_line":"        result \u003d volume.conditional_update(updates, expected, filters)"},{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"        if not result:"}],"source_content_type":"text/x-python","patch_set":13,"id":"da6ed579_8cf8517e","line":1292,"in_reply_to":"da6ed579_da3a83e7","updated":"2016-01-12 10:12:22.000000000","message":"No, this is correct as it is.\n\nYou can have a look at some unittest examples (cinder/tests/unit/objects/test_base.py), the way the Case class is used in conditional_update and the SQLAlchemy case expression (http://docs.sqlalchemy.org/en/latest/core/sqlelement.html?highlight\u003dcase#sqlalchemy.sql.expression.case).","commit_id":"39e8b07117c73a3b479dac5e6670732dea956308"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e5b5f3d61dc21fe5f4c71406a1f066dfc168e02c","unresolved":false,"context_lines":[{"line_number":1306,"context_line":""},{"line_number":1307,"context_line":"        # Call the scheduler to ensure that the host exists and that it can"},{"line_number":1308,"context_line":"        # accept the volume"},{"line_number":1309,"context_line":"        volume_type \u003d {}"},{"line_number":1310,"context_line":"        if volume.volume_type_id:"},{"line_number":1311,"context_line":"            volume_type \u003d volume_types.get_volume_type(context.elevated(),"},{"line_number":1312,"context_line":"                                                       volume.volume_type_id)"},{"line_number":1313,"context_line":"        request_spec \u003d {\u0027volume_properties\u0027: volume,"},{"line_number":1314,"context_line":"                        \u0027volume_type\u0027: volume_type,"},{"line_number":1315,"context_line":"                        \u0027volume_id\u0027: volume.id}"}],"source_content_type":"text/x-python","patch_set":18,"id":"7af24918_38ad4fe9","line":1312,"range":{"start_line":1309,"start_character":0,"end_line":1312,"end_character":77},"updated":"2016-03-04 13:34:49.000000000","message":"Paranoia continues: what if retype happened between getting the volume from the DB and changing it\u0027s state to \u0027maintenance\u0027?\n\nMaybe we can add volume_type_id to expected to make sure it haven\u0027t changed until we were able to protect the resource by changing it\u0027s state?","commit_id":"2ae6053b172445f10751823a519f67c90a8fcf77"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"21400e0eb7495b4e891f5965a15c6a5a51ec800d","unresolved":false,"context_lines":[{"line_number":1306,"context_line":""},{"line_number":1307,"context_line":"        # Call the scheduler to ensure that the host exists and that it can"},{"line_number":1308,"context_line":"        # accept the volume"},{"line_number":1309,"context_line":"        volume_type \u003d {}"},{"line_number":1310,"context_line":"        if volume.volume_type_id:"},{"line_number":1311,"context_line":"            volume_type \u003d volume_types.get_volume_type(context.elevated(),"},{"line_number":1312,"context_line":"                                                       volume.volume_type_id)"},{"line_number":1313,"context_line":"        request_spec \u003d {\u0027volume_properties\u0027: volume,"},{"line_number":1314,"context_line":"                        \u0027volume_type\u0027: volume_type,"},{"line_number":1315,"context_line":"                        \u0027volume_id\u0027: volume.id}"}],"source_content_type":"text/x-python","patch_set":18,"id":"5aef4532_972697cc","line":1312,"range":{"start_line":1309,"start_character":0,"end_line":1312,"end_character":77},"in_reply_to":"5aef4532_09174c52","updated":"2016-03-08 11:43:32.000000000","message":"I just realized I copy pasted this from previous patch and it makes no sense here since we are not talking about quotas here.\n\nAnyway, this is not a problem in this case, as the conditional_update will reload the data from the DB after the conditional_update succeeds because it has an undefined value (volume.model.status) that we cannot change in the VO without reading the data back.\n\nSo volume.volume_type_id will just had been updated here.","commit_id":"2ae6053b172445f10751823a519f67c90a8fcf77"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9d2dc014e3bcfc2a6950b20a7cfff0d8361cb678","unresolved":false,"context_lines":[{"line_number":1306,"context_line":""},{"line_number":1307,"context_line":"        # Call the scheduler to ensure that the host exists and that it can"},{"line_number":1308,"context_line":"        # accept the volume"},{"line_number":1309,"context_line":"        volume_type \u003d {}"},{"line_number":1310,"context_line":"        if volume.volume_type_id:"},{"line_number":1311,"context_line":"            volume_type \u003d volume_types.get_volume_type(context.elevated(),"},{"line_number":1312,"context_line":"                                                       volume.volume_type_id)"},{"line_number":1313,"context_line":"        request_spec \u003d {\u0027volume_properties\u0027: volume,"},{"line_number":1314,"context_line":"                        \u0027volume_type\u0027: volume_type,"},{"line_number":1315,"context_line":"                        \u0027volume_id\u0027: volume.id}"}],"source_content_type":"text/x-python","patch_set":18,"id":"7af24918_73bd2d01","line":1312,"range":{"start_line":1309,"start_character":0,"end_line":1312,"end_character":77},"in_reply_to":"7af24918_38ad4fe9","updated":"2016-03-04 16:32:35.000000000","message":"Yep, that could happen, although it\u0027s unlikely, and the best solution would be to change the way we do the quotas so that they work referencing the volume type that\u0027s on the DB in the volume, but removing races from quotas is another whole different pain.  Because the alternative is to retrieve the volume from the DB after we have changed the status and I really dislike that solution. :-(","commit_id":"2ae6053b172445f10751823a519f67c90a8fcf77"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"504ae43d129c244cebbca6bf38c7b25bf5618c02","unresolved":false,"context_lines":[{"line_number":1306,"context_line":""},{"line_number":1307,"context_line":"        # Call the scheduler to ensure that the host exists and that it can"},{"line_number":1308,"context_line":"        # accept the volume"},{"line_number":1309,"context_line":"        volume_type \u003d {}"},{"line_number":1310,"context_line":"        if volume.volume_type_id:"},{"line_number":1311,"context_line":"            volume_type \u003d volume_types.get_volume_type(context.elevated(),"},{"line_number":1312,"context_line":"                                                       volume.volume_type_id)"},{"line_number":1313,"context_line":"        request_spec \u003d {\u0027volume_properties\u0027: volume,"},{"line_number":1314,"context_line":"                        \u0027volume_type\u0027: volume_type,"},{"line_number":1315,"context_line":"                        \u0027volume_id\u0027: volume.id}"}],"source_content_type":"text/x-python","patch_set":18,"id":"5aef4532_09174c52","line":1312,"range":{"start_line":1309,"start_character":0,"end_line":1312,"end_character":77},"in_reply_to":"7af24918_73bd2d01","updated":"2016-03-07 10:41:14.000000000","message":"I agree, getting quotas right would be best.","commit_id":"2ae6053b172445f10751823a519f67c90a8fcf77"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e5b5f3d61dc21fe5f4c71406a1f066dfc168e02c","unresolved":false,"context_lines":[{"line_number":1449,"context_line":"        if not volume.conditional_update(updates, expected, filters):"},{"line_number":1450,"context_line":"            msg \u003d _(\u0027Retype needs volume to be in available or in-use state, \u0027"},{"line_number":1451,"context_line":"                    \u0027have same encryption requirements, not be part of an \u0027"},{"line_number":1452,"context_line":"                    \u0027active migration or a consistency group, must be of a \u0027"},{"line_number":1453,"context_line":"                    \u0027different type and for in-use volumes front-end qos \u0027"},{"line_number":1454,"context_line":"                    \u0027specs cannot change.\u0027)"},{"line_number":1455,"context_line":"            LOG.error(msg)"},{"line_number":1456,"context_line":"            QUOTAS.rollback(context, reservations + old_reservations,"}],"source_content_type":"text/x-python","patch_set":18,"id":"7af24918_f883e700","line":1453,"range":{"start_line":1452,"start_character":62,"end_line":1453,"end_character":35},"updated":"2016-03-04 13:34:49.000000000","message":"It doesn\u0027t explain clearly from what the type must be different.","commit_id":"2ae6053b172445f10751823a519f67c90a8fcf77"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9d2dc014e3bcfc2a6950b20a7cfff0d8361cb678","unresolved":false,"context_lines":[{"line_number":1449,"context_line":"        if not volume.conditional_update(updates, expected, filters):"},{"line_number":1450,"context_line":"            msg \u003d _(\u0027Retype needs volume to be in available or in-use state, \u0027"},{"line_number":1451,"context_line":"                    \u0027have same encryption requirements, not be part of an \u0027"},{"line_number":1452,"context_line":"                    \u0027active migration or a consistency group, must be of a \u0027"},{"line_number":1453,"context_line":"                    \u0027different type and for in-use volumes front-end qos \u0027"},{"line_number":1454,"context_line":"                    \u0027specs cannot change.\u0027)"},{"line_number":1455,"context_line":"            LOG.error(msg)"},{"line_number":1456,"context_line":"            QUOTAS.rollback(context, reservations + old_reservations,"}],"source_content_type":"text/x-python","patch_set":18,"id":"7af24918_754a3556","line":1453,"range":{"start_line":1452,"start_character":62,"end_line":1453,"end_character":35},"in_reply_to":"7af24918_f883e700","updated":"2016-03-04 16:32:35.000000000","message":"Ok, I\u0027ll rephrase it, but anyone trying to retype to the same type and wondering why it failed should suffer from a poorly written error message in my opinion.  };-)","commit_id":"2ae6053b172445f10751823a519f67c90a8fcf77"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"6e8ba4e738ba9c160c4b007442ec6857fdf57401","unresolved":false,"context_lines":[{"line_number":1468,"context_line":"        # Build required conditions for conditional update"},{"line_number":1469,"context_line":"        expected \u003d {\u0027status\u0027: (\u0027available\u0027, \u0027in-use\u0027),"},{"line_number":1470,"context_line":"                    \u0027migration_status\u0027: self.AVAILABLE_MIGRATION_STATUS,"},{"line_number":1471,"context_line":"                    \u0027replication_status\u0027: (None, \u0027disabled\u0027),"},{"line_number":1472,"context_line":"                    \u0027consistencygroup_id\u0027: (None, \u0027\u0027),"},{"line_number":1473,"context_line":"                    \u0027volume_type_id\u0027: db.Not(vol_type_id)}"},{"line_number":1474,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"9abb7d3a_40336af6","line":1471,"range":{"start_line":1471,"start_character":20,"end_line":1471,"end_character":61},"updated":"2016-05-31 14:11:33.000000000","message":"I\u0027m unable to find equivalent in the old constraints. Am I missing something or you\u0027ve copied this from migration?","commit_id":"2f41523f5e21d14e4dfbf1be08584eb0810f0eff"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bb7dee4084a4fe4ecf44f3ef5672eeec90472c1f","unresolved":false,"context_lines":[{"line_number":1468,"context_line":"        # Build required conditions for conditional update"},{"line_number":1469,"context_line":"        expected \u003d {\u0027status\u0027: (\u0027available\u0027, \u0027in-use\u0027),"},{"line_number":1470,"context_line":"                    \u0027migration_status\u0027: self.AVAILABLE_MIGRATION_STATUS,"},{"line_number":1471,"context_line":"                    \u0027replication_status\u0027: (None, \u0027disabled\u0027),"},{"line_number":1472,"context_line":"                    \u0027consistencygroup_id\u0027: (None, \u0027\u0027),"},{"line_number":1473,"context_line":"                    \u0027volume_type_id\u0027: db.Not(vol_type_id)}"},{"line_number":1474,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"9abb7d3a_ab295739","line":1471,"range":{"start_line":1471,"start_character":20,"end_line":1471,"end_character":61},"in_reply_to":"9abb7d3a_40336af6","updated":"2016-05-31 14:44:08.000000000","message":"I don\u0027t see it in the old code either, and it\u0027s been 8 months since I wrote it, so I can\u0027t recall if I had a specific reason for it or if it was a mistake.  Same thing with the consistencygroup_id check.","commit_id":"2f41523f5e21d14e4dfbf1be08584eb0810f0eff"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"30bd65346f6e8f9c736d0a81df0d2e1fcb313c2d","unresolved":false,"context_lines":[{"line_number":1468,"context_line":"        # Build required conditions for conditional update"},{"line_number":1469,"context_line":"        expected \u003d {\u0027status\u0027: (\u0027available\u0027, \u0027in-use\u0027),"},{"line_number":1470,"context_line":"                    \u0027migration_status\u0027: self.AVAILABLE_MIGRATION_STATUS,"},{"line_number":1471,"context_line":"                    \u0027replication_status\u0027: (None, \u0027disabled\u0027),"},{"line_number":1472,"context_line":"                    \u0027consistencygroup_id\u0027: (None, \u0027\u0027),"},{"line_number":1473,"context_line":"                    \u0027volume_type_id\u0027: db.Not(vol_type_id)}"},{"line_number":1474,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"9abb7d3a_ba2d1e00","line":1471,"range":{"start_line":1471,"start_character":20,"end_line":1471,"end_character":61},"in_reply_to":"9abb7d3a_ab295739","updated":"2016-05-31 14:54:38.000000000","message":"CG is in line 1464 in the old code I think.","commit_id":"2f41523f5e21d14e4dfbf1be08584eb0810f0eff"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"0b90e1cf4bbde3d30d6cab84c5f6e26072e655de","unresolved":false,"context_lines":[{"line_number":1468,"context_line":"        # Build required conditions for conditional update"},{"line_number":1469,"context_line":"        expected \u003d {\u0027status\u0027: (\u0027available\u0027, \u0027in-use\u0027),"},{"line_number":1470,"context_line":"                    \u0027migration_status\u0027: self.AVAILABLE_MIGRATION_STATUS,"},{"line_number":1471,"context_line":"                    \u0027replication_status\u0027: (None, \u0027disabled\u0027),"},{"line_number":1472,"context_line":"                    \u0027consistencygroup_id\u0027: (None, \u0027\u0027),"},{"line_number":1473,"context_line":"                    \u0027volume_type_id\u0027: db.Not(vol_type_id)}"},{"line_number":1474,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"9abb7d3a_dde0dcfc","line":1471,"range":{"start_line":1471,"start_character":20,"end_line":1471,"end_character":61},"in_reply_to":"9abb7d3a_ba2d1e00","updated":"2016-05-31 15:22:36.000000000","message":"True, and I see that I didn\u0027t include anything about replication status in the error message, so it looks like it really is a mistake here.","commit_id":"2f41523f5e21d14e4dfbf1be08584eb0810f0eff"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"f3931a2948f06346d80deabc1c953ab583df07bb","unresolved":false,"context_lines":[{"line_number":1468,"context_line":"        # Build required conditions for conditional update"},{"line_number":1469,"context_line":"        expected \u003d {\u0027status\u0027: (\u0027available\u0027, \u0027in-use\u0027),"},{"line_number":1470,"context_line":"                    \u0027migration_status\u0027: self.AVAILABLE_MIGRATION_STATUS,"},{"line_number":1471,"context_line":"                    \u0027replication_status\u0027: (None, \u0027disabled\u0027),"},{"line_number":1472,"context_line":"                    \u0027consistencygroup_id\u0027: (None, \u0027\u0027),"},{"line_number":1473,"context_line":"                    \u0027volume_type_id\u0027: db.Not(vol_type_id)}"},{"line_number":1474,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"9abb7d3a_70fbd747","line":1471,"range":{"start_line":1471,"start_character":20,"end_line":1471,"end_character":61},"in_reply_to":"9abb7d3a_dde0dcfc","updated":"2016-05-31 15:25:57.000000000","message":"FWIW we did intend to allow retype on replication, so we should likely remove that check.","commit_id":"2f41523f5e21d14e4dfbf1be08584eb0810f0eff"}]}
