)]}'
{"cinder/volume/api.py":[{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b9b2338802e37e0bc6a9e9f3e2f808eb32027020","unresolved":false,"context_lines":[{"line_number":744,"context_line":"    def detach(self, context, volume, attachment_id):"},{"line_number":745,"context_line":"        context.authorize(vol_action_policy.DETACH_POLICY,"},{"line_number":746,"context_line":"                          target_obj\u003dvolume)"},{"line_number":747,"context_line":"        if volume[\u0027attach_status\u0027] !\u003d \u0027attached\u0027:"},{"line_number":748,"context_line":"            LOG.info(\u0027Unable to detach volume, \u0027"},{"line_number":749,"context_line":"                     \u0027because it is not attached.\u0027, resource\u003dvolume)"},{"line_number":750,"context_line":"            msg \u003d _(\"Unable to detach volume. \""},{"line_number":751,"context_line":"                    \"attach_status must be \u0027attached\u0027 to detach\")"},{"line_number":752,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":753,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \u0027maintenance\u0027:"},{"line_number":754,"context_line":"            LOG.info(\u0027Unable to detach volume, \u0027"},{"line_number":755,"context_line":"                     \u0027because it is in maintenance.\u0027, resource\u003dvolume)"}],"source_content_type":"text/x-python","patch_set":1,"id":"df87a7cf_a1e29e9f","line":752,"range":{"start_line":747,"start_character":8,"end_line":752,"end_character":53},"updated":"2017-12-12 21:03:11.000000000","message":"We handle this now in volume/manager.py here: https://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L1271-L1305\n\nThis got fixed in this review: https://review.openstack.org/#/c/212193/\n\nFor consumers who rely on the full flow the begin_detaching call above in line 686 also takes care of this status check in advance.","commit_id":"54f6880f8fe0fea6727f2c52f5976af1f71f257d"}]}
