)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"047cb3eb286aafa59d5ed25e004cd3c89d350b01","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix lvm manage existing volume"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add lvm volume validation(check db for possible existing"},{"line_number":10,"context_line":"volume) to avoid managing already managed volume."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I0d8d7a3cb2afce90529cd1142b413aca9ac69d4c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"da86d52c_d7a67a0e","line":9,"updated":"2015-02-18 19:00:42.000000000","message":"missing a space after \"validation\".  Fix if you push another patch please.","commit_id":"c1de84270a5e1b985d580dc96d18bdaa75c8c505"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f1282686fb9bc74e109e3cc5e83a5c18626162f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix lvm manage existing volume"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When try manage command to a volume that is already managed by Cinder,"},{"line_number":10,"context_line":"the operation does not fail and you will find up in an unexpected"},{"line_number":11,"context_line":"state. The operation will succeed, the backend storage will be renamed,"},{"line_number":12,"context_line":"and there will be two Cinder volumes in the available state with only"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"3afb71cf_59921ef7","line":9,"updated":"2015-06-11 10:44:42.000000000","message":"Either \"When trying to manage a volume\" or \"When executing the manage command for a volume\" would be better.","commit_id":"4d97c49c79abc9c34f74e562c4124fa9ba69d8df"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f1282686fb9bc74e109e3cc5e83a5c18626162f","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix lvm manage existing volume"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When try manage command to a volume that is already managed by Cinder,"},{"line_number":10,"context_line":"the operation does not fail and you will find up in an unexpected"},{"line_number":11,"context_line":"state. The operation will succeed, the backend storage will be renamed,"},{"line_number":12,"context_line":"and there will be two Cinder volumes in the available state with only"},{"line_number":13,"context_line":"one of them being valid."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"3afb71cf_f9cc2a36","line":10,"updated":"2015-06-11 10:44:42.000000000","message":"/find up/end up/","commit_id":"4d97c49c79abc9c34f74e562c4124fa9ba69d8df"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"32f77da1a06148e05879b21d17ac33de1b35a799","unresolved":false,"context_lines":[{"line_number":12,"context_line":"and there will be two Cinder volumes in the available state with only"},{"line_number":13,"context_line":"one of them being valid."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This change add volume check on driver level(since we don\u0027t know"},{"line_number":16,"context_line":"source-name, source-id or something else used as ref for volume, each"},{"line_number":17,"context_line":"driver should be responsible for figuring out what to do with specified"},{"line_number":18,"context_line":"volume ref). Check method looking for possible existing volume in db"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"fa32b979_9ccd1668","line":15,"updated":"2015-06-18 20:16:29.000000000","message":"s/add/adds","commit_id":"f46a1d5ae270a211b59a823c09145a4d549bc41f"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"32f77da1a06148e05879b21d17ac33de1b35a799","unresolved":false,"context_lines":[{"line_number":13,"context_line":"one of them being valid."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This change add volume check on driver level(since we don\u0027t know"},{"line_number":16,"context_line":"source-name, source-id or something else used as ref for volume, each"},{"line_number":17,"context_line":"driver should be responsible for figuring out what to do with specified"},{"line_number":18,"context_line":"volume ref). Check method looking for possible existing volume in db"},{"line_number":19,"context_line":"to avoid managing already managed volume."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"fa32b979_5cc30e38","line":16,"updated":"2015-06-18 20:16:29.000000000","message":"s/something/anything","commit_id":"f46a1d5ae270a211b59a823c09145a4d549bc41f"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ff96f35130755d0cf7ef4d186b0e054ff91ae1ce","unresolved":false,"context_lines":[{"line_number":12,"context_line":"and there will be two Cinder volumes in the available state with only"},{"line_number":13,"context_line":"one of them being valid."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This change add volume check on driver level(since we don\u0027t know"},{"line_number":16,"context_line":"source-name, source-id or something else used as ref for volume, each"},{"line_number":17,"context_line":"driver should be responsible for figuring out what to do with specified"},{"line_number":18,"context_line":"volume ref). Check method looking for possible existing volume in db"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"fa32b979_daca304f","line":15,"updated":"2015-06-23 11:36:57.000000000","message":"Besides the 2 comments from previous patch, which haven\u0027t been resolved, there\u0027s also a space missing between level and (","commit_id":"5a74a6c5e966b9ac05257a651cfc64f9c2bd1da9"}],"cinder/tests/test_volume_utils.py":[{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"047cb3eb286aafa59d5ed25e004cd3c89d350b01","unresolved":false,"context_lines":[{"line_number":752,"context_line":"            side_effect\u003dexception.VolumeNotFound(\u0027volume-214\u0027))"},{"line_number":753,"context_line":""},{"line_number":754,"context_line":"        try:"},{"line_number":755,"context_line":"            # nothrow ManageExistingAlreadyManaged"},{"line_number":756,"context_line":"            volume_utils.validate_already_managed_volume(mock_db, \u0027volume-214\u0027)"},{"line_number":757,"context_line":"        except exception.ManageExistingAlreadyManaged:"},{"line_number":758,"context_line":"            self.fail(\u0027Unexpectly raised exception: ManageExistingAlreadyManaged\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_d7f4baf2","line":755,"updated":"2015-02-18 19:00:42.000000000","message":"typo nothrow -\u003e do not throw","commit_id":"c1de84270a5e1b985d580dc96d18bdaa75c8c505"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"0033884cfaab3fc9c366f5dd975af7f8f63b03c2","unresolved":false,"context_lines":[{"line_number":753,"context_line":""},{"line_number":754,"context_line":"        try:"},{"line_number":755,"context_line":"            # do not throw ManageExistingAlreadyManaged"},{"line_number":756,"context_line":"            volume_utils.validate_already_managed_volume(mock_db, \u0027volume-214\u0027)"},{"line_number":757,"context_line":"        except exception.ManageExistingAlreadyManaged:"},{"line_number":758,"context_line":"            self.fail(\u0027Unexpectly raised exception: ManageExistingAlreadyManaged\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_a65631cc","line":756,"updated":"2015-02-25 14:11:10.000000000","message":"You can omit this try-except clause. If exception will be raised then it\u0027s obvious that it happened unexpectedly.","commit_id":"785ce92323d515e7414ed59dbbab7835562c0859"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"e44fcda85b08e55018a5ad0cd5c0beb511f4dbf7","unresolved":false,"context_lines":[{"line_number":753,"context_line":""},{"line_number":754,"context_line":"        try:"},{"line_number":755,"context_line":"            # do not throw ManageExistingAlreadyManaged"},{"line_number":756,"context_line":"            volume_utils.validate_already_managed_volume(mock_db, \u0027volume-214\u0027)"},{"line_number":757,"context_line":"        except exception.ManageExistingAlreadyManaged:"},{"line_number":758,"context_line":"            self.fail(\u0027Unexpectly raised exception: ManageExistingAlreadyManaged\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_a611a35e","line":756,"in_reply_to":"ba7be1f8_a65631cc","updated":"2015-02-26 13:25:12.000000000","message":"That was done on purpose, it is for more clearly  tests behaviour","commit_id":"785ce92323d515e7414ed59dbbab7835562c0859"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"1e2200c729ab7bf573d40d21a1bf405e1bc4136f","unresolved":false,"context_lines":[{"line_number":752,"context_line":"            volume_utils.validate_already_managed_volume("},{"line_number":753,"context_line":"                mock_db, \u0027volume-d8cd1feb-2dcc-404d-9b15-b86fe3bec0a1\u0027)"},{"line_number":754,"context_line":"        except exception.ManageExistingAlreadyManaged:"},{"line_number":755,"context_line":"            self.fail(\u0027Unexpectly raised exception: \u0027"},{"line_number":756,"context_line":"                      \u0027ManageExistingAlreadyManaged\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba7be1f8_ae597536","line":755,"updated":"2015-02-26 13:54:15.000000000","message":"s/Unexpectly/Unexpectedly","commit_id":"9d6af7b17cf2f38ab80a677ed2d11819df6cc1ed"}],"cinder/tests/unit/test_volume_utils.py":[{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"7d0c02bc3551ba667bb2db71adcaba65f6859397","unresolved":false,"context_lines":[{"line_number":745,"context_line":"    def test_check_managed_volume_already_managed(self):"},{"line_number":746,"context_line":"        mock_db \u003d mock.Mock()"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"        result \u003d volume_utils.check_already_managed_volume("},{"line_number":749,"context_line":"            mock_db, \u0027volume-d8cd1feb-2dcc-404d-9b15-b86fe3bec0a1\u0027)"},{"line_number":750,"context_line":"        self.assertTrue(result)"},{"line_number":751,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3afb71cf_c23ace98","line":748,"updated":"2015-06-10 10:33:13.000000000","message":"Can you set expectation for volume_get?","commit_id":"73196f1d3b2fee73d45beb8c74fecda45af12989"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"38beeae1699f5b172f65ad6af9e4de1853573ed1","unresolved":false,"context_lines":[{"line_number":745,"context_line":"    def test_check_managed_volume_already_managed(self):"},{"line_number":746,"context_line":"        mock_db \u003d mock.Mock()"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"        result \u003d volume_utils.check_already_managed_volume("},{"line_number":749,"context_line":"            mock_db, \u0027volume-d8cd1feb-2dcc-404d-9b15-b86fe3bec0a1\u0027)"},{"line_number":750,"context_line":"        self.assertTrue(result)"},{"line_number":751,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"1af86dd1_727eefaf","line":748,"in_reply_to":"3afb71cf_466cab34","updated":"2015-06-12 14:06:31.000000000","message":"I understood that. My suggestion was to improve the readability. Please don\u0027t assume that everyone reading this code knows mock behavior for unset expectations.","commit_id":"73196f1d3b2fee73d45beb8c74fecda45af12989"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"ff31b21b0a6e87e45d1a53d98720d7e7cbc4fe1d","unresolved":false,"context_lines":[{"line_number":745,"context_line":"    def test_check_managed_volume_already_managed(self):"},{"line_number":746,"context_line":"        mock_db \u003d mock.Mock()"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"        result \u003d volume_utils.check_already_managed_volume("},{"line_number":749,"context_line":"            mock_db, \u0027volume-d8cd1feb-2dcc-404d-9b15-b86fe3bec0a1\u0027)"},{"line_number":750,"context_line":"        self.assertTrue(result)"},{"line_number":751,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3afb71cf_466cab34","line":748,"in_reply_to":"3afb71cf_c23ace98","updated":"2015-06-10 13:23:06.000000000","message":"Why do we need expectation for volume_get here? It returns mock object, and we just expect that object is returned, no needs to specify it in current test case.","commit_id":"73196f1d3b2fee73d45beb8c74fecda45af12989"}],"cinder/volume/drivers/lvm.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"4ddd9e8ed9bdc49ceaa8bfa5ef5265b1bd694750","unresolved":false,"context_lines":[{"line_number":467,"context_line":"        lv_name \u003d existing_ref[\u0027source-name\u0027]"},{"line_number":468,"context_line":"        self.vg.get_volume(lv_name)"},{"line_number":469,"context_line":""},{"line_number":470,"context_line":"        volutils.validate_already_managed_volume(self.db, lv_name)"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"        # Attempt to rename the LV to match the OpenStack internal name."},{"line_number":473,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a0c5dc1_a71bdd1a","line":470,"updated":"2015-05-13 14:44:02.000000000","message":"Letting the specific \"already managed\" exception bubble up is a cool idea.  I don\u0027t know if it would be better to make this an explicit method however that returns True/False (rename it to a check), incase we can use it in other places; that would make it a bit more \"friendly\" rather than wrapping it in a caller to do the same thing.","commit_id":"811bba76b8331ae40cb7913cfa89ed8c1d4c82e8"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"7d0c02bc3551ba667bb2db71adcaba65f6859397","unresolved":false,"context_lines":[{"line_number":470,"context_line":"        self.vg.get_volume(lv_name)"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"        if volutils.check_already_managed_volume(self.db, lv_name):"},{"line_number":473,"context_line":"            raise exception.ManageExistingAlreadyManaged(volume_id\u003dlv_name)"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"        # Attempt to rename the LV to match the OpenStack internal name."},{"line_number":476,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afb71cf_c2088edc","line":473,"updated":"2015-06-10 10:33:13.000000000","message":"lv_name is not volume ID","commit_id":"73196f1d3b2fee73d45beb8c74fecda45af12989"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"ff31b21b0a6e87e45d1a53d98720d7e7cbc4fe1d","unresolved":false,"context_lines":[{"line_number":470,"context_line":"        self.vg.get_volume(lv_name)"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"        if volutils.check_already_managed_volume(self.db, lv_name):"},{"line_number":473,"context_line":"            raise exception.ManageExistingAlreadyManaged(volume_id\u003dlv_name)"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"        # Attempt to rename the LV to match the OpenStack internal name."},{"line_number":476,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afb71cf_e6639740","line":473,"in_reply_to":"3afb71cf_c2088edc","updated":"2015-06-10 13:23:06.000000000","message":"Done","commit_id":"73196f1d3b2fee73d45beb8c74fecda45af12989"}],"cinder/volume/utils.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"0033884cfaab3fc9c366f5dd975af7f8f63b03c2","unresolved":false,"context_lines":[{"line_number":543,"context_line":""},{"line_number":544,"context_line":"def validate_already_managed_volume(db, vol_name):"},{"line_number":545,"context_line":"    vol_template_part \u003d CONF.volume_name_template % \u0027\u0027"},{"line_number":546,"context_line":"    if vol_name.startswith(vol_template_part):"},{"line_number":547,"context_line":"        vol_id \u003d vol_name.replace(vol_template_part, \u0027\u0027, 1)"},{"line_number":548,"context_line":"        try:"},{"line_number":549,"context_line":"            db.volume_get(context.get_admin_context(), vol_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_860bed8c","line":546,"updated":"2015-02-25 14:11:10.000000000","message":"What if CONF.volume_name_template is for example \"%s-volume\". You should match whole string, not only the beginning.","commit_id":"785ce92323d515e7414ed59dbbab7835562c0859"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"a9abdb53bf4ddc3d11b76cb15a21be3026bcb109","unresolved":false,"context_lines":[{"line_number":543,"context_line":""},{"line_number":544,"context_line":""},{"line_number":545,"context_line":"def validate_already_managed_volume(db, vol_name):"},{"line_number":546,"context_line":"    # UUID expression ver.4 (RFC 4122)."},{"line_number":547,"context_line":"    uuid_reg \u003d (\u0027[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}\u0027"},{"line_number":548,"context_line":"                \u0027-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}\u0027)"},{"line_number":549,"context_line":"    vol_name_reg \u003d CONF.volume_name_template % uuid_reg"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba7be1f8_17f9e54d","line":546,"updated":"2015-03-03 20:50:57.000000000","message":"Can you pull this out into a validate_volume_name(..) function? It seems that would be generically useful for any case where a volume name needs to be checked.","commit_id":"5dc9089f177cb0458d9dc35ae3dd3f2674060da3"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"d005c1b178ac9a037e8e7dc7b8fde9cd9261512c","unresolved":false,"context_lines":[{"line_number":543,"context_line":""},{"line_number":544,"context_line":""},{"line_number":545,"context_line":"def validate_already_managed_volume(db, vol_name):"},{"line_number":546,"context_line":"    # UUID expression ver.4 (RFC 4122)."},{"line_number":547,"context_line":"    uuid_reg \u003d (\u0027[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}\u0027"},{"line_number":548,"context_line":"                \u0027-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}\u0027)"},{"line_number":549,"context_line":"    vol_name_reg \u003d CONF.volume_name_template % uuid_reg"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_fca94d7c","line":546,"in_reply_to":"ba7be1f8_17f9e54d","updated":"2015-03-04 09:24:20.000000000","message":"ok, I\u0027ll do it in next patch","commit_id":"5dc9089f177cb0458d9dc35ae3dd3f2674060da3"},{"author":{"_account_id":6094,"name":"Navneet Singh","email":"navsinghnitd@gmail.com","username":"singn"},"change_message_id":"de28653967f4266d23b54fa1993aec8a1d8bed96","unresolved":false,"context_lines":[{"line_number":522,"context_line":"        vol_template_part \u003d CONF.volume_name_template % \u0027\u0027"},{"line_number":523,"context_line":"        vol_id \u003d vol_name.replace(vol_template_part, \u0027\u0027, 1)"},{"line_number":524,"context_line":"        try:"},{"line_number":525,"context_line":"            db.volume_get(context.get_admin_context(), vol_id)"},{"line_number":526,"context_line":"            raise exception.ManageExistingAlreadyManaged(volume_id\u003dvol_id)"},{"line_number":527,"context_line":"        except exception.VolumeNotFound:"},{"line_number":528,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa53dc9_7836bc04","line":525,"updated":"2015-04-07 11:49:54.000000000","message":"Use cinder.objects.volume instead of directly calling db functions.","commit_id":"4e296bbcd7ceeb78bac9feb0a2461ce79c94cc2d"},{"author":{"_account_id":6094,"name":"Navneet Singh","email":"navsinghnitd@gmail.com","username":"singn"},"change_message_id":"735335c789a7492f683fdff2f16e577789cb80f4","unresolved":false,"context_lines":[{"line_number":522,"context_line":"        vol_template_part \u003d CONF.volume_name_template % \u0027\u0027"},{"line_number":523,"context_line":"        vol_id \u003d vol_name.replace(vol_template_part, \u0027\u0027, 1)"},{"line_number":524,"context_line":"        try:"},{"line_number":525,"context_line":"            db.volume_get(context.get_admin_context(), vol_id)"},{"line_number":526,"context_line":"            raise exception.ManageExistingAlreadyManaged(volume_id\u003dvol_id)"},{"line_number":527,"context_line":"        except exception.VolumeNotFound:"},{"line_number":528,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa53dc9_fd185586","line":525,"in_reply_to":"9aa53dc9_5d918151","updated":"2015-04-08 06:22:04.000000000","message":"With new code going in you should make use of objects, will be less work in future. The basic volume object code meets you requirement and is present in the above listed package.","commit_id":"4e296bbcd7ceeb78bac9feb0a2461ce79c94cc2d"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"39c06b3ce96e1d94e8d672eff7e56fc4b65e7d14","unresolved":false,"context_lines":[{"line_number":522,"context_line":"        vol_template_part \u003d CONF.volume_name_template % \u0027\u0027"},{"line_number":523,"context_line":"        vol_id \u003d vol_name.replace(vol_template_part, \u0027\u0027, 1)"},{"line_number":524,"context_line":"        try:"},{"line_number":525,"context_line":"            db.volume_get(context.get_admin_context(), vol_id)"},{"line_number":526,"context_line":"            raise exception.ManageExistingAlreadyManaged(volume_id\u003dvol_id)"},{"line_number":527,"context_line":"        except exception.VolumeNotFound:"},{"line_number":528,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa53dc9_5d918151","line":525,"in_reply_to":"9aa53dc9_7836bc04","updated":"2015-04-08 05:55:47.000000000","message":"We haven\u0027t switched to use volume object yet. It is implemented only for snapshot object code.","commit_id":"4e296bbcd7ceeb78bac9feb0a2461ce79c94cc2d"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"dd24ecbb561bda43a72dfed3fd65d85f47e7d5c8","unresolved":false,"context_lines":[{"line_number":522,"context_line":"        vol_template_part \u003d CONF.volume_name_template % \u0027\u0027"},{"line_number":523,"context_line":"        vol_id \u003d vol_name.replace(vol_template_part, \u0027\u0027, 1)"},{"line_number":524,"context_line":"        try:"},{"line_number":525,"context_line":"            db.volume_get(context.get_admin_context(), vol_id)"},{"line_number":526,"context_line":"            raise exception.ManageExistingAlreadyManaged(volume_id\u003dvol_id)"},{"line_number":527,"context_line":"        except exception.VolumeNotFound:"},{"line_number":528,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa53dc9_923b7338","line":525,"in_reply_to":"9aa53dc9_d8ec7f2b","updated":"2015-04-08 08:34:27.000000000","message":"Completely agree with Michal, thanks for answer","commit_id":"4e296bbcd7ceeb78bac9feb0a2461ce79c94cc2d"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"36a9b9afa80ebfa5bab76cebb7ae9bff1d0842de","unresolved":false,"context_lines":[{"line_number":522,"context_line":"        vol_template_part \u003d CONF.volume_name_template % \u0027\u0027"},{"line_number":523,"context_line":"        vol_id \u003d vol_name.replace(vol_template_part, \u0027\u0027, 1)"},{"line_number":524,"context_line":"        try:"},{"line_number":525,"context_line":"            db.volume_get(context.get_admin_context(), vol_id)"},{"line_number":526,"context_line":"            raise exception.ManageExistingAlreadyManaged(volume_id\u003dvol_id)"},{"line_number":527,"context_line":"        except exception.VolumeNotFound:"},{"line_number":528,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa53dc9_d8ec7f2b","line":525,"in_reply_to":"9aa53dc9_fd185586","updated":"2015-04-08 06:36:04.000000000","message":"Intent of this patch isn\u0027t to test if Volume object actually works but to fix a bug. I prefer to have a dedicated patch that switches to use Volume object because then we can be thoroughly test it in the context of versioned objects compatibility.","commit_id":"4e296bbcd7ceeb78bac9feb0a2461ce79c94cc2d"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"92828facb9718926ec96619fff6e4d0f6a69fd35","unresolved":false,"context_lines":[{"line_number":555,"context_line":"            db.volume_get(context.get_admin_context(), vol_id)"},{"line_number":556,"context_line":"            return True"},{"line_number":557,"context_line":"        except exception.VolumeNotFound:"},{"line_number":558,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":15,"id":"3afb71cf_3f8f852b","line":558,"updated":"2015-06-10 05:24:41.000000000","message":"What if is_cinder_volume_name_like(vol_name) returns False?\nI hope a test should be added to cover this case.","commit_id":"33e26c9b5ca1bca2ed26b45c57b2e077df09c6a6"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"7d0c02bc3551ba667bb2db71adcaba65f6859397","unresolved":false,"context_lines":[{"line_number":529,"context_line":"    return extract_host(host_1) \u003d\u003d extract_host(host_2)"},{"line_number":530,"context_line":""},{"line_number":531,"context_line":""},{"line_number":532,"context_line":"def is_cinder_volume_name_like(vol_name):"},{"line_number":533,"context_line":"    # UUID expression ver.4 (RFC 4122)."},{"line_number":534,"context_line":"    uuid_reg \u003d (\u0027[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}\u0027"},{"line_number":535,"context_line":"                \u0027-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afb71cf_a23232a5","line":532,"updated":"2015-06-10 10:33:13.000000000","message":"_is_cinder_volume_name_like","commit_id":"73196f1d3b2fee73d45beb8c74fecda45af12989"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"ff31b21b0a6e87e45d1a53d98720d7e7cbc4fe1d","unresolved":false,"context_lines":[{"line_number":529,"context_line":"    return extract_host(host_1) \u003d\u003d extract_host(host_2)"},{"line_number":530,"context_line":""},{"line_number":531,"context_line":""},{"line_number":532,"context_line":"def is_cinder_volume_name_like(vol_name):"},{"line_number":533,"context_line":"    # UUID expression ver.4 (RFC 4122)."},{"line_number":534,"context_line":"    uuid_reg \u003d (\u0027[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}\u0027"},{"line_number":535,"context_line":"                \u0027-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afb71cf_6310b957","line":532,"in_reply_to":"3afb71cf_a23232a5","updated":"2015-06-10 13:23:06.000000000","message":"Done","commit_id":"73196f1d3b2fee73d45beb8c74fecda45af12989"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"7d0c02bc3551ba667bb2db71adcaba65f6859397","unresolved":false,"context_lines":[{"line_number":555,"context_line":"            db.volume_get(context.get_admin_context(), vol_id)"},{"line_number":556,"context_line":"            return True"},{"line_number":557,"context_line":"        except exception.VolumeNotFound:"},{"line_number":558,"context_line":"            return False"},{"line_number":559,"context_line":"    return False"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afb71cf_053470db","line":558,"updated":"2015-06-10 10:33:13.000000000","message":"Since you are handling this case (name like cinder volume name but unmanaged), I\u0027ve a question.\n\nWhat if there are two unmanaged volumes with same (cinder like) name in two hosts?","commit_id":"73196f1d3b2fee73d45beb8c74fecda45af12989"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"ff31b21b0a6e87e45d1a53d98720d7e7cbc4fe1d","unresolved":false,"context_lines":[{"line_number":555,"context_line":"            db.volume_get(context.get_admin_context(), vol_id)"},{"line_number":556,"context_line":"            return True"},{"line_number":557,"context_line":"        except exception.VolumeNotFound:"},{"line_number":558,"context_line":"            return False"},{"line_number":559,"context_line":"    return False"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afb71cf_23588155","line":558,"in_reply_to":"3afb71cf_053470db","updated":"2015-06-10 13:23:06.000000000","message":"Driver should rename volume during volume manage flow, after you manage first volume, their names would be different.","commit_id":"73196f1d3b2fee73d45beb8c74fecda45af12989"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f1282686fb9bc74e109e3cc5e83a5c18626162f","unresolved":false,"context_lines":[{"line_number":544,"context_line":""},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"def check_already_managed_volume(db, vol_name):"},{"line_number":547,"context_line":"    \"\"\"Check cinder db for already managed volume"},{"line_number":548,"context_line":"       Return True, if db entry with specified volume name exist,"},{"line_number":549,"context_line":"       otherwise return False"},{"line_number":550,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":17,"id":"3afb71cf_f97e6ae2","line":547,"updated":"2015-06-11 10:44:42.000000000","message":"Please follow H405.\n\nhttp://docs.openstack.org/developer/hacking/#docstrings\n\nI wouldn\u0027t consider a big issue, but others have just gone through the code to fix other violations, so I think we should be consistent.","commit_id":"4d97c49c79abc9c34f74e562c4124fa9ba69d8df"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"32f77da1a06148e05879b21d17ac33de1b35a799","unresolved":false,"context_lines":[{"line_number":530,"context_line":"    return extract_host(host_1) \u003d\u003d extract_host(host_2)"},{"line_number":531,"context_line":""},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"def _is_cinder_volume_name_like(vol_name):"},{"line_number":534,"context_line":"    # UUID expression ver.4 (RFC 4122)."},{"line_number":535,"context_line":"    uuid_reg \u003d (\u0027[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}\u0027"},{"line_number":536,"context_line":"                \u0027-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}\u0027)"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa32b979_d755b7f9","line":533,"updated":"2015-06-18 20:16:29.000000000","message":"Wouldn\u0027t it be easier to create a method _extract_id, that you can also in check_already_managed_volume, and in that method all you have to do is replace %s from the template with (?P\u003cuuid\u003e.+?) and then search the group and use uuid.UUID(uuid, version\u003d4) to check if it\u0027s a UUID?","commit_id":"f46a1d5ae270a211b59a823c09145a4d549bc41f"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"27918d7a958e8312d4a2ee90a403f2e9cd5bc632","unresolved":false,"context_lines":[{"line_number":530,"context_line":"    return extract_host(host_1) \u003d\u003d extract_host(host_2)"},{"line_number":531,"context_line":""},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"def _is_cinder_volume_name_like(vol_name):"},{"line_number":534,"context_line":"    # UUID expression ver.4 (RFC 4122)."},{"line_number":535,"context_line":"    uuid_reg \u003d (\u0027[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}\u0027"},{"line_number":536,"context_line":"                \u0027-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}\u0027)"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa32b979_5fd05253","line":533,"in_reply_to":"fa32b979_d755b7f9","updated":"2015-06-23 11:14:02.000000000","message":"I thought  about \u0027uuid.UUID(uuid, version\u003d4)\u0027 , but it doesn\u0027t check on real uuid4(RFC 4122), and maybe we don\u0027t need \u0027real check\u0027 here, but it makes code more clear, so I\u0027m agree with you.\nAbout named groups, didn\u0027t know about them, thanks, nice feature","commit_id":"f46a1d5ae270a211b59a823c09145a4d549bc41f"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"32f77da1a06148e05879b21d17ac33de1b35a799","unresolved":false,"context_lines":[{"line_number":549,"context_line":""},{"line_number":550,"context_line":"    :param db: database api parameter"},{"line_number":551,"context_line":"    :param vol_name: volume name parameter"},{"line_number":552,"context_line":"    :returns: bool -- return True, if db entry with specified"},{"line_number":553,"context_line":"                      volume name exist, otherwise return False"},{"line_number":554,"context_line":"    \"\"\""},{"line_number":555,"context_line":"    if _is_cinder_volume_name_like(vol_name):"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa32b979_37d6634f","line":552,"updated":"2015-06-18 20:16:29.000000000","message":"Shouldn\u0027t you specify the type in a different line?\n\n:rtype: bool","commit_id":"f46a1d5ae270a211b59a823c09145a4d549bc41f"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"27918d7a958e8312d4a2ee90a403f2e9cd5bc632","unresolved":false,"context_lines":[{"line_number":549,"context_line":""},{"line_number":550,"context_line":"    :param db: database api parameter"},{"line_number":551,"context_line":"    :param vol_name: volume name parameter"},{"line_number":552,"context_line":"    :returns: bool -- return True, if db entry with specified"},{"line_number":553,"context_line":"                      volume name exist, otherwise return False"},{"line_number":554,"context_line":"    \"\"\""},{"line_number":555,"context_line":"    if _is_cinder_volume_name_like(vol_name):"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa32b979_7fe0b6cc","line":552,"in_reply_to":"fa32b979_37d6634f","updated":"2015-06-23 11:14:02.000000000","message":"According to http://docs.openstack.org/developer/hacking/#docstrings nope","commit_id":"f46a1d5ae270a211b59a823c09145a4d549bc41f"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"32f77da1a06148e05879b21d17ac33de1b35a799","unresolved":false,"context_lines":[{"line_number":554,"context_line":"    \"\"\""},{"line_number":555,"context_line":"    if _is_cinder_volume_name_like(vol_name):"},{"line_number":556,"context_line":"        vol_template_part \u003d CONF.volume_name_template % \u0027\u0027"},{"line_number":557,"context_line":"        vol_id \u003d vol_name.replace(vol_template_part, \u0027\u0027, 1)"},{"line_number":558,"context_line":"        try:"},{"line_number":559,"context_line":"            db.volume_get(context.get_admin_context(), vol_id)"},{"line_number":560,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa32b979_b7a11396","line":557,"updated":"2015-06-18 20:16:29.000000000","message":"This will only work if template has the uuid at the end, but it could be of the form \"volume-%s-more\" and then this method would fail, even when _is_cinder_volume_name_like said it is an UUID.\n\nWith the solution I propose it would work in those cases as well.","commit_id":"f46a1d5ae270a211b59a823c09145a4d549bc41f"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"27918d7a958e8312d4a2ee90a403f2e9cd5bc632","unresolved":false,"context_lines":[{"line_number":554,"context_line":"    \"\"\""},{"line_number":555,"context_line":"    if _is_cinder_volume_name_like(vol_name):"},{"line_number":556,"context_line":"        vol_template_part \u003d CONF.volume_name_template % \u0027\u0027"},{"line_number":557,"context_line":"        vol_id \u003d vol_name.replace(vol_template_part, \u0027\u0027, 1)"},{"line_number":558,"context_line":"        try:"},{"line_number":559,"context_line":"            db.volume_get(context.get_admin_context(), vol_id)"},{"line_number":560,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa32b979_5f5e12ea","line":557,"in_reply_to":"fa32b979_b7a11396","updated":"2015-06-23 11:14:02.000000000","message":"Thanks for catch it, but I think there is error in your template  too (?P\u003cuuid\u003e.+?), last ? is redundant, it wouldn\u0027t match \u0027volume-id\u0027 case","commit_id":"f46a1d5ae270a211b59a823c09145a4d549bc41f"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ff96f35130755d0cf7ef4d186b0e054ff91ae1ce","unresolved":false,"context_lines":[{"line_number":547,"context_line":"                      volume name exist, otherwise return False"},{"line_number":548,"context_line":"    \"\"\""},{"line_number":549,"context_line":"    vol_id \u003d _extract_id(vol_name)"},{"line_number":550,"context_line":"    if vol_id and uuid.UUID(vol_id, version\u003d4):"},{"line_number":551,"context_line":"        try:"},{"line_number":552,"context_line":"            db.volume_get(context.get_admin_context(), vol_id)"},{"line_number":553,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":20,"id":"fa32b979_fa9e1453","line":550,"updated":"2015-06-23 11:36:57.000000000","message":"You should catch ValueError exception here in case it is not a valid UUID so you can return False instead of an exception, right?","commit_id":"5a74a6c5e966b9ac05257a651cfc64f9c2bd1da9"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"2d60c49784eea545d366563ae886b9ad61f75fab","unresolved":false,"context_lines":[{"line_number":564,"context_line":"    except (exception.VolumeNotFound, ValueError):"},{"line_number":565,"context_line":"        return False"},{"line_number":566,"context_line":"    return False"},{"line_number":567,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"ba3cc151_3ad5ea41","line":567,"updated":"2015-07-09 16:20:49.000000000","message":"You\u0027ve got a blank line at the end of the file that pep isn\u0027t going to like.","commit_id":"fcd1061cf252c738a61a2d2026dc3bcd1bc10fcf"}]}
