)]}'
{"cinder/api/contrib/hosts.py":[{"author":{"_account_id":23081,"name":"Jeremy Zhang","email":"zhangjun_inspur@163.com","username":"jeremy.zhang"},"change_message_id":"b42fe248df468cc5c2b549aef92eb7d4f389af85","unresolved":false,"context_lines":[{"line_number":135,"context_line":""},{"line_number":136,"context_line":"        :param req: security context"},{"line_number":137,"context_line":"        :param id: hostname"},{"line_number":138,"context_line":"        :returns: expected to use HostShowTemplate."},{"line_number":139,"context_line":"            ex.::"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"                {\u0027host\u0027: {\u0027resource\u0027:D},..}"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_3d0e93e5","line":138,"range":{"start_line":138,"start_character":18,"end_line":138,"end_character":50},"updated":"2017-06-29 06:56:16.000000000","message":"HostShowTemplate is not found in Cinder project, maybe can be described in another way.","commit_id":"5916cbe471ad961a969ccc97fbb71a6ee580a6d8"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"6ddc83f728591ca587e32d09be7380c31d47ba35","unresolved":false,"context_lines":[{"line_number":135,"context_line":""},{"line_number":136,"context_line":"        :param req: security context"},{"line_number":137,"context_line":"        :param id: hostname"},{"line_number":138,"context_line":"        :returns: expected to use HostShowTemplate."},{"line_number":139,"context_line":"            ex.::"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"                {\u0027host\u0027: {\u0027resource\u0027:D},..}"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_445a412a","line":138,"range":{"start_line":138,"start_character":18,"end_line":138,"end_character":50},"in_reply_to":"3f1d235d_3d0e93e5","updated":"2017-07-03 10:00:30.000000000","message":"Done","commit_id":"5916cbe471ad961a969ccc97fbb71a6ee580a6d8"},{"author":{"_account_id":23081,"name":"Jeremy Zhang","email":"zhangjun_inspur@163.com","username":"jeremy.zhang"},"change_message_id":"b42fe248df468cc5c2b549aef92eb7d4f389af85","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        :returns: expected to use HostShowTemplate."},{"line_number":139,"context_line":"            ex.::"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"                {\u0027host\u0027: {\u0027resource\u0027:D},..}"},{"line_number":142,"context_line":"                D: {\u0027host\u0027: \u0027hostname\u0027,\u0027project\u0027: \u0027admin\u0027,"},{"line_number":143,"context_line":"                    \u0027volume_count\u0027: 1, \u0027total_volume_gb\u0027: 2048}"},{"line_number":144,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_fa2381bd","line":141,"range":{"start_line":141,"start_character":16,"end_line":141,"end_character":43},"updated":"2017-06-29 06:56:16.000000000","message":"change to {\u0027host\u0027: [{\u0027resource\u0027: D},..]}","commit_id":"5916cbe471ad961a969ccc97fbb71a6ee580a6d8"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"6ddc83f728591ca587e32d09be7380c31d47ba35","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        :returns: expected to use HostShowTemplate."},{"line_number":139,"context_line":"            ex.::"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"                {\u0027host\u0027: {\u0027resource\u0027:D},..}"},{"line_number":142,"context_line":"                D: {\u0027host\u0027: \u0027hostname\u0027,\u0027project\u0027: \u0027admin\u0027,"},{"line_number":143,"context_line":"                    \u0027volume_count\u0027: 1, \u0027total_volume_gb\u0027: 2048}"},{"line_number":144,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_84797994","line":141,"range":{"start_line":141,"start_character":16,"end_line":141,"end_character":43},"in_reply_to":"3f1d235d_fa2381bd","updated":"2017-07-03 10:00:30.000000000","message":"Done","commit_id":"5916cbe471ad961a969ccc97fbb71a6ee580a6d8"},{"author":{"_account_id":23081,"name":"Jeremy Zhang","email":"zhangjun_inspur@163.com","username":"jeremy.zhang"},"change_message_id":"b42fe248df468cc5c2b549aef92eb7d4f389af85","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        host_ref \u003d objects.Service.get_by_host_and_topic("},{"line_number":153,"context_line":"            context, host, constants.VOLUME_TOPIC)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        # Getting total available/used resource"},{"line_number":156,"context_line":"        # TODO(jdg): Add summary info for Snapshots"},{"line_number":157,"context_line":"        volume_refs \u003d db.volume_get_all_by_host(context, host_ref.host)"},{"line_number":158,"context_line":"        (count, sum) \u003d db.volume_data_get_for_host(context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_bd34e3df","line":155,"range":{"start_line":155,"start_character":24,"end_line":155,"end_character":47},"updated":"2017-06-29 06:56:16.000000000","message":"How about change it to \u0027used resource on the host\u0027?","commit_id":"5916cbe471ad961a969ccc97fbb71a6ee580a6d8"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"6ddc83f728591ca587e32d09be7380c31d47ba35","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        host_ref \u003d objects.Service.get_by_host_and_topic("},{"line_number":153,"context_line":"            context, host, constants.VOLUME_TOPIC)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        # Getting total available/used resource"},{"line_number":156,"context_line":"        # TODO(jdg): Add summary info for Snapshots"},{"line_number":157,"context_line":"        volume_refs \u003d db.volume_get_all_by_host(context, host_ref.host)"},{"line_number":158,"context_line":"        (count, sum) \u003d db.volume_data_get_for_host(context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_e4638ddb","line":155,"range":{"start_line":155,"start_character":24,"end_line":155,"end_character":47},"in_reply_to":"3f1d235d_bd34e3df","updated":"2017-07-03 10:00:30.000000000","message":"Done","commit_id":"5916cbe471ad961a969ccc97fbb71a6ee580a6d8"},{"author":{"_account_id":23081,"name":"Jeremy Zhang","email":"zhangjun_inspur@163.com","username":"jeremy.zhang"},"change_message_id":"b42fe248df468cc5c2b549aef92eb7d4f389af85","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            context, host, constants.VOLUME_TOPIC)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        # Getting total available/used resource"},{"line_number":156,"context_line":"        # TODO(jdg): Add summary info for Snapshots"},{"line_number":157,"context_line":"        volume_refs \u003d db.volume_get_all_by_host(context, host_ref.host)"},{"line_number":158,"context_line":"        (count, sum) \u003d db.volume_data_get_for_host(context,"},{"line_number":159,"context_line":"                                                   host_ref.host)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_fa0ca143","line":156,"range":{"start_line":156,"start_character":8,"end_line":156,"end_character":51},"updated":"2017-06-29 06:56:16.000000000","message":"I think it can be removed now.","commit_id":"5916cbe471ad961a969ccc97fbb71a6ee580a6d8"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"6ddc83f728591ca587e32d09be7380c31d47ba35","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            context, host, constants.VOLUME_TOPIC)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        # Getting total available/used resource"},{"line_number":156,"context_line":"        # TODO(jdg): Add summary info for Snapshots"},{"line_number":157,"context_line":"        volume_refs \u003d db.volume_get_all_by_host(context, host_ref.host)"},{"line_number":158,"context_line":"        (count, sum) \u003d db.volume_data_get_for_host(context,"},{"line_number":159,"context_line":"                                                   host_ref.host)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_a49b55c7","line":156,"range":{"start_line":156,"start_character":8,"end_line":156,"end_character":51},"in_reply_to":"3f1d235d_fa0ca143","updated":"2017-07-03 10:00:30.000000000","message":"Done","commit_id":"5916cbe471ad961a969ccc97fbb71a6ee580a6d8"}],"cinder/db/sqlalchemy/api.py":[{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"87aab3b8a714913dd4924a3458206672ef6fa358","unresolved":false,"context_lines":[{"line_number":1578,"context_line":"    host_criteria \u003d or_(*conditions)"},{"line_number":1579,"context_line":"    criteria \u003d and_(*[host_criteria, project_id_attr \u003d\u003d project_id])"},{"line_number":1580,"context_line":""},{"line_number":1581,"context_line":"    result \u003d model_query(context,"},{"line_number":1582,"context_line":"                         func.count(models.Volume.id),"},{"line_number":1583,"context_line":"                         func.sum(models.Volume.size),"},{"line_number":1584,"context_line":"                         read_deleted\u003d\"no\").\\"},{"line_number":1585,"context_line":"        filter(criteria).\\"},{"line_number":1586,"context_line":"        first()"},{"line_number":1587,"context_line":""},{"line_number":1588,"context_line":"    return (result[0] or 0, result[1] or 0)"},{"line_number":1589,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9f436f4f_e3ef4385","line":1586,"range":{"start_line":1581,"start_character":14,"end_line":1586,"end_character":15},"updated":"2017-08-08 20:14:45.000000000","message":"Can you format this to use () instead of \\ ?","commit_id":"7541d37b331db12b3fe206fb28a4eed807995429"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d257e5fa0f975f32d7fb004b1d274c2a8514d23f","unresolved":false,"context_lines":[{"line_number":1612,"context_line":"                        read_deleted\u003d\"no\","},{"line_number":1613,"context_line":"                        session\u003dsession).\\"},{"line_number":1614,"context_line":"        filter_by(project_id\u003dproject_id)"},{"line_number":1615,"context_line":"    if host and isinstance(host, six.string_types):"},{"line_number":1616,"context_line":"        host_attr \u003d getattr(models.Volume, \u0027host\u0027)"},{"line_number":1617,"context_line":"        conditions \u003d [host_attr \u003d\u003d host,"},{"line_number":1618,"context_line":"                      host_attr.op(\u0027LIKE\u0027)(host + \u0027#%\u0027)]"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_9d8ed02b","line":1615,"range":{"start_line":1615,"start_character":0,"end_line":1615,"end_character":51},"updated":"2017-11-07 10:08:33.000000000","message":"-1: if provided host should always be a string, so there should be no need to check that it\u0027s a string, and if we do and it\u0027s not we should raise an exception.\n\nI think it would be enough to do:\n\n if host:","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":23083,"name":"TommyLike","email":"tommylikehu@gmail.com","username":"TommyLike"},"change_message_id":"5786cb02b1af8b5888ed8fd99ea333800e1aa67b","unresolved":false,"context_lines":[{"line_number":1612,"context_line":"                        read_deleted\u003d\"no\","},{"line_number":1613,"context_line":"                        session\u003dsession).\\"},{"line_number":1614,"context_line":"        filter_by(project_id\u003dproject_id)"},{"line_number":1615,"context_line":"    if host and isinstance(host, six.string_types):"},{"line_number":1616,"context_line":"        host_attr \u003d getattr(models.Volume, \u0027host\u0027)"},{"line_number":1617,"context_line":"        conditions \u003d [host_attr \u003d\u003d host,"},{"line_number":1618,"context_line":"                      host_attr.op(\u0027LIKE\u0027)(host + \u0027#%\u0027)]"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_3b3804d1","line":1615,"range":{"start_line":1615,"start_character":0,"end_line":1615,"end_character":51},"in_reply_to":"3f4b6375_9d8ed02b","updated":"2017-11-07 11:50:20.000000000","message":"Done","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d257e5fa0f975f32d7fb004b1d274c2a8514d23f","unresolved":false,"context_lines":[{"line_number":1613,"context_line":"                        session\u003dsession).\\"},{"line_number":1614,"context_line":"        filter_by(project_id\u003dproject_id)"},{"line_number":1615,"context_line":"    if host and isinstance(host, six.string_types):"},{"line_number":1616,"context_line":"        host_attr \u003d getattr(models.Volume, \u0027host\u0027)"},{"line_number":1617,"context_line":"        conditions \u003d [host_attr \u003d\u003d host,"},{"line_number":1618,"context_line":"                      host_attr.op(\u0027LIKE\u0027)(host + \u0027#%\u0027)]"},{"line_number":1619,"context_line":"        query \u003d query.filter(or_(*conditions))"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_dde8c8df","line":1616,"range":{"start_line":1616,"start_character":20,"end_line":1616,"end_character":50},"updated":"2017-11-07 10:08:33.000000000","message":"-1: models.Volume.host","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d257e5fa0f975f32d7fb004b1d274c2a8514d23f","unresolved":false,"context_lines":[{"line_number":1614,"context_line":"        filter_by(project_id\u003dproject_id)"},{"line_number":1615,"context_line":"    if host and isinstance(host, six.string_types):"},{"line_number":1616,"context_line":"        host_attr \u003d getattr(models.Volume, \u0027host\u0027)"},{"line_number":1617,"context_line":"        conditions \u003d [host_attr \u003d\u003d host,"},{"line_number":1618,"context_line":"                      host_attr.op(\u0027LIKE\u0027)(host + \u0027#%\u0027)]"},{"line_number":1619,"context_line":"        query \u003d query.filter(or_(*conditions))"},{"line_number":1620,"context_line":""},{"line_number":1621,"context_line":"    if volume_type_id:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_ddc1e84f","line":1618,"range":{"start_line":1617,"start_character":0,"end_line":1618,"end_character":56},"updated":"2017-11-07 10:08:33.000000000","message":"-1: We already have a method that handles the host logic, so we should be using that instead.","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":23083,"name":"TommyLike","email":"tommylikehu@gmail.com","username":"TommyLike"},"change_message_id":"5786cb02b1af8b5888ed8fd99ea333800e1aa67b","unresolved":false,"context_lines":[{"line_number":1614,"context_line":"        filter_by(project_id\u003dproject_id)"},{"line_number":1615,"context_line":"    if host and isinstance(host, six.string_types):"},{"line_number":1616,"context_line":"        host_attr \u003d getattr(models.Volume, \u0027host\u0027)"},{"line_number":1617,"context_line":"        conditions \u003d [host_attr \u003d\u003d host,"},{"line_number":1618,"context_line":"                      host_attr.op(\u0027LIKE\u0027)(host + \u0027#%\u0027)]"},{"line_number":1619,"context_line":"        query \u003d query.filter(or_(*conditions))"},{"line_number":1620,"context_line":""},{"line_number":1621,"context_line":"    if volume_type_id:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_5bde206d","line":1618,"range":{"start_line":1617,"start_character":0,"end_line":1618,"end_character":56},"in_reply_to":"3f4b6375_ddc1e84f","updated":"2017-11-07 11:50:20.000000000","message":"Done","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d257e5fa0f975f32d7fb004b1d274c2a8514d23f","unresolved":false,"context_lines":[{"line_number":3252,"context_line":"                        func.sum(models.Snapshot.volume_size),"},{"line_number":3253,"context_line":"                        read_deleted\u003d\"no\","},{"line_number":3254,"context_line":"                        session\u003dsession)"},{"line_number":3255,"context_line":"    has_host \u003d host and isinstance(host, six.string_types)"},{"line_number":3256,"context_line":"    if volume_type_id or has_host:"},{"line_number":3257,"context_line":"        query \u003d query.join(\u0027volume\u0027)"},{"line_number":3258,"context_line":"        if volume_type_id:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_fd74a437","line":3255,"range":{"start_line":3255,"start_character":4,"end_line":3255,"end_character":58},"updated":"2017-11-07 10:08:33.000000000","message":"-1: Same as mentioned above, we can just check `host` instead of `has_host`, so this would be unnecessary.\n\nFor example on next line we would do:\n\n if volume_type_id or host:","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":23083,"name":"TommyLike","email":"tommylikehu@gmail.com","username":"TommyLike"},"change_message_id":"5786cb02b1af8b5888ed8fd99ea333800e1aa67b","unresolved":false,"context_lines":[{"line_number":3252,"context_line":"                        func.sum(models.Snapshot.volume_size),"},{"line_number":3253,"context_line":"                        read_deleted\u003d\"no\","},{"line_number":3254,"context_line":"                        session\u003dsession)"},{"line_number":3255,"context_line":"    has_host \u003d host and isinstance(host, six.string_types)"},{"line_number":3256,"context_line":"    if volume_type_id or has_host:"},{"line_number":3257,"context_line":"        query \u003d query.join(\u0027volume\u0027)"},{"line_number":3258,"context_line":"        if volume_type_id:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_9b6db8cd","line":3255,"range":{"start_line":3255,"start_character":4,"end_line":3255,"end_character":58},"in_reply_to":"3f4b6375_fd74a437","updated":"2017-11-07 11:50:20.000000000","message":"Done","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d257e5fa0f975f32d7fb004b1d274c2a8514d23f","unresolved":false,"context_lines":[{"line_number":3259,"context_line":"            query \u003d query.filter("},{"line_number":3260,"context_line":"                models.Volume.volume_type_id \u003d\u003d volume_type_id)"},{"line_number":3261,"context_line":"        if has_host:"},{"line_number":3262,"context_line":"            host_attr \u003d getattr(models.Volume, \u0027host\u0027)"},{"line_number":3263,"context_line":"            conditions \u003d [host_attr \u003d\u003d host,"},{"line_number":3264,"context_line":"                          host_attr.op(\u0027LIKE\u0027)(host + \u0027#%\u0027)]"},{"line_number":3265,"context_line":"            query \u003d query.filter(or_(*conditions))"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_dd6fa85d","line":3262,"range":{"start_line":3262,"start_character":12,"end_line":3262,"end_character":54},"updated":"2017-11-07 10:08:33.000000000","message":"-1: models.Volume.host","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":23083,"name":"TommyLike","email":"tommylikehu@gmail.com","username":"TommyLike"},"change_message_id":"5786cb02b1af8b5888ed8fd99ea333800e1aa67b","unresolved":false,"context_lines":[{"line_number":3259,"context_line":"            query \u003d query.filter("},{"line_number":3260,"context_line":"                models.Volume.volume_type_id \u003d\u003d volume_type_id)"},{"line_number":3261,"context_line":"        if has_host:"},{"line_number":3262,"context_line":"            host_attr \u003d getattr(models.Volume, \u0027host\u0027)"},{"line_number":3263,"context_line":"            conditions \u003d [host_attr \u003d\u003d host,"},{"line_number":3264,"context_line":"                          host_attr.op(\u0027LIKE\u0027)(host + \u0027#%\u0027)]"},{"line_number":3265,"context_line":"            query \u003d query.filter(or_(*conditions))"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_7b70bca4","line":3262,"range":{"start_line":3262,"start_character":12,"end_line":3262,"end_character":54},"in_reply_to":"3f4b6375_dd6fa85d","updated":"2017-11-07 11:50:20.000000000","message":"Done","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d257e5fa0f975f32d7fb004b1d274c2a8514d23f","unresolved":false,"context_lines":[{"line_number":3259,"context_line":"            query \u003d query.filter("},{"line_number":3260,"context_line":"                models.Volume.volume_type_id \u003d\u003d volume_type_id)"},{"line_number":3261,"context_line":"        if has_host:"},{"line_number":3262,"context_line":"            host_attr \u003d getattr(models.Volume, \u0027host\u0027)"},{"line_number":3263,"context_line":"            conditions \u003d [host_attr \u003d\u003d host,"},{"line_number":3264,"context_line":"                          host_attr.op(\u0027LIKE\u0027)(host + \u0027#%\u0027)]"},{"line_number":3265,"context_line":"            query \u003d query.filter(or_(*conditions))"},{"line_number":3266,"context_line":"    result \u003d query.filter(models.Snapshot.project_id \u003d\u003d project_id).first()"},{"line_number":3267,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_bd906c44","line":3264,"range":{"start_line":3262,"start_character":54,"end_line":3264,"end_character":60},"updated":"2017-11-07 10:08:33.000000000","message":"-1: We should use the method we already have for this.","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":23083,"name":"TommyLike","email":"tommylikehu@gmail.com","username":"TommyLike"},"change_message_id":"5786cb02b1af8b5888ed8fd99ea333800e1aa67b","unresolved":false,"context_lines":[{"line_number":3259,"context_line":"            query \u003d query.filter("},{"line_number":3260,"context_line":"                models.Volume.volume_type_id \u003d\u003d volume_type_id)"},{"line_number":3261,"context_line":"        if has_host:"},{"line_number":3262,"context_line":"            host_attr \u003d getattr(models.Volume, \u0027host\u0027)"},{"line_number":3263,"context_line":"            conditions \u003d [host_attr \u003d\u003d host,"},{"line_number":3264,"context_line":"                          host_attr.op(\u0027LIKE\u0027)(host + \u0027#%\u0027)]"},{"line_number":3265,"context_line":"            query \u003d query.filter(or_(*conditions))"},{"line_number":3266,"context_line":"    result \u003d query.filter(models.Snapshot.project_id \u003d\u003d project_id).first()"},{"line_number":3267,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_7bf31c0a","line":3264,"range":{"start_line":3262,"start_character":54,"end_line":3264,"end_character":60},"in_reply_to":"3f4b6375_bd906c44","updated":"2017-11-07 11:50:20.000000000","message":"Done","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"}],"cinder/tests/unit/api/contrib/test_hosts.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d257e5fa0f975f32d7fb004b1d274c2a8514d23f","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        test_utils.create_volume(ctxt2, host\u003dhost, size\u003d1)"},{"line_number":173,"context_line":"        # This volume is not on the same host. It should not be counted."},{"line_number":174,"context_line":"        test_utils.create_volume(ctxt2, host\u003d\u0027fake_host\u0027, size\u003d1)"},{"line_number":175,"context_line":"        # Create a snapshot."},{"line_number":176,"context_line":"        test_utils.create_snapshot(ctxt1, volume_id\u003dvolume1.id)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        resp \u003d self.controller.show(self.req, host)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_9d0a5087","line":175,"range":{"start_line":175,"start_character":7,"end_line":175,"end_character":28},"updated":"2017-11-07 10:08:33.000000000","message":"nit: unnecessary comment, it\u0027s clear reading the code","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":23083,"name":"TommyLike","email":"tommylikehu@gmail.com","username":"TommyLike"},"change_message_id":"5786cb02b1af8b5888ed8fd99ea333800e1aa67b","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        test_utils.create_volume(ctxt2, host\u003dhost, size\u003d1)"},{"line_number":173,"context_line":"        # This volume is not on the same host. It should not be counted."},{"line_number":174,"context_line":"        test_utils.create_volume(ctxt2, host\u003d\u0027fake_host\u0027, size\u003d1)"},{"line_number":175,"context_line":"        # Create a snapshot."},{"line_number":176,"context_line":"        test_utils.create_snapshot(ctxt1, volume_id\u003dvolume1.id)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        resp \u003d self.controller.show(self.req, host)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_dbd3305f","line":175,"range":{"start_line":175,"start_character":7,"end_line":175,"end_character":28},"in_reply_to":"3f4b6375_9d0a5087","updated":"2017-11-07 11:50:20.000000000","message":"Done","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d257e5fa0f975f32d7fb004b1d274c2a8514d23f","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        resp \u003d self.controller.show(self.req, host)"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        host_resp \u003d resp[\u0027host\u0027]"},{"line_number":181,"context_line":"        # There are 3 resource list: total, project1, project2"},{"line_number":182,"context_line":"        self.assertEqual(3, len(host_resp))"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"        self.assertEqual(\u0027(total)\u0027, resp[\u0027host\u0027][0][\u0027resource\u0027][\u0027project\u0027])"},{"line_number":185,"context_line":"        self.assertEqual(\u00272\u0027, host_resp[0][\u0027resource\u0027][\u0027volume_count\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_3d40fca4","line":182,"range":{"start_line":181,"start_character":8,"end_line":182,"end_character":43},"updated":"2017-11-07 10:08:33.000000000","message":"?: Why aren\u0027t we checking the whole response?","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":23083,"name":"TommyLike","email":"tommylikehu@gmail.com","username":"TommyLike"},"change_message_id":"5786cb02b1af8b5888ed8fd99ea333800e1aa67b","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        resp \u003d self.controller.show(self.req, host)"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        host_resp \u003d resp[\u0027host\u0027]"},{"line_number":181,"context_line":"        # There are 3 resource list: total, project1, project2"},{"line_number":182,"context_line":"        self.assertEqual(3, len(host_resp))"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"        self.assertEqual(\u0027(total)\u0027, resp[\u0027host\u0027][0][\u0027resource\u0027][\u0027project\u0027])"},{"line_number":185,"context_line":"        self.assertEqual(\u00272\u0027, host_resp[0][\u0027resource\u0027][\u0027volume_count\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_7bcc3cba","line":182,"range":{"start_line":181,"start_character":8,"end_line":182,"end_character":43},"in_reply_to":"3f4b6375_3d40fca4","updated":"2017-11-07 11:50:20.000000000","message":"done","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"b50ff8cc67dd5e7a0da87102559c165fd7d5caa2","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        host_resp \u003d resp[\u0027host\u0027]"},{"line_number":180,"context_line":"        # There are 3 resource list: total, project1, project2"},{"line_number":181,"context_line":"        self.assertEqual(3, len(host_resp))"},{"line_number":182,"context_line":"        for project, resource in ((\u0027(total)\u0027, ((\u0027volume_count\u0027, \u00272\u0027),"},{"line_number":183,"context_line":"                                               (\u0027total_volume_gb\u0027, \u00272\u0027),"},{"line_number":184,"context_line":"                                               (\u0027snapshot_count\u0027, \u00271\u0027),"},{"line_number":185,"context_line":"                                               (\u0027total_snapshot_gb\u0027, \u00271\u0027))),"},{"line_number":186,"context_line":"                                  (fake_constants.PROJECT_ID,"},{"line_number":187,"context_line":"                                   ((\u0027volume_count\u0027, \u00271\u0027),"},{"line_number":188,"context_line":"                                    (\u0027total_volume_gb\u0027, \u00271\u0027),"},{"line_number":189,"context_line":"                                    (\u0027snapshot_count\u0027, \u00271\u0027),"},{"line_number":190,"context_line":"                                    (\u0027total_snapshot_gb\u0027, \u00271\u0027)))):"},{"line_number":191,"context_line":"            project \u003d [res[\u0027resource\u0027] for res"},{"line_number":192,"context_line":"                       in host_resp if res[\u0027resource\u0027][\u0027project\u0027] \u003d\u003d project]"},{"line_number":193,"context_line":"            self.assertIsNotNone(project[0])"},{"line_number":194,"context_line":"            for key, value in resource:"},{"line_number":195,"context_line":"                self.assertEqual(value, project[0][key])"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def test_show_forbidden(self):"},{"line_number":198,"context_line":"        self.req.environ[\u0027cinder.context\u0027].is_admin \u003d False"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_07df183b","line":195,"range":{"start_line":182,"start_character":0,"end_line":195,"end_character":56},"updated":"2017-11-08 09:50:32.000000000","message":"-1: It would be cleaner doing it with assertListEqual\n\n expected \u003d [\n     {\u0027resource\u0027: {\u0027project\u0027: \u0027(total)\u0027, ...},\n     {\u0027resource\u0027: ...},\n ]\n self.assertListEqual(expected, resp)","commit_id":"e1dd689ded745f25c1020cc21d5cb62ceb9d5552"}],"cinder/tests/unit/test_db_api.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d257e5fa0f975f32d7fb004b1d274c2a8514d23f","unresolved":false,"context_lines":[{"line_number":1837,"context_line":"                                        ignored_keys\u003d\u0027volume\u0027)"},{"line_number":1838,"context_line":""},{"line_number":1839,"context_line":"    def test_snapshot_get_all_by_project_with_host(self):"},{"line_number":1840,"context_line":"        db.volume_create(self.ctxt, {\u0027id\u0027: 1, \u0027host\u0027: \u0027host1\u0027, \u0027size\u0027: 1})"},{"line_number":1841,"context_line":"        db.volume_create(self.ctxt, {\u0027id\u0027: 2, \u0027host\u0027: \u0027host1\u0027, \u0027size\u0027: 2})"},{"line_number":1842,"context_line":"        db.volume_create(self.ctxt, {\u0027id\u0027: 3, \u0027host\u0027: \u0027host2\u0027, \u0027size\u0027: 3})"},{"line_number":1843,"context_line":"        db.snapshot_create(self.ctxt, {\u0027id\u0027: 1, \u0027volume_id\u0027: 1,"},{"line_number":1844,"context_line":"                                       \u0027project_id\u0027: fake.PROJECT_ID,"},{"line_number":1845,"context_line":"                                       \u0027volume_size\u0027: 1})"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_fd738414","line":1842,"range":{"start_line":1840,"start_character":8,"end_line":1842,"end_character":74},"updated":"2017-11-07 10:08:33.000000000","message":"nit: the project_id between the volumes and snapshots don\u0027t match","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"},{"author":{"_account_id":23083,"name":"TommyLike","email":"tommylikehu@gmail.com","username":"TommyLike"},"change_message_id":"5786cb02b1af8b5888ed8fd99ea333800e1aa67b","unresolved":false,"context_lines":[{"line_number":1837,"context_line":"                                        ignored_keys\u003d\u0027volume\u0027)"},{"line_number":1838,"context_line":""},{"line_number":1839,"context_line":"    def test_snapshot_get_all_by_project_with_host(self):"},{"line_number":1840,"context_line":"        db.volume_create(self.ctxt, {\u0027id\u0027: 1, \u0027host\u0027: \u0027host1\u0027, \u0027size\u0027: 1})"},{"line_number":1841,"context_line":"        db.volume_create(self.ctxt, {\u0027id\u0027: 2, \u0027host\u0027: \u0027host1\u0027, \u0027size\u0027: 2})"},{"line_number":1842,"context_line":"        db.volume_create(self.ctxt, {\u0027id\u0027: 3, \u0027host\u0027: \u0027host2\u0027, \u0027size\u0027: 3})"},{"line_number":1843,"context_line":"        db.snapshot_create(self.ctxt, {\u0027id\u0027: 1, \u0027volume_id\u0027: 1,"},{"line_number":1844,"context_line":"                                       \u0027project_id\u0027: fake.PROJECT_ID,"},{"line_number":1845,"context_line":"                                       \u0027volume_size\u0027: 1})"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_9b3ed888","line":1842,"range":{"start_line":1840,"start_character":8,"end_line":1842,"end_character":74},"in_reply_to":"3f4b6375_fd738414","updated":"2017-11-07 11:50:20.000000000","message":"Done","commit_id":"d40596d75f3f451abaf7b3526a57481edc1ea671"}]}
