)]}'
{"cinder/api/contrib/backups.py":[{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"2dcda8cc863bfbe4230adeee7035f346a2d21bbf","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        try:"},{"line_number":265,"context_line":"            new_backup \u003d self.backup_api.create(context, name, description,"},{"line_number":266,"context_line":"                                                volume_id, container,"},{"line_number":267,"context_line":"                                                incremental, None, force)"},{"line_number":268,"context_line":"        except exception.InvalidVolume as error:"},{"line_number":269,"context_line":"            raise exc.HTTPBadRequest(explanation\u003derror.msg)"},{"line_number":270,"context_line":"        except exception.VolumeNotFound as error:"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa32b979_77548fc9","line":267,"updated":"2015-06-27 17:15:06.000000000","message":"You are setting availability_zone to None, which is the right thing to do since it was implicitly None before your change, but it raises the question whether anyone ever sets it to something other than None, and if so, where is this done.\n\nI\u0027m just asking, not suggesting that you should change this.\nhere.","commit_id":"e837c6dd5d253012321136cc691f275db203b1d7"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"08fae6c2bbd40c68498b368a242052cb85828a11","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        try:"},{"line_number":265,"context_line":"            new_backup \u003d self.backup_api.create(context, name, description,"},{"line_number":266,"context_line":"                                                volume_id, container,"},{"line_number":267,"context_line":"                                                incremental, None, force)"},{"line_number":268,"context_line":"        except exception.InvalidVolume as error:"},{"line_number":269,"context_line":"            raise exc.HTTPBadRequest(explanation\u003derror.msg)"},{"line_number":270,"context_line":"        except exception.VolumeNotFound as error:"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa32b979_d5cd5387","line":267,"in_reply_to":"fa32b979_77548fc9","updated":"2015-06-27 22:11:28.000000000","message":"So the availability_zone passed to backup API is not passed to the create backup call.  Backup manager sets it to a configure value in cinder.conf. See my notes here:\n\nhttps://review.openstack.org/#/c/193937/9/cinder/backup/manager.py\n\nProbably should be fixed in a different patch.","commit_id":"e837c6dd5d253012321136cc691f275db203b1d7"}],"cinder/backup/api.py":[{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"825eed2db335c61d8af54d794b75ede2790aa6b8","unresolved":false,"context_lines":[{"line_number":127,"context_line":"               force\u003dFalse):"},{"line_number":128,"context_line":"        \"\"\"Make the RPC call to create a volume backup.\"\"\""},{"line_number":129,"context_line":"        check_policy(context, \u0027create\u0027)"},{"line_number":130,"context_line":"        volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        if volume[\u0027status\u0027] not in [\"available\", \"in-use\"]:"},{"line_number":133,"context_line":"            msg \u003d (_(\u0027Volume to be backed up must be available \u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_d5f7938a","line":130,"updated":"2015-06-27 23:04:50.000000000","message":"beginning of window","commit_id":"5be3bb63be4efd3e20641eb70a787b49e66a0928"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"825eed2db335c61d8af54d794b75ede2790aa6b8","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        check_policy(context, \u0027create\u0027)"},{"line_number":130,"context_line":"        volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        if volume[\u0027status\u0027] not in [\"available\", \"in-use\"]:"},{"line_number":133,"context_line":"            msg \u003d (_(\u0027Volume to be backed up must be available \u0027"},{"line_number":134,"context_line":"                     \u0027or in-use, but the current status is \"%s\".\u0027)"},{"line_number":135,"context_line":"                   % volume[\u0027status\u0027])"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_95482bce","line":132,"updated":"2015-06-27 23:04:50.000000000","message":"more than one create requwst can find volume status available or in-use.","commit_id":"5be3bb63be4efd3e20641eb70a787b49e66a0928"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"825eed2db335c61d8af54d794b75ede2790aa6b8","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                        \u0027incremental backup.\u0027)"},{"line_number":202,"context_line":"                raise exception.InvalidBackup(reason\u003dmsg)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        try:"},{"line_number":205,"context_line":"            kwargs \u003d {"},{"line_number":206,"context_line":"                \u0027user_id\u0027: context.user_id,"},{"line_number":207,"context_line":"                \u0027project_id\u0027: context.project_id,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_752d67fc","line":204,"updated":"2015-06-27 23:04:50.000000000","message":"old window ended here, new one won\u0027t end until manager, across an RPC.","commit_id":"5be3bb63be4efd3e20641eb70a787b49e66a0928"}],"cinder/backup/manager.py":[{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"08fae6c2bbd40c68498b368a242052cb85828a11","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    target \u003d messaging.Target(version\u003dRPC_API_VERSION)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def __init__(self, service_name\u003dNone, *args, **kwargs):"},{"line_number":82,"context_line":"        self.service \u003d importutils.import_module(self.driver_name)"},{"line_number":83,"context_line":"        self.az \u003d CONF.storage_availability_zone"},{"line_number":84,"context_line":"        self.volume_managers \u003d {}"},{"line_number":85,"context_line":"        self._setup_volume_drivers()"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa32b979_35dfdf3b","line":82,"updated":"2015-06-27 22:11:28.000000000","message":"self.az is set to storage_availability_zone from cinder.conf.","commit_id":"e837c6dd5d253012321136cc691f275db203b1d7"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"08fae6c2bbd40c68498b368a242052cb85828a11","unresolved":false,"context_lines":[{"line_number":318,"context_line":"        self.db.volume_update(context, volume_id, {\u0027status\u0027: orig_status})"},{"line_number":319,"context_line":"        backup.status \u003d \u0027available\u0027"},{"line_number":320,"context_line":"        backup.size \u003d volume[\u0027size\u0027]"},{"line_number":321,"context_line":"        backup.availability_zone \u003d self.az"},{"line_number":322,"context_line":"        backup.save()"},{"line_number":323,"context_line":"        LOG.info(_LI(\u0027Create backup finished. backup: %s.\u0027), backup.id)"},{"line_number":324,"context_line":"        self._notify_about_backup_usage(context, backup, \"create.end\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa32b979_b5144fe9","line":321,"updated":"2015-06-27 22:11:28.000000000","message":"availability_zone is set to self.az here.","commit_id":"e837c6dd5d253012321136cc691f275db203b1d7"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"825eed2db335c61d8af54d794b75ede2790aa6b8","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        # Save the original status, either available or in-use."},{"line_number":252,"context_line":"        volume \u003d self.db.volume_get(context, volume_id)"},{"line_number":253,"context_line":"        orig_status \u003d volume[\u0027status\u0027]"},{"line_number":254,"context_line":"        expected_orig_status \u003d [\u0027available\u0027, \u0027in-use\u0027]"},{"line_number":255,"context_line":"        if orig_status not in expected_orig_status:"},{"line_number":256,"context_line":"            err \u003d _(\u0027Create backup aborted, expected original volume status \u0027"},{"line_number":257,"context_line":"                    \u0027%(expected_status)s but got %(actual_status)s.\u0027) % {"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_d53eb328","line":254,"updated":"2015-06-27 23:04:50.000000000","message":"Could have more than one create_backup going on in this state.","commit_id":"5be3bb63be4efd3e20641eb70a787b49e66a0928"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"c09fe0c966e1e8cd5c7bd2c34c8342a62eccfc25","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        # Save the original status, either available or in-use."},{"line_number":252,"context_line":"        volume \u003d self.db.volume_get(context, volume_id)"},{"line_number":253,"context_line":"        orig_status \u003d volume[\u0027status\u0027]"},{"line_number":254,"context_line":"        expected_orig_status \u003d [\u0027available\u0027, \u0027in-use\u0027]"},{"line_number":255,"context_line":"        if orig_status not in expected_orig_status:"},{"line_number":256,"context_line":"            err \u003d _(\u0027Create backup aborted, expected original volume status \u0027"},{"line_number":257,"context_line":"                    \u0027%(expected_status)s but got %(actual_status)s.\u0027) % {"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_901cb96b","line":254,"in_reply_to":"fa32b979_d53eb328","updated":"2015-06-28 00:51:03.000000000","message":"The first one changes state to \u0027backing-up\u0027, so the others will fail here.  So the downside of this change is that the failure is happening at the manager level, rather than at the API level.\n\nAlternatively I can still change state to \u0027backing-up\u0027 in the API but pass in the original volume status to create_backup thru RPC.  So it behaves the same as before.","commit_id":"5be3bb63be4efd3e20641eb70a787b49e66a0928"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"825eed2db335c61d8af54d794b75ede2790aa6b8","unresolved":false,"context_lines":[{"line_number":261,"context_line":"            self._update_backup_error(backup, context, err)"},{"line_number":262,"context_line":"            raise exception.InvalidVolume(reason\u003derr)"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"        self.db.volume_update(context, volume_id, {\u0027status\u0027: \u0027backing-up\u0027})"},{"line_number":265,"context_line":"        volume \u003d self.db.volume_get(context, volume_id)"},{"line_number":266,"context_line":"        LOG.info(_LI(\u0027Create backup started, backup: %(backup_id)s \u0027"},{"line_number":267,"context_line":"                     \u0027volume: %(volume_id)s.\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_551143ae","line":264,"updated":"2015-06-27 23:04:50.000000000","message":"new window ends here","commit_id":"5be3bb63be4efd3e20641eb70a787b49e66a0928"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"368876fd211e3f4c5286a1dc4df0cbe78a138752","unresolved":false,"context_lines":[{"line_number":298,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":299,"context_line":"                self.db.volume_update(context, volume_id,"},{"line_number":300,"context_line":"                                      {\u0027status\u0027: \u0027available\u0027})"},{"line_number":301,"context_line":"                self._update_backup_error(backup, context, six.text_type(err))"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        # Restore the original status."},{"line_number":304,"context_line":"        self.db.volume_update(context, volume_id, {\u0027status\u0027: orig_status})"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_88b97fce","line":301,"updated":"2015-07-02 13:13:20.000000000","message":"So if the backup goes into error, we never restore the original status?","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"759db109465a0b58a050f1499c3b13b8759463be","unresolved":false,"context_lines":[{"line_number":298,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":299,"context_line":"                self.db.volume_update(context, volume_id,"},{"line_number":300,"context_line":"                                      {\u0027status\u0027: \u0027available\u0027})"},{"line_number":301,"context_line":"                self._update_backup_error(backup, context, six.text_type(err))"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        # Restore the original status."},{"line_number":304,"context_line":"        self.db.volume_update(context, volume_id, {\u0027status\u0027: orig_status})"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_e2570224","line":301,"in_reply_to":"ba3cc151_88b97fce","updated":"2015-07-02 14:46:34.000000000","message":"So this was written like this before. If the backup goes into error, the volume status won\u0027t be updated. This seems to be wrong. The backup is already marked as \u0027error\u0027. I think we should restore volume status.","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"d4e0ad348ad3805050189ff0107c36fec294cbeb","unresolved":false,"context_lines":[{"line_number":298,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":299,"context_line":"                self.db.volume_update(context, volume_id,"},{"line_number":300,"context_line":"                                      {\u0027status\u0027: \u0027available\u0027})"},{"line_number":301,"context_line":"                self._update_backup_error(backup, context, six.text_type(err))"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        # Restore the original status."},{"line_number":304,"context_line":"        self.db.volume_update(context, volume_id, {\u0027status\u0027: orig_status})"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_cd11b553","line":301,"in_reply_to":"ba3cc151_e2570224","updated":"2015-07-04 03:45:00.000000000","message":"I missed it earlier. The status will be restored to \u0027available\u0027 on line 300. I\u0027ll change it to orig_status.","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"2dfdbd70fe1041c291f667872a5f4838c216e422","unresolved":false,"context_lines":[{"line_number":271,"context_line":"                # The temp snapshot should be deleted directly thru the"},{"line_number":272,"context_line":"                # volume driver, not thru the volume manager."},{"line_number":273,"context_line":"                mgr.driver.delete_snapshot(temp_snapshot)"},{"line_number":274,"context_line":"                temp_snapshot._context \u003d ctxt"},{"line_number":275,"context_line":"                self.db.volume_glance_metadata_delete_by_snapshot("},{"line_number":276,"context_line":"                    ctxt, temp_snapshot.id)"},{"line_number":277,"context_line":"                temp_snapshot.destroy()"}],"source_content_type":"text/x-python","patch_set":22,"id":"9a41bdd9_d5743c69","line":274,"updated":"2015-07-14 14:27:05.000000000","message":"temp_snapshot was initialized with context\u003dctxt in L269, so the context temp_snapshot should continue to have the same context.  Is there any reason for re-assigning the context?","commit_id":"031518f07edaf504eb9089bd3753c0a8dcd36c98"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"4d6bcd610f2ea57ed60c8e298c4e314a4d13a1b2","unresolved":false,"context_lines":[{"line_number":271,"context_line":"                # The temp snapshot should be deleted directly thru the"},{"line_number":272,"context_line":"                # volume driver, not thru the volume manager."},{"line_number":273,"context_line":"                mgr.driver.delete_snapshot(temp_snapshot)"},{"line_number":274,"context_line":"                temp_snapshot._context \u003d ctxt"},{"line_number":275,"context_line":"                self.db.volume_glance_metadata_delete_by_snapshot("},{"line_number":276,"context_line":"                    ctxt, temp_snapshot.id)"},{"line_number":277,"context_line":"                temp_snapshot.destroy()"}],"source_content_type":"text/x-python","patch_set":22,"id":"9a41bdd9_9ac9dd5b","line":274,"in_reply_to":"9a41bdd9_d5743c69","updated":"2015-07-15 03:34:06.000000000","message":"I thought I ran into problem with it earlier if I don\u0027t do this assignment. snapshot._context is non admin without the assignment and destroy will fail.  I\u0027ll double check.","commit_id":"031518f07edaf504eb9089bd3753c0a8dcd36c98"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"4963b8209ccee06e56b0748161ccca5fd9d9b1bf","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                temp_snapshot._context \u003d ctxt"},{"line_number":275,"context_line":"                self.db.volume_glance_metadata_delete_by_snapshot("},{"line_number":276,"context_line":"                    ctxt, temp_snapshot.id)"},{"line_number":277,"context_line":"                temp_snapshot.destroy()"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"    def create_backup(self, context, backup, orig_status):"},{"line_number":280,"context_line":"        \"\"\"Create volume backups using configured backup service.\"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"9a41bdd9_1a9ced0d","line":277,"updated":"2015-07-15 03:40:11.000000000","message":"If an admin context is needed for destroy, then we could do:\n\nwith temp_snapshot.obj_as_admin():\n    temp_snapshot.destroy()\n\nThis should work vs. re-assigning the context above.","commit_id":"031518f07edaf504eb9089bd3753c0a8dcd36c98"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"355855b1f0f45d67e0f85004964d891164f42db8","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                temp_snapshot._context \u003d ctxt"},{"line_number":275,"context_line":"                self.db.volume_glance_metadata_delete_by_snapshot("},{"line_number":276,"context_line":"                    ctxt, temp_snapshot.id)"},{"line_number":277,"context_line":"                temp_snapshot.destroy()"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"    def create_backup(self, context, backup, orig_status):"},{"line_number":280,"context_line":"        \"\"\"Create volume backups using configured backup service.\"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"9a41bdd9_0c7731a0","line":277,"in_reply_to":"9a41bdd9_1a9ced0d","updated":"2015-07-18 15:25:33.000000000","message":"Done","commit_id":"031518f07edaf504eb9089bd3753c0a8dcd36c98"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"d29bb9a592ee2519ef76f757911f3bc9974967fe","unresolved":false,"context_lines":[{"line_number":291,"context_line":"        \"\"\"Create volume backups using configured backup service.\"\"\""},{"line_number":292,"context_line":"        volume_id \u003d backup.volume_id"},{"line_number":293,"context_line":"        volume \u003d self.db.volume_get(context, volume_id)"},{"line_number":294,"context_line":"        previous_status \u003d volume[\u0027previous_status\u0027]"},{"line_number":295,"context_line":"        LOG.info(_LI(\u0027Create backup started, backup: %(backup_id)s \u0027"},{"line_number":296,"context_line":"                     \u0027volume: %(volume_id)s.\u0027),"},{"line_number":297,"context_line":"                 {\u0027backup_id\u0027: backup.id, \u0027volume_id\u0027: volume_id})"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_7241f438","line":294,"updated":"2015-07-17 23:27:38.000000000","message":"Maybe change this to a get with a default?","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"020a416bf4db9887dc4dae9921303f4c37eca84a","unresolved":false,"context_lines":[{"line_number":291,"context_line":"        \"\"\"Create volume backups using configured backup service.\"\"\""},{"line_number":292,"context_line":"        volume_id \u003d backup.volume_id"},{"line_number":293,"context_line":"        volume \u003d self.db.volume_get(context, volume_id)"},{"line_number":294,"context_line":"        previous_status \u003d volume[\u0027previous_status\u0027]"},{"line_number":295,"context_line":"        LOG.info(_LI(\u0027Create backup started, backup: %(backup_id)s \u0027"},{"line_number":296,"context_line":"                     \u0027volume: %(volume_id)s.\u0027),"},{"line_number":297,"context_line":"                 {\u0027backup_id\u0027: backup.id, \u0027volume_id\u0027: volume_id})"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_f7872910","line":294,"in_reply_to":"9a41bdd9_7241f438","updated":"2015-07-18 15:22:25.000000000","message":"Done","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"d29bb9a592ee2519ef76f757911f3bc9974967fe","unresolved":false,"context_lines":[{"line_number":341,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":342,"context_line":"                self.db.volume_update(context, volume_id,"},{"line_number":343,"context_line":"                                      {\u0027status\u0027: previous_status,"},{"line_number":344,"context_line":"                                       \u0027previous_status\u0027: None})"},{"line_number":345,"context_line":"                self._update_backup_error(backup, context, six.text_type(err))"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"        # Restore the original status."}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_f29ae4c4","line":344,"updated":"2015-07-17 23:27:38.000000000","message":"Is this actually the correct state to set here for previous_status?  So I know the intent is to have something persistent to roll back to; but should this be updated to \"backup-failed\" perhaps?","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"020a416bf4db9887dc4dae9921303f4c37eca84a","unresolved":false,"context_lines":[{"line_number":341,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":342,"context_line":"                self.db.volume_update(context, volume_id,"},{"line_number":343,"context_line":"                                      {\u0027status\u0027: previous_status,"},{"line_number":344,"context_line":"                                       \u0027previous_status\u0027: None})"},{"line_number":345,"context_line":"                self._update_backup_error(backup, context, six.text_type(err))"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"        # Restore the original status."}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_b7b3e109","line":344,"in_reply_to":"9a41bdd9_f29ae4c4","updated":"2015-07-18 15:22:25.000000000","message":"I see what you are saying.  Changed it to \u0027previous_status\u0027: \u0027error_backing-up\u0027 (error_xxxing seems to be the status naming convention).","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"d29bb9a592ee2519ef76f757911f3bc9974967fe","unresolved":false,"context_lines":[{"line_number":347,"context_line":"        # Restore the original status."},{"line_number":348,"context_line":"        self.db.volume_update(context, volume_id,"},{"line_number":349,"context_line":"                              {\u0027status\u0027: previous_status,"},{"line_number":350,"context_line":"                               \u0027previous_status\u0027: None})"},{"line_number":351,"context_line":"        backup.status \u003d \u0027available\u0027"},{"line_number":352,"context_line":"        backup.size \u003d volume[\u0027size\u0027]"},{"line_number":353,"context_line":"        backup.availability_zone \u003d self.az"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_923cb8c0","line":350,"updated":"2015-07-17 23:27:38.000000000","message":"Same question as above","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"020a416bf4db9887dc4dae9921303f4c37eca84a","unresolved":false,"context_lines":[{"line_number":347,"context_line":"        # Restore the original status."},{"line_number":348,"context_line":"        self.db.volume_update(context, volume_id,"},{"line_number":349,"context_line":"                              {\u0027status\u0027: previous_status,"},{"line_number":350,"context_line":"                               \u0027previous_status\u0027: None})"},{"line_number":351,"context_line":"        backup.status \u003d \u0027available\u0027"},{"line_number":352,"context_line":"        backup.size \u003d volume[\u0027size\u0027]"},{"line_number":353,"context_line":"        backup.availability_zone \u003d self.az"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_b7aa0184","line":350,"in_reply_to":"9a41bdd9_923cb8c0","updated":"2015-07-18 15:22:25.000000000","message":"Changed to \u0027previous_status\u0027: \u0027backing-up\u0027","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"5a60334e343caba8f0c2dcd9c1c67149cbaa38dd","unresolved":false,"context_lines":[{"line_number":347,"context_line":"        # Restore the original status."},{"line_number":348,"context_line":"        self.db.volume_update(context, volume_id,"},{"line_number":349,"context_line":"                              {\u0027status\u0027: previous_status,"},{"line_number":350,"context_line":"                               \u0027previous_status\u0027: \u0027backing-up\u0027})"},{"line_number":351,"context_line":"        backup.status \u003d \u0027available\u0027"},{"line_number":352,"context_line":"        backup.size \u003d volume[\u0027size\u0027]"},{"line_number":353,"context_line":"        backup.availability_zone \u003d self.az"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a50d1a3_c16a36ee","line":350,"updated":"2015-07-22 07:31:42.000000000","message":"I just have some questions about how to use the previous_status:\n1. IMO, when the previous status is None, it means the status can definitely means the real status of the volume. Is is true?\n2. Should the previous status be changed each time the status is changed? If so, I think there are many places, where the previous_status should be added for a change. Am I correct? Or we have limited requests/actions, able to access previous_volume?\n3. Is it possible that more than one action are checking and changing the previous status at the same time, leading to the chaos of the volume previous_volume? If volume migration uses this previous status as well, would it conflict with the backup?","commit_id":"c720e6e8d661b80ca1efc4c2ef10bdca918496cc"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"1d821c20466978a4982420ad520edb5b8a019a55","unresolved":false,"context_lines":[{"line_number":347,"context_line":"        # Restore the original status."},{"line_number":348,"context_line":"        self.db.volume_update(context, volume_id,"},{"line_number":349,"context_line":"                              {\u0027status\u0027: previous_status,"},{"line_number":350,"context_line":"                               \u0027previous_status\u0027: \u0027backing-up\u0027})"},{"line_number":351,"context_line":"        backup.status \u003d \u0027available\u0027"},{"line_number":352,"context_line":"        backup.size \u003d volume[\u0027size\u0027]"},{"line_number":353,"context_line":"        backup.availability_zone \u003d self.az"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a50d1a3_4467dbe8","line":350,"in_reply_to":"3a50d1a3_56bfb8a9","updated":"2015-07-23 03:12:05.000000000","message":"Now I can understand more about the use case. There are similar cases so far for the volume retype(status from in-use or available to retyping) and migrate with the --force flag(status from in-use or available to maintenance).\nThe status needs be set back to the original.\nSince the volume status has changed during these operations. Other operations can be prevented, because normally they check if the volume is in in-use or available. Otherwise, they won\u0027t be able to proceed.\nFine. I think I can use it for the migration and retype as well. Thank you for the explanations.","commit_id":"c720e6e8d661b80ca1efc4c2ef10bdca918496cc"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"d2417b018899b560b804c28fe8cd220b7dbf0e50","unresolved":false,"context_lines":[{"line_number":347,"context_line":"        # Restore the original status."},{"line_number":348,"context_line":"        self.db.volume_update(context, volume_id,"},{"line_number":349,"context_line":"                              {\u0027status\u0027: previous_status,"},{"line_number":350,"context_line":"                               \u0027previous_status\u0027: \u0027backing-up\u0027})"},{"line_number":351,"context_line":"        backup.status \u003d \u0027available\u0027"},{"line_number":352,"context_line":"        backup.size \u003d volume[\u0027size\u0027]"},{"line_number":353,"context_line":"        backup.availability_zone \u003d self.az"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a50d1a3_56bfb8a9","line":350,"in_reply_to":"3a50d1a3_c16a36ee","updated":"2015-07-22 12:47:46.000000000","message":"Hi Vincent,\n\nThe previous_status was introduced in this patch to solve a particular problem for backing up attached volumes. Previously only \u0027available\u0027 volume can be backed up, so the one and only previous status is \u0027available\u0027 and therefore there\u0027s no need to persist the previous status. Now we allow volume in \u0027in-use\u0027 status to be backed up, so we need to know whether the previous status is \u0027available\u0027 or \u0027in-use\u0027.  For changing the status back after backup is complete, I can solve that problem by passing in the previous_status, which I did in the previous patch sets.  The only time I couldn\u0027t rely on passed in status is to clean up failed backup attempts at service start up time as cleanup actions are different for previous available or in-use volumes.  That was the reason I added a previous_status column to persist it so it can be used to make decisions to clean up failed backups when service restarts.\n\nThat being said, now this column can be used for other operations that need a previous_status.  I will not change all other places in this patch because that is beyond the scope of this patch and also because most operations don\u0027t need this. If there\u0027s really a reason to change all other places, that can be done at a different patch after this one lands.  For the volume migration case, since you need an original status, you can use this as well. It will not interfere with backup because the volume status will be \"backing-up\" when we try to change it back to the previous_status for backup. I don\u0027t understand your statement of \"leading to the chaos\".  In the end, this is a column in the volumes table, same as volume \u0027status\u0027 which is changed by many operations.  Whenever we use it, of course we need to make sure it is set appropriately. \nIn the case of backup, the volume \u0027status\u0027 will be changed from \u0027available\u0027 or \u0027in-use\u0027 to \u0027backing-up\u0027 when backup starts, regardless of the previous_status. previous_status is just used to save \u0027available\u0027 or \u0027in-use\u0027.  After backup is complete, volume \u0027status\u0027 will be changed back to \u0027available\u0027 or \u0027in-use\u0027 based on \u0027previous_status\u0027.  No other operations should be attempted on the volume in the middle because it is in \u0027backing-up\u0027 status.","commit_id":"c720e6e8d661b80ca1efc4c2ef10bdca918496cc"}],"cinder/db/sqlalchemy/migrate_repo/versions/049_add_temp_volume_snapshot_ids_to_backups.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"d29bb9a592ee2519ef76f757911f3bc9974967fe","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from cinder.i18n import _LE"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def upgrade(migrate_engine):"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_8f07b31c","line":21,"updated":"2015-07-17 23:27:38.000000000","message":"We don\u0027t need logging in these migrations, could you please remove these?","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"020a416bf4db9887dc4dae9921303f4c37eca84a","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from cinder.i18n import _LE"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def upgrade(migrate_engine):"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_77a3199f","line":21,"in_reply_to":"9a41bdd9_8f07b31c","updated":"2015-07-18 15:22:25.000000000","message":"Removed:).","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"}],"cinder/db/sqlalchemy/migrate_repo/versions/050_add_previous_status_to_volumes.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"d29bb9a592ee2519ef76f757911f3bc9974967fe","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from cinder.i18n import _LE"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def upgrade(migrate_engine):"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_72afb4e3","line":21,"updated":"2015-07-17 23:27:38.000000000","message":"logs :(","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"020a416bf4db9887dc4dae9921303f4c37eca84a","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from cinder.i18n import _LE"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def upgrade(migrate_engine):"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_979edd52","line":21,"in_reply_to":"9a41bdd9_72afb4e3","updated":"2015-07-18 15:22:25.000000000","message":"Removed.","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"}],"cinder/tests/unit/api/contrib/test_backups.py":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"b52e4f8f86bff8eead0050ee12202dff6008087e","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        res \u003d req.get_response(fakes.wsgi_app())"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":439,"context_line":"        LOG.info(res_dict)"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"        self.assertEqual(res.status_int, 400)"},{"line_number":442,"context_line":"        self.assertEqual(res_dict[\u0027badRequest\u0027][\u0027code\u0027], 400)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa32b979_ef3f6985","line":439,"updated":"2015-06-27 13:38:47.000000000","message":"I think we determined logging in unit tests was pointless and John had started to remove instances of it.\n\nI see it is elsewhere in this code already, but I think we should probably stop doing so. Since there are others though, I think that can be addressed in a separate cleanup patch if we really are removing them all.","commit_id":"965ed7cf0330e91229112b3e22ee7d4c1189b321"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"8f355e3066641d14d1ecbb717f9fac6c6f20ee4a","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        res \u003d req.get_response(fakes.wsgi_app())"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":439,"context_line":"        LOG.info(res_dict)"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"        self.assertEqual(res.status_int, 400)"},{"line_number":442,"context_line":"        self.assertEqual(res_dict[\u0027badRequest\u0027][\u0027code\u0027], 400)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa32b979_e13bfdc6","line":439,"in_reply_to":"fa32b979_ef3f6985","updated":"2015-06-27 14:57:15.000000000","message":"Done","commit_id":"965ed7cf0330e91229112b3e22ee7d4c1189b321"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"b52e4f8f86bff8eead0050ee12202dff6008087e","unresolved":false,"context_lines":[{"line_number":438,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":439,"context_line":"        LOG.info(res_dict)"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"        self.assertEqual(res.status_int, 400)"},{"line_number":442,"context_line":"        self.assertEqual(res_dict[\u0027badRequest\u0027][\u0027code\u0027], 400)"},{"line_number":443,"context_line":"        self.assertIsNotNone(res_dict[\u0027badRequest\u0027][\u0027message\u0027])"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa32b979_0f43ad14","line":441,"updated":"2015-06-27 13:38:47.000000000","message":"Arguments switched, should be (expected, actual)","commit_id":"965ed7cf0330e91229112b3e22ee7d4c1189b321"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"8f355e3066641d14d1ecbb717f9fac6c6f20ee4a","unresolved":false,"context_lines":[{"line_number":438,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":439,"context_line":"        LOG.info(res_dict)"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"        self.assertEqual(res.status_int, 400)"},{"line_number":442,"context_line":"        self.assertEqual(res_dict[\u0027badRequest\u0027][\u0027code\u0027], 400)"},{"line_number":443,"context_line":"        self.assertIsNotNone(res_dict[\u0027badRequest\u0027][\u0027message\u0027])"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa32b979_814a3154","line":441,"in_reply_to":"fa32b979_0f43ad14","updated":"2015-06-27 14:57:15.000000000","message":"Done","commit_id":"965ed7cf0330e91229112b3e22ee7d4c1189b321"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"b52e4f8f86bff8eead0050ee12202dff6008087e","unresolved":false,"context_lines":[{"line_number":470,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":471,"context_line":"        LOG.info(res_dict)"},{"line_number":472,"context_line":""},{"line_number":473,"context_line":"        self.assertEqual(res.status_int, 202)"},{"line_number":474,"context_line":"        self.assertIn(\u0027id\u0027, res_dict[\u0027backup\u0027])"},{"line_number":475,"context_line":"        self.assertTrue(_mock_service_get_all_by_topic.called)"},{"line_number":476,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa32b979_af4ac125","line":473,"updated":"2015-06-27 13:38:47.000000000","message":"Same.","commit_id":"965ed7cf0330e91229112b3e22ee7d4c1189b321"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"8f355e3066641d14d1ecbb717f9fac6c6f20ee4a","unresolved":false,"context_lines":[{"line_number":470,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":471,"context_line":"        LOG.info(res_dict)"},{"line_number":472,"context_line":""},{"line_number":473,"context_line":"        self.assertEqual(res.status_int, 202)"},{"line_number":474,"context_line":"        self.assertIn(\u0027id\u0027, res_dict[\u0027backup\u0027])"},{"line_number":475,"context_line":"        self.assertTrue(_mock_service_get_all_by_topic.called)"},{"line_number":476,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa32b979_4173c9b4","line":473,"in_reply_to":"fa32b979_af4ac125","updated":"2015-06-27 14:57:15.000000000","message":"Done","commit_id":"965ed7cf0330e91229112b3e22ee7d4c1189b321"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"2dcda8cc863bfbe4230adeee7035f346a2d21bbf","unresolved":false,"context_lines":[{"line_number":406,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":407,"context_line":"        LOG.info(res_dict)"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"        self.assertEqual(res.status_int, 202)"},{"line_number":410,"context_line":"        self.assertIn(\u0027id\u0027, res_dict[\u0027backup\u0027])"},{"line_number":411,"context_line":"        self.assertTrue(_mock_service_get_all_by_topic.called)"},{"line_number":412,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa32b979_17cc23ba","line":409,"updated":"2015-06-27 17:15:06.000000000","message":"Note: 202 rather than 200","commit_id":"e837c6dd5d253012321136cc691f275db203b1d7"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"2dcda8cc863bfbe4230adeee7035f346a2d21bbf","unresolved":false,"context_lines":[{"line_number":469,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":470,"context_line":"        LOG.info(res_dict)"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"        self.assertEqual(200, res.status_int)"},{"line_number":473,"context_line":"        self.assertIn(\u0027id\u0027, res_dict[\u0027backup\u0027])"},{"line_number":474,"context_line":"        self.assertTrue(_mock_service_get_all_by_topic.called)"},{"line_number":475,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa32b979_f7c89faa","line":472,"updated":"2015-06-27 17:15:06.000000000","message":"202 - accepted but not completed ...","commit_id":"e837c6dd5d253012321136cc691f275db203b1d7"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"08fae6c2bbd40c68498b368a242052cb85828a11","unresolved":false,"context_lines":[{"line_number":469,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":470,"context_line":"        LOG.info(res_dict)"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"        self.assertEqual(200, res.status_int)"},{"line_number":473,"context_line":"        self.assertIn(\u0027id\u0027, res_dict[\u0027backup\u0027])"},{"line_number":474,"context_line":"        self.assertTrue(_mock_service_get_all_by_topic.called)"},{"line_number":475,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa32b979_b5b3ef4c","line":472,"in_reply_to":"fa32b979_f7c89faa","updated":"2015-06-27 22:11:28.000000000","message":"Done","commit_id":"e837c6dd5d253012321136cc691f275db203b1d7"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"ea544065af45c4fb81ac913ddd1d1b756437f1fc","unresolved":false,"context_lines":[{"line_number":467,"context_line":"        res \u003d req.get_response(fakes.wsgi_app())"},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":470,"context_line":"        LOG.info(res_dict)"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"        self.assertEqual(202, res.status_int)"},{"line_number":473,"context_line":"        self.assertIn(\u0027id\u0027, res_dict[\u0027backup\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba3cc151_f7775bd2","line":470,"updated":"2015-06-29 21:26:01.000000000","message":"Missed a logger call.","commit_id":"8c71e8dff69efd1c085f8c267fc994df4869fdac"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"13a9ec07b406628bfa69f01a9d1c67357ca871f6","unresolved":false,"context_lines":[{"line_number":467,"context_line":"        res \u003d req.get_response(fakes.wsgi_app())"},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":470,"context_line":"        LOG.info(res_dict)"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"        self.assertEqual(202, res.status_int)"},{"line_number":473,"context_line":"        self.assertIn(\u0027id\u0027, res_dict[\u0027backup\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba3cc151_8887d060","line":470,"in_reply_to":"ba3cc151_f7775bd2","updated":"2015-06-30 00:32:55.000000000","message":"Done","commit_id":"8c71e8dff69efd1c085f8c267fc994df4869fdac"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"7d789f4d2349cb035375ca92fbd2157416d3163c","unresolved":false,"context_lines":[{"line_number":435,"context_line":"        self.assertEqual(400, res_dict[\u0027badRequest\u0027][\u0027code\u0027])"},{"line_number":436,"context_line":"        self.assertIsNotNone(res_dict[\u0027badRequest\u0027][\u0027message\u0027])"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        db.volume_destroy(context.get_admin_context(), volume_id)"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    @mock.patch(\u0027cinder.db.service_get_all_by_topic\u0027)"},{"line_number":441,"context_line":"    def test_create_backup_inuse_force(self, _mock_service_get_all_by_topic):"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a50d1a3_701e4671","line":438,"updated":"2015-07-23 08:22:09.000000000","message":"It should be done in a cleanUp method but we\u0027ve already got it in other tests so I\u0027m fine with this patch","commit_id":"e78018bd05a51e33d5e1cd7c001ee6e5116a6370"}],"cinder/tests/unit/test_db_api.py":[{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"7d789f4d2349cb035375ca92fbd2157416d3163c","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        self.assertEqual("},{"line_number":85,"context_line":"            len(obj1), len(obj2),"},{"line_number":86,"context_line":"            \"Keys mismatch: %s\" % six.text_type("},{"line_number":87,"context_line":"                set(obj1.keys()) ^ set(obj2.keys())))"},{"line_number":88,"context_line":"        for key, value in obj1.items():"},{"line_number":89,"context_line":"            self.assertEqual(value, obj2[key])"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a50d1a3_8b33a7f5","line":86,"updated":"2015-07-23 08:22:09.000000000","message":"Thanks for fixing it!","commit_id":"e78018bd05a51e33d5e1cd7c001ee6e5116a6370"}],"cinder/tests/unit/test_volume.py":[{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"37908f45d4edb58721c88c515cd675211bde09ae","unresolved":false,"context_lines":[{"line_number":5589,"context_line":"    \"\"\"Test case for VolumeDriver.\"\"\""},{"line_number":5590,"context_line":"    driver_name \u003d \"cinder.tests.unit.fake_driver.LoggingVolumeDriver\""},{"line_number":5591,"context_line":""},{"line_number":5592,"context_line":"    def test_backup_volume(self):"},{"line_number":5593,"context_line":"        vol \u003d tests_utils.create_volume(self.context)"},{"line_number":5594,"context_line":"        self.context.user_id \u003d \u0027fake\u0027"},{"line_number":5595,"context_line":"        self.context.project_id \u003d \u0027fake\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a50d1a3_ed15e3e4","line":5592,"updated":"2015-07-22 08:38:44.000000000","message":"Yang Xing, since you have already touched this method, would you be nice enough to change all the \"self.mox.StubOutWithMock\"\ninto mock.patch or mock.patch.object?\nBesides, for self.mox.ReplayAll(), and self.mox.UnsetStubs(), I do not think we are expecting them any longer.\nThanks.","commit_id":"c720e6e8d661b80ca1efc4c2ef10bdca918496cc"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"1d821c20466978a4982420ad520edb5b8a019a55","unresolved":false,"context_lines":[{"line_number":5589,"context_line":"    \"\"\"Test case for VolumeDriver.\"\"\""},{"line_number":5590,"context_line":"    driver_name \u003d \"cinder.tests.unit.fake_driver.LoggingVolumeDriver\""},{"line_number":5591,"context_line":""},{"line_number":5592,"context_line":"    def test_backup_volume(self):"},{"line_number":5593,"context_line":"        vol \u003d tests_utils.create_volume(self.context)"},{"line_number":5594,"context_line":"        self.context.user_id \u003d \u0027fake\u0027"},{"line_number":5595,"context_line":"        self.context.project_id \u003d \u0027fake\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a50d1a3_045d5314","line":5592,"in_reply_to":"3a50d1a3_9976d3d5","updated":"2015-07-23 03:12:05.000000000","message":"Sweet. Thanks.","commit_id":"c720e6e8d661b80ca1efc4c2ef10bdca918496cc"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"7283a2359aa68f6348f4ffbf43792c198d9d4374","unresolved":false,"context_lines":[{"line_number":5589,"context_line":"    \"\"\"Test case for VolumeDriver.\"\"\""},{"line_number":5590,"context_line":"    driver_name \u003d \"cinder.tests.unit.fake_driver.LoggingVolumeDriver\""},{"line_number":5591,"context_line":""},{"line_number":5592,"context_line":"    def test_backup_volume(self):"},{"line_number":5593,"context_line":"        vol \u003d tests_utils.create_volume(self.context)"},{"line_number":5594,"context_line":"        self.context.user_id \u003d \u0027fake\u0027"},{"line_number":5595,"context_line":"        self.context.project_id \u003d \u0027fake\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a50d1a3_9976d3d5","line":5592,"in_reply_to":"3a50d1a3_ed15e3e4","updated":"2015-07-22 13:00:43.000000000","message":"Hi Vincent,\n\nI actually changed this to use mock in another patch that is dependent on this patch. I\u0027d like to keep it there if that is okay with you.\n\nhttps://review.openstack.org/#/c/198556/10/cinder/tests/unit/test_volume.py","commit_id":"c720e6e8d661b80ca1efc4c2ef10bdca918496cc"}],"cinder/volume/driver.py":[{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"ef1d9a39e101b04428cdf4d290df6c146696b5e5","unresolved":false,"context_lines":[{"line_number":214,"context_line":"    cfg.BoolOpt(\u0027driver_ssl_cert_verify\u0027,"},{"line_number":215,"context_line":"                default\u003dFalse,"},{"line_number":216,"context_line":"                help\u003d\u0027If set to True the http client will validate the SSL \u0027"},{"line_number":217,"context_line":"                     \u0027certificate of the backend endpoint.\u0027),"},{"line_number":218,"context_line":"]"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"# for backward compatibility"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_e9fbf445","side":"PARENT","line":217,"updated":"2015-06-22 08:01:58.000000000","message":"Rebase will add this back in I hope.","commit_id":"a874f951830e35a2a9080f51e992476e6ebfcd49"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"b52e4f8f86bff8eead0050ee12202dff6008087e","unresolved":false,"context_lines":[{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        # NOTE(xyang): Check volume status; if not \u0027available\u0027, create a"},{"line_number":752,"context_line":"        # a temp volume from the volume, and backup the temp volume, and"},{"line_number":753,"context_line":"        # then clean up the temp volume; if \u0027available\u0027, just backup the"},{"line_number":754,"context_line":"        # volume."},{"line_number":755,"context_line":"        temp_vol_ref \u003d None"},{"line_number":756,"context_line":"        if volume[\u0027status\u0027] !\u003d \"available\":"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa32b979_4f0775c9","line":753,"updated":"2015-06-27 13:38:47.000000000","message":"I wonder if we should also consider doing this for available volumes. Once someone starts a backup of an available volume it will block that volume from being used until the backup completes.\n\nProbably a very small issue, but maybe something to think about for the future.","commit_id":"965ed7cf0330e91229112b3e22ee7d4c1189b321"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"8f355e3066641d14d1ecbb717f9fac6c6f20ee4a","unresolved":false,"context_lines":[{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        # NOTE(xyang): Check volume status; if not \u0027available\u0027, create a"},{"line_number":752,"context_line":"        # a temp volume from the volume, and backup the temp volume, and"},{"line_number":753,"context_line":"        # then clean up the temp volume; if \u0027available\u0027, just backup the"},{"line_number":754,"context_line":"        # volume."},{"line_number":755,"context_line":"        temp_vol_ref \u003d None"},{"line_number":756,"context_line":"        if volume[\u0027status\u0027] !\u003d \"available\":"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa32b979_2159e535","line":753,"in_reply_to":"fa32b979_4f0775c9","updated":"2015-06-27 14:57:15.000000000","message":"That is a possibility. We can think about it while this one is being worked on.  If everyone likes this idea, we can do it as a future patch after this one gets merged.","commit_id":"965ed7cf0330e91229112b3e22ee7d4c1189b321"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"368876fd211e3f4c5286a1dc4df0cbe78a138752","unresolved":false,"context_lines":[{"line_number":753,"context_line":"        # then clean up the temp volume; if \u0027available\u0027, just backup the"},{"line_number":754,"context_line":"        # volume."},{"line_number":755,"context_line":"        temp_vol_ref \u003d None"},{"line_number":756,"context_line":"        if volume[\u0027status\u0027] !\u003d \"available\":"},{"line_number":757,"context_line":"            temp_vol_ref \u003d self._create_temp_cloned_volume("},{"line_number":758,"context_line":"                context, volume)"},{"line_number":759,"context_line":"            volume \u003d temp_vol_ref"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_8b0899db","line":756,"updated":"2015-07-02 13:13:20.000000000","message":"I think this needs to be a more explicit list of safe states - we don\u0027t want to get here and find it in error, or deleting...","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"759db109465a0b58a050f1499c3b13b8759463be","unresolved":false,"context_lines":[{"line_number":753,"context_line":"        # then clean up the temp volume; if \u0027available\u0027, just backup the"},{"line_number":754,"context_line":"        # volume."},{"line_number":755,"context_line":"        temp_vol_ref \u003d None"},{"line_number":756,"context_line":"        if volume[\u0027status\u0027] !\u003d \"available\":"},{"line_number":757,"context_line":"            temp_vol_ref \u003d self._create_temp_cloned_volume("},{"line_number":758,"context_line":"                context, volume)"},{"line_number":759,"context_line":"            volume \u003d temp_vol_ref"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_9d77779f","line":756,"in_reply_to":"ba3cc151_8b0899db","updated":"2015-07-02 14:46:34.000000000","message":"Sure, I\u0027ll add status validation here.","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"d4e0ad348ad3805050189ff0107c36fec294cbeb","unresolved":false,"context_lines":[{"line_number":753,"context_line":"        # then clean up the temp volume; if \u0027available\u0027, just backup the"},{"line_number":754,"context_line":"        # volume."},{"line_number":755,"context_line":"        temp_vol_ref \u003d None"},{"line_number":756,"context_line":"        if volume[\u0027status\u0027] !\u003d \"available\":"},{"line_number":757,"context_line":"            temp_vol_ref \u003d self._create_temp_cloned_volume("},{"line_number":758,"context_line":"                context, volume)"},{"line_number":759,"context_line":"            volume \u003d temp_vol_ref"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_2d7701a1","line":756,"in_reply_to":"ba3cc151_9d77779f","updated":"2015-07-04 03:45:00.000000000","message":"I should be checking against the orig_status rather than the current volume status which is backing-up. Pass orig_status in and check if it is in-use.","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"368876fd211e3f4c5286a1dc4df0cbe78a138752","unresolved":false,"context_lines":[{"line_number":754,"context_line":"        # volume."},{"line_number":755,"context_line":"        temp_vol_ref \u003d None"},{"line_number":756,"context_line":"        if volume[\u0027status\u0027] !\u003d \"available\":"},{"line_number":757,"context_line":"            temp_vol_ref \u003d self._create_temp_cloned_volume("},{"line_number":758,"context_line":"                context, volume)"},{"line_number":759,"context_line":"            volume \u003d temp_vol_ref"},{"line_number":760,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_cb19c123","line":757,"updated":"2015-07-02 13:13:20.000000000","message":"Do we persist this anywhere? Of al the operations likely to get interrupted, backup is most likely, so we need to be able to clean up later - having a reference persisted is needed for that. I\u0027d suggest adding it to the backups table.","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"d4e0ad348ad3805050189ff0107c36fec294cbeb","unresolved":false,"context_lines":[{"line_number":754,"context_line":"        # volume."},{"line_number":755,"context_line":"        temp_vol_ref \u003d None"},{"line_number":756,"context_line":"        if volume[\u0027status\u0027] !\u003d \"available\":"},{"line_number":757,"context_line":"            temp_vol_ref \u003d self._create_temp_cloned_volume("},{"line_number":758,"context_line":"                context, volume)"},{"line_number":759,"context_line":"            volume \u003d temp_vol_ref"},{"line_number":760,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_87dcc575","line":757,"in_reply_to":"ba3cc151_9d85375b","updated":"2015-07-04 03:45:00.000000000","message":"Added to backup table. Also added a cleanup step at start up.","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"759db109465a0b58a050f1499c3b13b8759463be","unresolved":false,"context_lines":[{"line_number":754,"context_line":"        # volume."},{"line_number":755,"context_line":"        temp_vol_ref \u003d None"},{"line_number":756,"context_line":"        if volume[\u0027status\u0027] !\u003d \"available\":"},{"line_number":757,"context_line":"            temp_vol_ref \u003d self._create_temp_cloned_volume("},{"line_number":758,"context_line":"                context, volume)"},{"line_number":759,"context_line":"            volume \u003d temp_vol_ref"},{"line_number":760,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_9d85375b","line":757,"in_reply_to":"ba3cc151_cb19c123","updated":"2015-07-02 14:46:34.000000000","message":"Sure. Will add the temp volume id to the table and add a clean up routine at service start up time.","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"368876fd211e3f4c5286a1dc4df0cbe78a138752","unresolved":false,"context_lines":[{"line_number":845,"context_line":"            \u0027project_id\u0027: context.project_id,"},{"line_number":846,"context_line":"            \u0027status\u0027: \u0027creating\u0027,"},{"line_number":847,"context_line":"        }"},{"line_number":848,"context_line":"        temp_vol_ref \u003d self.db.volume_create(context, temp_volume)"},{"line_number":849,"context_line":"        self.create_cloned_volume(temp_vol_ref, volume)"},{"line_number":850,"context_line":"        self.db.volume_update(context, temp_vol_ref[\u0027id\u0027],"},{"line_number":851,"context_line":"                              {\u0027status\u0027: \u0027available\u0027})"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_8ba419ba","line":848,"updated":"2015-07-02 13:13:20.000000000","message":"So this creates the volume in the context of the current user? And the snap? Having these appear on the tenant\u0027s volume list *will* cause confusion, I thought we were going to use a special tenant for this?","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"759db109465a0b58a050f1499c3b13b8759463be","unresolved":false,"context_lines":[{"line_number":845,"context_line":"            \u0027project_id\u0027: context.project_id,"},{"line_number":846,"context_line":"            \u0027status\u0027: \u0027creating\u0027,"},{"line_number":847,"context_line":"        }"},{"line_number":848,"context_line":"        temp_vol_ref \u003d self.db.volume_create(context, temp_volume)"},{"line_number":849,"context_line":"        self.create_cloned_volume(temp_vol_ref, volume)"},{"line_number":850,"context_line":"        self.db.volume_update(context, temp_vol_ref[\u0027id\u0027],"},{"line_number":851,"context_line":"                              {\u0027status\u0027: \u0027available\u0027})"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_9da457ba","line":848,"in_reply_to":"ba3cc151_8ba419ba","updated":"2015-07-02 14:46:34.000000000","message":"I\u0027m waiting for Patrick\u0027s patch on internal tenant:\n\nhttps://review.openstack.org/#/c/195795/\n\nWhile waiting for that, I\u0027d like to at least have other issues sorted out first in the patch.","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"8a4e64ee9e7acf0e0d9012a6914da96e56d304fd","unresolved":false,"context_lines":[{"line_number":418,"context_line":"        # backup operation, there could be temporary volumes that are not"},{"line_number":419,"context_line":"        # deleted. Make sure any temporary volumes create by the backup"},{"line_number":420,"context_line":"        # job are deleted when service is started."},{"line_number":421,"context_line":"        cntx \u003d context.get_admin_context()"},{"line_number":422,"context_line":"        backups \u003d objects.BackupList.get_all_by_host(cntx, self.hostname)"},{"line_number":423,"context_line":"        for backup in backups:"},{"line_number":424,"context_line":"            if backup.temp_volume_id and backup.status \u003d\u003d \u0027creating\u0027:"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba3cc151_5d10a14e","line":421,"updated":"2015-07-06 16:33:45.000000000","message":"Why do we get it here instead of backup manager? What will be if c-vol restarted while backup is working?","commit_id":"302c254778382a34cd2f2c55b03e5b13dee68df8"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f75ed73710b66dbf99988e975e5d32d02076e6af","unresolved":false,"context_lines":[{"line_number":418,"context_line":"        # backup operation, there could be temporary volumes that are not"},{"line_number":419,"context_line":"        # deleted. Make sure any temporary volumes create by the backup"},{"line_number":420,"context_line":"        # job are deleted when service is started."},{"line_number":421,"context_line":"        cntx \u003d context.get_admin_context()"},{"line_number":422,"context_line":"        backups \u003d objects.BackupList.get_all_by_host(cntx, self.hostname)"},{"line_number":423,"context_line":"        for backup in backups:"},{"line_number":424,"context_line":"            if backup.temp_volume_id and backup.status \u003d\u003d \u0027creating\u0027:"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba3cc151_6865a5df","line":421,"in_reply_to":"ba3cc151_5d10a14e","updated":"2015-07-06 16:48:03.000000000","message":"Good point.  Will change it.","commit_id":"302c254778382a34cd2f2c55b03e5b13dee68df8"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f23f6644d27d9c62b1b6df7ca16edb667766c036","unresolved":false,"context_lines":[{"line_number":418,"context_line":"        # backup operation, there could be temporary volumes that are not"},{"line_number":419,"context_line":"        # deleted. Make sure any temporary volumes create by the backup"},{"line_number":420,"context_line":"        # job are deleted when service is started."},{"line_number":421,"context_line":"        cntx \u003d context.get_admin_context()"},{"line_number":422,"context_line":"        backups \u003d objects.BackupList.get_all_by_host(cntx, self.hostname)"},{"line_number":423,"context_line":"        for backup in backups:"},{"line_number":424,"context_line":"            if backup.temp_volume_id and backup.status \u003d\u003d \u0027creating\u0027:"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba3cc151_dc4b0c2a","line":421,"in_reply_to":"ba3cc151_6865a5df","updated":"2015-07-07 22:04:42.000000000","message":"Done","commit_id":"302c254778382a34cd2f2c55b03e5b13dee68df8"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"5014f030a212f56c02a2fc1e7200d4bb2eb9dbdd","unresolved":false,"context_lines":[{"line_number":832,"context_line":"        temp_snap_ref \u003d objects.Snapshot(context\u003dcontext, **kwargs)"},{"line_number":833,"context_line":"        temp_snap_ref.create()"},{"line_number":834,"context_line":"        temp_snap_ref \u003d objects.Snapshot.get_by_id(context,"},{"line_number":835,"context_line":"                                                   temp_snap_ref[\u0027id\u0027])"},{"line_number":836,"context_line":"        self.create_snapshot(temp_snap_ref)"},{"line_number":837,"context_line":"        temp_snap_ref.status \u003d \u0027available\u0027"},{"line_number":838,"context_line":"        temp_snap_ref.save()"}],"source_content_type":"text/x-python","patch_set":19,"id":"ba3cc151_d0b61688","line":835,"updated":"2015-07-09 19:43:40.000000000","message":"Do we really need to call get_by_id after create? If yes, we need to fix it in cinder objects implementation and add TODO note. It adds one more unnecessary  DB call\n\n\nHere is a conversation about it: https://review.openstack.org/#/c/200172/","commit_id":"b3c7d16ce3782ffb32ad99bec1e6248d3c7a121e"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"0ba86dd14b32d14f53cd1835a8344544df8613b2","unresolved":false,"context_lines":[{"line_number":832,"context_line":"        temp_snap_ref \u003d objects.Snapshot(context\u003dcontext, **kwargs)"},{"line_number":833,"context_line":"        temp_snap_ref.create()"},{"line_number":834,"context_line":"        temp_snap_ref \u003d objects.Snapshot.get_by_id(context,"},{"line_number":835,"context_line":"                                                   temp_snap_ref[\u0027id\u0027])"},{"line_number":836,"context_line":"        self.create_snapshot(temp_snap_ref)"},{"line_number":837,"context_line":"        temp_snap_ref.status \u003d \u0027available\u0027"},{"line_number":838,"context_line":"        temp_snap_ref.save()"}],"source_content_type":"text/x-python","patch_set":19,"id":"ba3cc151_a332fdf0","line":835,"in_reply_to":"ba3cc151_1d6016ce","updated":"2015-07-10 16:46:14.000000000","message":"Which fields are missing on create() that needs to be refreshed through another bet_by_id?","commit_id":"b3c7d16ce3782ffb32ad99bec1e6248d3c7a121e"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"d6c27ecc968d6b91cd69236f239002974a4f8f38","unresolved":false,"context_lines":[{"line_number":832,"context_line":"        temp_snap_ref \u003d objects.Snapshot(context\u003dcontext, **kwargs)"},{"line_number":833,"context_line":"        temp_snap_ref.create()"},{"line_number":834,"context_line":"        temp_snap_ref \u003d objects.Snapshot.get_by_id(context,"},{"line_number":835,"context_line":"                                                   temp_snap_ref[\u0027id\u0027])"},{"line_number":836,"context_line":"        self.create_snapshot(temp_snap_ref)"},{"line_number":837,"context_line":"        temp_snap_ref.status \u003d \u0027available\u0027"},{"line_number":838,"context_line":"        temp_snap_ref.save()"}],"source_content_type":"text/x-python","patch_set":19,"id":"ba3cc151_1d6016ce","line":835,"in_reply_to":"ba3cc151_d0b61688","updated":"2015-07-09 20:05:36.000000000","message":"Sounds like I need to wait for your fix to merge and then get rid of this call once create() returns the object?","commit_id":"b3c7d16ce3782ffb32ad99bec1e6248d3c7a121e"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"5014f030a212f56c02a2fc1e7200d4bb2eb9dbdd","unresolved":false,"context_lines":[{"line_number":858,"context_line":"    def _delete_snapshot(self, context, snapshot):"},{"line_number":859,"context_line":"        self.delete_snapshot(snapshot)"},{"line_number":860,"context_line":"        context \u003d context.elevated()"},{"line_number":861,"context_line":"        snapshot._context \u003d context"},{"line_number":862,"context_line":"        self.db.volume_glance_metadata_delete_by_snapshot("},{"line_number":863,"context_line":"            context, snapshot.id)"},{"line_number":864,"context_line":"        snapshot.destroy()"}],"source_content_type":"text/x-python","patch_set":19,"id":"ba3cc151_ab5447fd","line":861,"updated":"2015-07-09 19:43:40.000000000","message":"Please, use snapshot.obj_as_admin context manager here","commit_id":"b3c7d16ce3782ffb32ad99bec1e6248d3c7a121e"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"ffae87794e4633292f1ed9807a0d9ccdf6794108","unresolved":false,"context_lines":[{"line_number":858,"context_line":"    def _delete_snapshot(self, context, snapshot):"},{"line_number":859,"context_line":"        self.delete_snapshot(snapshot)"},{"line_number":860,"context_line":"        context \u003d context.elevated()"},{"line_number":861,"context_line":"        snapshot._context \u003d context"},{"line_number":862,"context_line":"        self.db.volume_glance_metadata_delete_by_snapshot("},{"line_number":863,"context_line":"            context, snapshot.id)"},{"line_number":864,"context_line":"        snapshot.destroy()"}],"source_content_type":"text/x-python","patch_set":19,"id":"ba3cc151_107690d8","line":861,"in_reply_to":"ba3cc151_1d3256f2","updated":"2015-07-10 15:50:06.000000000","message":"with snapshot.obj_as_admin():\n    self.db.volume_glance_metadata_delete_by_snapshot(\n        context, snapshot.id)\n    snapshot.destroy()","commit_id":"b3c7d16ce3782ffb32ad99bec1e6248d3c7a121e"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"d6c27ecc968d6b91cd69236f239002974a4f8f38","unresolved":false,"context_lines":[{"line_number":858,"context_line":"    def _delete_snapshot(self, context, snapshot):"},{"line_number":859,"context_line":"        self.delete_snapshot(snapshot)"},{"line_number":860,"context_line":"        context \u003d context.elevated()"},{"line_number":861,"context_line":"        snapshot._context \u003d context"},{"line_number":862,"context_line":"        self.db.volume_glance_metadata_delete_by_snapshot("},{"line_number":863,"context_line":"            context, snapshot.id)"},{"line_number":864,"context_line":"        snapshot.destroy()"}],"source_content_type":"text/x-python","patch_set":19,"id":"ba3cc151_1d3256f2","line":861,"in_reply_to":"ba3cc151_ab5447fd","updated":"2015-07-09 20:05:36.000000000","message":"You mean\n\nsnapshot._context \u003d snapshot.obj_as_admin?","commit_id":"b3c7d16ce3782ffb32ad99bec1e6248d3c7a121e"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"03559d60f18775dd28a06c806223e9d6d81b0cdb","unresolved":false,"context_lines":[{"line_number":853,"context_line":"            \u0027status\u0027: \u0027creating\u0027,"},{"line_number":854,"context_line":"        }"},{"line_number":855,"context_line":"        temp_vol_ref \u003d self.db.volume_create(context, temp_volume)"},{"line_number":856,"context_line":"        self.create_cloned_volume(temp_vol_ref, volume)"},{"line_number":857,"context_line":"        self.db.volume_update(context, temp_vol_ref[\u0027id\u0027],"},{"line_number":858,"context_line":"                              {\u0027status\u0027: \u0027available\u0027})"},{"line_number":859,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"9a41bdd9_657bd9be","line":856,"updated":"2015-07-16 09:05:17.000000000","message":"Xing, should we consider the case that create_cloned_volume fails here? \nIf doing nothing, the item is kept in db, and it will be listed in \"cinder list\" with status as creating, and can\u0027t be deleted.","commit_id":"031518f07edaf504eb9089bd3753c0a8dcd36c98"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f8b5a936939ca7c24364cb525a65796dff026df4","unresolved":false,"context_lines":[{"line_number":853,"context_line":"            \u0027status\u0027: \u0027creating\u0027,"},{"line_number":854,"context_line":"        }"},{"line_number":855,"context_line":"        temp_vol_ref \u003d self.db.volume_create(context, temp_volume)"},{"line_number":856,"context_line":"        self.create_cloned_volume(temp_vol_ref, volume)"},{"line_number":857,"context_line":"        self.db.volume_update(context, temp_vol_ref[\u0027id\u0027],"},{"line_number":858,"context_line":"                              {\u0027status\u0027: \u0027available\u0027})"},{"line_number":859,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"9a41bdd9_81c3518a","line":856,"in_reply_to":"9a41bdd9_657bd9be","updated":"2015-07-17 01:47:25.000000000","message":"Yes. I have cleanup logic in backup/manager.py, but should also set the volume status to available before deleting.  I\u0027ll change that.","commit_id":"031518f07edaf504eb9089bd3753c0a8dcd36c98"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"dac1c37b5d71b69aa65f6eb49c6ffbd52d9730d1","unresolved":false,"context_lines":[{"line_number":853,"context_line":"            \u0027status\u0027: \u0027creating\u0027,"},{"line_number":854,"context_line":"        }"},{"line_number":855,"context_line":"        temp_vol_ref \u003d self.db.volume_create(context, temp_volume)"},{"line_number":856,"context_line":"        self.create_cloned_volume(temp_vol_ref, volume)"},{"line_number":857,"context_line":"        self.db.volume_update(context, temp_vol_ref[\u0027id\u0027],"},{"line_number":858,"context_line":"                              {\u0027status\u0027: \u0027available\u0027})"},{"line_number":859,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"9a41bdd9_bba9cb26","line":856,"in_reply_to":"9a41bdd9_81c3518a","updated":"2015-07-17 03:38:59.000000000","message":"If I understand it correctly, the cleanup in backup/manager.py is triggered when the service restarts. \nIf service does not restart, here create_cloned_volume fails as some problems in backend storeage, how is the volume deleted?\nHow about here we catch the exception, and delete the db entry?","commit_id":"031518f07edaf504eb9089bd3753c0a8dcd36c98"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"355855b1f0f45d67e0f85004964d891164f42db8","unresolved":false,"context_lines":[{"line_number":853,"context_line":"            \u0027status\u0027: \u0027creating\u0027,"},{"line_number":854,"context_line":"        }"},{"line_number":855,"context_line":"        temp_vol_ref \u003d self.db.volume_create(context, temp_volume)"},{"line_number":856,"context_line":"        self.create_cloned_volume(temp_vol_ref, volume)"},{"line_number":857,"context_line":"        self.db.volume_update(context, temp_vol_ref[\u0027id\u0027],"},{"line_number":858,"context_line":"                              {\u0027status\u0027: \u0027available\u0027})"},{"line_number":859,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"9a41bdd9_f36c1c9e","line":856,"in_reply_to":"9a41bdd9_bba9cb26","updated":"2015-07-18 15:25:33.000000000","message":"Done","commit_id":"031518f07edaf504eb9089bd3753c0a8dcd36c98"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"d29bb9a592ee2519ef76f757911f3bc9974967fe","unresolved":false,"context_lines":[{"line_number":758,"context_line":"        # a temp volume from the volume, and backup the temp volume, and"},{"line_number":759,"context_line":"        # then clean up the temp volume; if \u0027available\u0027, just backup the"},{"line_number":760,"context_line":"        # volume."},{"line_number":761,"context_line":"        previous_status \u003d volume[\u0027previous_status\u0027]"},{"line_number":762,"context_line":"        temp_vol_ref \u003d None"},{"line_number":763,"context_line":"        if previous_status \u003d\u003d \"in_use\":"},{"line_number":764,"context_line":"            temp_vol_ref \u003d self._create_temp_cloned_volume("}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_d2f560ed","line":761,"updated":"2015-07-17 23:27:38.000000000","message":"Use a get with a default?","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"020a416bf4db9887dc4dae9921303f4c37eca84a","unresolved":false,"context_lines":[{"line_number":758,"context_line":"        # a temp volume from the volume, and backup the temp volume, and"},{"line_number":759,"context_line":"        # then clean up the temp volume; if \u0027available\u0027, just backup the"},{"line_number":760,"context_line":"        # volume."},{"line_number":761,"context_line":"        previous_status \u003d volume[\u0027previous_status\u0027]"},{"line_number":762,"context_line":"        temp_vol_ref \u003d None"},{"line_number":763,"context_line":"        if previous_status \u003d\u003d \"in_use\":"},{"line_number":764,"context_line":"            temp_vol_ref \u003d self._create_temp_cloned_volume("}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_97c57d3e","line":761,"in_reply_to":"9a41bdd9_d2f560ed","updated":"2015-07-18 15:22:25.000000000","message":"Done","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"d29bb9a592ee2519ef76f757911f3bc9974967fe","unresolved":false,"context_lines":[{"line_number":821,"context_line":"        finally:"},{"line_number":822,"context_line":"            self._detach_volume(context, attach_info, volume, properties)"},{"line_number":823,"context_line":""},{"line_number":824,"context_line":"    def _create_temp_snapshot(self, context, volume):"},{"line_number":825,"context_line":"        kwargs \u003d {"},{"line_number":826,"context_line":"            \u0027volume_id\u0027: volume[\u0027id\u0027],"},{"line_number":827,"context_line":"            \u0027cgsnapshot_id\u0027: None,"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_d2b6c0f8","line":824,"updated":"2015-07-17 23:27:38.000000000","message":"Not quite sure about this being in the base driver like this with only LVM using it, but certainly realize that others are likely to pick it up. I\u0027m wondering if it is actually something worth promoting (ie remove the _) and make it *public* so to speak.\n\nFWIW, part of my thinking here is I had an idea this morning of making a truly abstract base class with no real impls in it.  It would clear up a lot of the debates/issues about abc, required methods etc etc; just add a abstract_driver, then driver on top of it.\n\nAnyway, it doesn\u0027t matter for this patch at all, but just pointing out that we\u0027ve got a mish-mash of implemented/not-implemented and abstract/not-abstract going on in the base, we could easily clean that up.  One of the things that is annoying IMHO is *private* designations on methods in base classes that are only used from concrete classes which is why I bring this random babbling up.","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"020a416bf4db9887dc4dae9921303f4c37eca84a","unresolved":false,"context_lines":[{"line_number":821,"context_line":"        finally:"},{"line_number":822,"context_line":"            self._detach_volume(context, attach_info, volume, properties)"},{"line_number":823,"context_line":""},{"line_number":824,"context_line":"    def _create_temp_snapshot(self, context, volume):"},{"line_number":825,"context_line":"        kwargs \u003d {"},{"line_number":826,"context_line":"            \u0027volume_id\u0027: volume[\u0027id\u0027],"},{"line_number":827,"context_line":"            \u0027cgsnapshot_id\u0027: None,"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_77d1d9fa","line":824,"in_reply_to":"9a41bdd9_d2b6c0f8","updated":"2015-07-18 15:22:25.000000000","message":"Sure. Let me know whether you want me to remove _.  I would hope more drivers will be able to use this in the future.","commit_id":"c5f88bd94c17d1b1ef6527a9c49355065814a205"}],"cinder/volume/drivers/lvm.py":[{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"368876fd211e3f4c5286a1dc4df0cbe78a138752","unresolved":false,"context_lines":[{"line_number":434,"context_line":"        \"\"\"Create a new backup from an existing volume.\"\"\""},{"line_number":435,"context_line":"        volume \u003d self.db.volume_get(context, backup[\u0027volume_id\u0027])"},{"line_number":436,"context_line":"        temp_snapshot \u003d None"},{"line_number":437,"context_line":"        if volume[\u0027status\u0027] !\u003d \u0027available\u0027:"},{"line_number":438,"context_line":"            temp_snapshot \u003d self._create_temp_snapshot(context, volume)"},{"line_number":439,"context_line":"            volume_path \u003d self.local_path(temp_snapshot)"},{"line_number":440,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_4b8131fa","line":437,"updated":"2015-07-02 13:13:20.000000000","message":"See other note.... we need to avoid error, deleting, ...","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"759db109465a0b58a050f1499c3b13b8759463be","unresolved":false,"context_lines":[{"line_number":434,"context_line":"        \"\"\"Create a new backup from an existing volume.\"\"\""},{"line_number":435,"context_line":"        volume \u003d self.db.volume_get(context, backup[\u0027volume_id\u0027])"},{"line_number":436,"context_line":"        temp_snapshot \u003d None"},{"line_number":437,"context_line":"        if volume[\u0027status\u0027] !\u003d \u0027available\u0027:"},{"line_number":438,"context_line":"            temp_snapshot \u003d self._create_temp_snapshot(context, volume)"},{"line_number":439,"context_line":"            volume_path \u003d self.local_path(temp_snapshot)"},{"line_number":440,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_9d077781","line":437,"in_reply_to":"ba3cc151_4b8131fa","updated":"2015-07-02 14:46:34.000000000","message":"Sure.","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"d4e0ad348ad3805050189ff0107c36fec294cbeb","unresolved":false,"context_lines":[{"line_number":434,"context_line":"        \"\"\"Create a new backup from an existing volume.\"\"\""},{"line_number":435,"context_line":"        volume \u003d self.db.volume_get(context, backup[\u0027volume_id\u0027])"},{"line_number":436,"context_line":"        temp_snapshot \u003d None"},{"line_number":437,"context_line":"        if volume[\u0027status\u0027] !\u003d \u0027available\u0027:"},{"line_number":438,"context_line":"            temp_snapshot \u003d self._create_temp_snapshot(context, volume)"},{"line_number":439,"context_line":"            volume_path \u003d self.local_path(temp_snapshot)"},{"line_number":440,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba3cc151_474a3d57","line":437,"in_reply_to":"ba3cc151_9d077781","updated":"2015-07-04 03:45:00.000000000","message":"Checking is equal to \u0027in-use\u0027 now.","commit_id":"65599eefcac0b36a0530b9afeb14251513db7bd1"}]}
