)]}'
{"cinder/api/v2/volumes.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"969f69e504cd0487b6cf0315d909d6909d6bbfa4","unresolved":false,"context_lines":[{"line_number":359,"context_line":"        kwargs[\u0027consistencygroup_id\u0027] \u003d volume.get(\u0027consistencygroup_id\u0027, None)"},{"line_number":360,"context_line":""},{"line_number":361,"context_line":"        size \u003d volume.get(\u0027size\u0027, None)"},{"line_number":362,"context_line":"        snapshot \u003d self._get_snapshot_by_id_without_exception("},{"line_number":363,"context_line":"            context, kwargs[\u0027snapshot_id\u0027])"},{"line_number":364,"context_line":"        source_volume \u003d self._get_volume_by_id_without_exception("},{"line_number":365,"context_line":"            context, kwargs[\u0027source_volume_id\u0027])"},{"line_number":366,"context_line":"        source_replica \u003d self._get_volume_by_id_without_exception("},{"line_number":367,"context_line":"            context, kwargs[\u0027source_replica_id\u0027])"},{"line_number":368,"context_line":"        if size is None and snapshot is not None:"},{"line_number":369,"context_line":"            size \u003d snapshot[\u0027volume_size\u0027]"},{"line_number":370,"context_line":"        elif size is None and source_volume is not None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_e2ce82b3","line":367,"range":{"start_line":362,"start_character":0,"end_line":367,"end_character":49},"updated":"2016-03-11 11:48:51.000000000","message":"I think I understand what you were planning to do, but why silence these exceptions? We\u0027re making these DB calls anyway, and these resources won\u0027t magically reappear.","commit_id":"72a3300f849c0fa026b9cbf91b36ebcc76561c16"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"969f69e504cd0487b6cf0315d909d6909d6bbfa4","unresolved":false,"context_lines":[{"line_number":364,"context_line":"        source_volume \u003d self._get_volume_by_id_without_exception("},{"line_number":365,"context_line":"            context, kwargs[\u0027source_volume_id\u0027])"},{"line_number":366,"context_line":"        source_replica \u003d self._get_volume_by_id_without_exception("},{"line_number":367,"context_line":"            context, kwargs[\u0027source_replica_id\u0027])"},{"line_number":368,"context_line":"        if size is None and snapshot is not None:"},{"line_number":369,"context_line":"            size \u003d snapshot[\u0027volume_size\u0027]"},{"line_number":370,"context_line":"        elif size is None and source_volume is not None:"},{"line_number":371,"context_line":"            size \u003d source_volume[\u0027size\u0027]"},{"line_number":372,"context_line":"        elif size is None and source_replica is not None:"},{"line_number":373,"context_line":"            size \u003d source_replica[\u0027size\u0027]"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"        LOG.info(_LI(\"Create volume of %s GB\"), size, context\u003dcontext)"},{"line_number":376,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_4220164a","line":373,"range":{"start_line":367,"start_character":49,"end_line":373,"end_character":41},"updated":"2016-03-11 11:48:51.000000000","message":"I guess there\u0027s a reason to get size here, but I would retake a look on moving that into the taskflow\u0027s flow.","commit_id":"72a3300f849c0fa026b9cbf91b36ebcc76561c16"}],"cinder/volume/api.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"969f69e504cd0487b6cf0315d909d6909d6bbfa4","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        LOG.info(_LI(\"Availability Zones retrieved successfully.\"))"},{"line_number":195,"context_line":"        return tuple(azs)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _retype_is_possible(self, context,"},{"line_number":198,"context_line":"                            first_type_id, second_type_id,"},{"line_number":199,"context_line":"                            first_type\u003dNone, second_type\u003dNone):"},{"line_number":200,"context_line":"        safe \u003d False"},{"line_number":201,"context_line":"        elevated \u003d context.elevated()"},{"line_number":202,"context_line":"        services \u003d objects.ServiceList.get_all_by_topic(elevated,"},{"line_number":203,"context_line":"                                                        \u0027cinder-volume\u0027,"},{"line_number":204,"context_line":"                                                        disabled\u003dTrue)"},{"line_number":205,"context_line":"        if len(services.objects) \u003d\u003d 1:"},{"line_number":206,"context_line":"            safe \u003d True"},{"line_number":207,"context_line":"        else:"},{"line_number":208,"context_line":"            type_a \u003d first_type or volume_types.get_volume_type("},{"line_number":209,"context_line":"                elevated,"},{"line_number":210,"context_line":"                first_type_id)"},{"line_number":211,"context_line":"            type_b \u003d second_type or volume_types.get_volume_type("},{"line_number":212,"context_line":"                elevated,"},{"line_number":213,"context_line":"                second_type_id)"},{"line_number":214,"context_line":"            if (volume_utils.matching_backend_name(type_a[\u0027extra_specs\u0027],"},{"line_number":215,"context_line":"                                                   type_b[\u0027extra_specs\u0027])):"},{"line_number":216,"context_line":"                safe \u003d True"},{"line_number":217,"context_line":"        return safe"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def _is_volume_migrating(self, volume):"},{"line_number":220,"context_line":"        # The migration status \u0027none\u0027 means no migration has ever been done"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_423f7625","line":217,"range":{"start_line":197,"start_character":0,"end_line":217,"end_character":19},"updated":"2016-03-11 11:48:51.000000000","message":"Looking at [1] it looks like the constraints on the possibility of operation retype are stronger than simple matching backend name. And it looks like these can be implemented in the DB (as gegulieo already did in that patch).\n\n[1] https://review.openstack.org/#/c/221442/","commit_id":"72a3300f849c0fa026b9cbf91b36ebcc76561c16"}],"cinder/volume/flows/api/create_volume.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"969f69e504cd0487b6cf0315d909d6909d6bbfa4","unresolved":false,"context_lines":[{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        # Merge in the other required arguments which should provide the rest"},{"line_number":446,"context_line":"        # of the volume property fields (if applicable)."},{"line_number":447,"context_line":"        # volume_properties.update(kwargs)"},{"line_number":448,"context_line":"        volume \u003d objects.Volume(context\u003dcontext, **volume_properties)"},{"line_number":449,"context_line":"        volume.create()"},{"line_number":450,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_4202d63f","line":447,"range":{"start_line":447,"start_character":0,"end_line":447,"end_character":42},"updated":"2016-03-11 11:48:51.000000000","message":"Leftover?","commit_id":"72a3300f849c0fa026b9cbf91b36ebcc76561c16"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"969f69e504cd0487b6cf0315d909d6909d6bbfa4","unresolved":false,"context_lines":[{"line_number":509,"context_line":"                                        encryption_from_snap_case)],"},{"line_number":510,"context_line":"                                      else_\u003dNone)"},{"line_number":511,"context_line":""},{"line_number":512,"context_line":"        expected \u003d {"},{"line_number":513,"context_line":"            \u0027snapshot_id\u0027: snapshot_case,"},{"line_number":514,"context_line":"            \u0027volume_type_id\u0027: source_replica_with_volume_type_case,"},{"line_number":515,"context_line":"            \u0027source_volid\u0027: source_volume_case or source_replica_case,"},{"line_number":516,"context_line":"            \u0027consistency_group_id\u0027: cgroup_case,"},{"line_number":517,"context_line":"            \u0027encryption_key_id\u0027: encryption_case,"},{"line_number":518,"context_line":"        }"},{"line_number":519,"context_line":""},{"line_number":520,"context_line":"        if not volume.conditional_update(kwargs, expected):"},{"line_number":521,"context_line":"            msg \u003d _(\u0027Cannot create volume. Some values are invalid\u0027) % expected"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_c5871011","line":518,"range":{"start_line":512,"start_character":0,"end_line":518,"end_character":9},"updated":"2016-03-11 11:48:51.000000000","message":"I don\u0027t think these \"*_case\" should go into expected in this form. That would mean for example that we expect that if snapshot exists, then volume.snapshot_id is equal to it, but if snapshot was removed before we called conditional update, then we\u0027re expecting None there.\n\nThese kinds of conditions should go into filters argument of conditional_update method. To fulfill such logic:\n\nIf user is creating a volume from snapshot (snapshot_id is not None), then when we create the volume snapshot should still exist. This would be something like:\n\n filters \u003d []\n if snapshot_id:\n     filters.append(\n         sql.exists().where(models.Snapshot.id \u003d\u003d snapshot_id)\n\n if volume_type_id:\n    filters.append(\n         sql.exists().where(models.VolumeType.id \u003d\u003d volume_type_id)\n\nAnd so on.","commit_id":"72a3300f849c0fa026b9cbf91b36ebcc76561c16"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"969f69e504cd0487b6cf0315d909d6909d6bbfa4","unresolved":false,"context_lines":[{"line_number":517,"context_line":"            \u0027encryption_key_id\u0027: encryption_case,"},{"line_number":518,"context_line":"        }"},{"line_number":519,"context_line":""},{"line_number":520,"context_line":"        if not volume.conditional_update(kwargs, expected):"},{"line_number":521,"context_line":"            msg \u003d _(\u0027Cannot create volume. Some values are invalid\u0027) % expected"},{"line_number":522,"context_line":"            LOG.error(msg)"},{"line_number":523,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_25ceb45a","line":520,"range":{"start_line":520,"start_character":41,"end_line":520,"end_character":47},"updated":"2016-03-11 11:48:51.000000000","message":"kwargs can accept SQL expressions. You should be able to build an expression that will for example take the size from the correct resource.\n\nYou\u0027re not leveraging this ability.","commit_id":"72a3300f849c0fa026b9cbf91b36ebcc76561c16"}]}
