)]}'
{"cinder/scheduler/evaluator/evaluator.py":[{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            try:"},{"line_number":47,"context_line":"                result \u003d _vars[which_dict][entry]"},{"line_number":48,"context_line":"            except KeyError as e:"},{"line_number":49,"context_line":"                msg \u003d _(\"KeyError: %s\") % six.text_type(e)"},{"line_number":50,"context_line":"                raise exception.EvaluatorParseException(msg)"},{"line_number":51,"context_line":"            except TypeError as e:"},{"line_number":52,"context_line":"                msg \u003d _(\"TypeError: %s\") % six.text_type(e)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_0809c495","line":49,"updated":"2015-04-17 10:59:44.000000000","message":"Can\u0027t we collapse these two lines, since this message is only used once here. Just use\n\nraise exception.EvaluatorParseException(_(\"text\"))","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            try:"},{"line_number":47,"context_line":"                result \u003d _vars[which_dict][entry]"},{"line_number":48,"context_line":"            except KeyError as e:"},{"line_number":49,"context_line":"                msg \u003d _(\"KeyError: %s\") % six.text_type(e)"},{"line_number":50,"context_line":"                raise exception.EvaluatorParseException(msg)"},{"line_number":51,"context_line":"            except TypeError as e:"},{"line_number":52,"context_line":"                msg \u003d _(\"TypeError: %s\") % six.text_type(e)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_24093d2d","line":49,"in_reply_to":"3ab451fb_0809c495","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                msg \u003d _(\"KeyError: %s\") % six.text_type(e)"},{"line_number":50,"context_line":"                raise exception.EvaluatorParseException(msg)"},{"line_number":51,"context_line":"            except TypeError as e:"},{"line_number":52,"context_line":"                msg \u003d _(\"TypeError: %s\") % six.text_type(e)"},{"line_number":53,"context_line":"                raise exception.EvaluatorParseException(msg)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_a8f8907d","line":52,"updated":"2015-04-17 10:59:44.000000000","message":"ditto","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                msg \u003d _(\"KeyError: %s\") % six.text_type(e)"},{"line_number":50,"context_line":"                raise exception.EvaluatorParseException(msg)"},{"line_number":51,"context_line":"            except TypeError as e:"},{"line_number":52,"context_line":"                msg \u003d _(\"TypeError: %s\") % six.text_type(e)"},{"line_number":53,"context_line":"                raise exception.EvaluatorParseException(msg)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_24201d9b","line":52,"in_reply_to":"3ab451fb_a8f8907d","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":58,"context_line":"            try:"},{"line_number":59,"context_line":"                result \u003d float(result)"},{"line_number":60,"context_line":"            except ValueError as e:"},{"line_number":61,"context_line":"                msg \u003d _(\"ValueError: %s\") % six.text_type(e)"},{"line_number":62,"context_line":"                raise exception.EvaluatorParseException(msg)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        return result"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_68f2889c","line":61,"updated":"2015-04-17 10:59:44.000000000","message":"ditto","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":58,"context_line":"            try:"},{"line_number":59,"context_line":"                result \u003d float(result)"},{"line_number":60,"context_line":"            except ValueError as e:"},{"line_number":61,"context_line":"                msg \u003d _(\"ValueError: %s\") % six.text_type(e)"},{"line_number":62,"context_line":"                raise exception.EvaluatorParseException(msg)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        return result"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_a4342dde","line":61,"in_reply_to":"3ab451fb_68f2889c","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                elif op \u003d\u003d \u0027/\u0027:"},{"line_number":105,"context_line":"                    prod /\u003d float(val.eval())"},{"line_number":106,"context_line":"            except ZeroDivisionError as e:"},{"line_number":107,"context_line":"                msg \u003d _(\"ZeroDivisionError: %s\") % six.text_type(e)"},{"line_number":108,"context_line":"                raise exception.EvaluatorParseException(msg)"},{"line_number":109,"context_line":"        return prod"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_282b60ed","line":107,"updated":"2015-04-17 10:59:44.000000000","message":"ditto","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                elif op \u003d\u003d \u0027/\u0027:"},{"line_number":105,"context_line":"                    prod /\u003d float(val.eval())"},{"line_number":106,"context_line":"            except ZeroDivisionError as e:"},{"line_number":107,"context_line":"                msg \u003d _(\"ZeroDivisionError: %s\") % six.text_type(e)"},{"line_number":108,"context_line":"                raise exception.EvaluatorParseException(msg)"},{"line_number":109,"context_line":"        return prod"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_c43e19b8","line":107,"in_reply_to":"3ab451fb_282b60ed","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":291,"context_line":"    try:"},{"line_number":292,"context_line":"        result \u003d _parser.parseString(expression, parseAll\u003dTrue)[0]"},{"line_number":293,"context_line":"    except pyparsing.ParseException as e:"},{"line_number":294,"context_line":"        msg \u003d _(\"ParseException: %s\") % six.text_type(e)"},{"line_number":295,"context_line":"        raise exception.EvaluatorParseException(msg)"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"    return result.eval()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_c8399c43","line":294,"updated":"2015-04-17 10:59:44.000000000","message":"ditto","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":291,"context_line":"    try:"},{"line_number":292,"context_line":"        result \u003d _parser.parseString(expression, parseAll\u003dTrue)[0]"},{"line_number":293,"context_line":"    except pyparsing.ParseException as e:"},{"line_number":294,"context_line":"        msg \u003d _(\"ParseException: %s\") % six.text_type(e)"},{"line_number":295,"context_line":"        raise exception.EvaluatorParseException(msg)"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"    return result.eval()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_4479e992","line":294,"in_reply_to":"3ab451fb_c8399c43","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"}],"cinder/scheduler/filter_scheduler.py":[{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            if host_state.host \u003d\u003d host:"},{"line_number":117,"context_line":"                return host_state"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        msg \u003d (_(\u0027Cannot place volume %(id)s on %(host)s\u0027)"},{"line_number":120,"context_line":"               % {\u0027id\u0027: request_spec[\u0027volume_id\u0027], \u0027host\u0027: host})"},{"line_number":121,"context_line":"        raise exception.NoValidHost(reason\u003dmsg)"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_08f30475","line":119,"updated":"2015-04-17 10:59:44.000000000","message":"Can\u0027t we collapse these two lines, and just use\n\nraise exception.****(_(\"text\"))","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            if host_state.host \u003d\u003d host:"},{"line_number":117,"context_line":"                return host_state"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        msg \u003d (_(\u0027Cannot place volume %(id)s on %(host)s\u0027)"},{"line_number":120,"context_line":"               % {\u0027id\u0027: request_spec[\u0027volume_id\u0027], \u0027host\u0027: host})"},{"line_number":121,"context_line":"        raise exception.NoValidHost(reason\u003dmsg)"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_6482a554","line":119,"in_reply_to":"3ab451fb_08f30475","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                                                      filter_properties)"},{"line_number":135,"context_line":"        if not weighed_hosts:"},{"line_number":136,"context_line":"            msg \u003d (_(\u0027No valid hosts for volume %(id)s with type %(type)s\u0027)"},{"line_number":137,"context_line":"                   % {\u0027id\u0027: request_spec[\u0027volume_id\u0027],"},{"line_number":138,"context_line":"                      \u0027type\u0027: request_spec[\u0027volume_type\u0027]})"},{"line_number":139,"context_line":"            raise exception.NoValidHost(reason\u003dmsg)"},{"line_number":140,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_e8e7b8aa","line":137,"updated":"2015-04-17 10:59:44.000000000","message":"ditto","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                                                      filter_properties)"},{"line_number":135,"context_line":"        if not weighed_hosts:"},{"line_number":136,"context_line":"            msg \u003d (_(\u0027No valid hosts for volume %(id)s with type %(type)s\u0027)"},{"line_number":137,"context_line":"                   % {\u0027id\u0027: request_spec[\u0027volume_id\u0027],"},{"line_number":138,"context_line":"                      \u0027type\u0027: request_spec[\u0027volume_type\u0027]})"},{"line_number":139,"context_line":"            raise exception.NoValidHost(reason\u003dmsg)"},{"line_number":140,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_84e4913b","line":137,"in_reply_to":"3ab451fb_e8e7b8aa","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        if migration_policy \u003d\u003d \u0027never\u0027:"},{"line_number":162,"context_line":"            msg \u003d (_(\u0027Current host not valid for volume %(id)s with type \u0027"},{"line_number":163,"context_line":"                     \u0027%(type)s, migration not allowed\u0027)"},{"line_number":164,"context_line":"                   % {\u0027id\u0027: request_spec[\u0027volume_id\u0027],"},{"line_number":165,"context_line":"                      \u0027type\u0027: request_spec[\u0027volume_type\u0027]})"},{"line_number":166,"context_line":"            raise exception.NoValidHost(reason\u003dmsg)"},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_88ff1434","line":164,"updated":"2015-04-17 10:59:44.000000000","message":"ditto","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        if migration_policy \u003d\u003d \u0027never\u0027:"},{"line_number":162,"context_line":"            msg \u003d (_(\u0027Current host not valid for volume %(id)s with type \u0027"},{"line_number":163,"context_line":"                     \u0027%(type)s, migration not allowed\u0027)"},{"line_number":164,"context_line":"                   % {\u0027id\u0027: request_spec[\u0027volume_id\u0027],"},{"line_number":165,"context_line":"                      \u0027type\u0027: request_spec[\u0027volume_type\u0027]})"},{"line_number":166,"context_line":"            raise exception.NoValidHost(reason\u003dmsg)"},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_e472357c","line":164,"in_reply_to":"3ab451fb_88ff1434","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":194,"context_line":"    def _max_attempts(self):"},{"line_number":195,"context_line":"        max_attempts \u003d CONF.scheduler_max_attempts"},{"line_number":196,"context_line":"        if max_attempts \u003c 1:"},{"line_number":197,"context_line":"            msg \u003d _(\"Invalid value for \u0027scheduler_max_attempts\u0027, \""},{"line_number":198,"context_line":"                    \"must be \u003e\u003d1\")"},{"line_number":199,"context_line":"            raise exception.InvalidParameterValue(err\u003dmsg)"},{"line_number":200,"context_line":"        return max_attempts"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_089ae414","line":197,"updated":"2015-04-17 10:59:44.000000000","message":"ditto","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":194,"context_line":"    def _max_attempts(self):"},{"line_number":195,"context_line":"        max_attempts \u003d CONF.scheduler_max_attempts"},{"line_number":196,"context_line":"        if max_attempts \u003c 1:"},{"line_number":197,"context_line":"            msg \u003d _(\"Invalid value for \u0027scheduler_max_attempts\u0027, \""},{"line_number":198,"context_line":"                    \"must be \u003e\u003d1\")"},{"line_number":199,"context_line":"            raise exception.InvalidParameterValue(err\u003dmsg)"},{"line_number":200,"context_line":"        return max_attempts"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_640505c1","line":197,"in_reply_to":"3ab451fb_089ae414","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":246,"context_line":"            msg \u003d _(\"Exceeded max scheduling attempts %(max_attempts)d for \""},{"line_number":247,"context_line":"                    \"volume %(volume_id)s\") % {"},{"line_number":248,"context_line":"                        \u0027max_attempts\u0027: max_attempts,"},{"line_number":249,"context_line":"                        \u0027volume_id\u0027: volume_id,"},{"line_number":250,"context_line":"            }"},{"line_number":251,"context_line":"            raise exception.NoValidHost(reason\u003dmsg)"},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_e89e9806","line":249,"updated":"2015-04-17 10:59:44.000000000","message":"ditto","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":246,"context_line":"            msg \u003d _(\"Exceeded max scheduling attempts %(max_attempts)d for \""},{"line_number":247,"context_line":"                    \"volume %(volume_id)s\") % {"},{"line_number":248,"context_line":"                        \u0027max_attempts\u0027: max_attempts,"},{"line_number":249,"context_line":"                        \u0027volume_id\u0027: volume_id,"},{"line_number":250,"context_line":"            }"},{"line_number":251,"context_line":"            raise exception.NoValidHost(reason\u003dmsg)"},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_642ce54a","line":249,"in_reply_to":"3ab451fb_e89e9806","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":12924,"name":"Patrick East","email":"east.patrick@gmail.com","username":"patrick.east"},"change_message_id":"e7da9f302e0d9484ad516681e59bceb195bb0068","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            if host_state.host \u003d\u003d host:"},{"line_number":117,"context_line":"                return host_state"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        raise exception.NoValidHost(reason\u003d_(\u0027Cannot place volume %(id)s on \u0027"},{"line_number":120,"context_line":"                                             \u0027%(host)s\u0027) %"},{"line_number":121,"context_line":"                                    {\u0027id\u0027: request_spec[\u0027volume_id\u0027],"},{"line_number":122,"context_line":"                                     \u0027host\u0027: host})"}],"source_content_type":"text/x-python","patch_set":4,"id":"bab921fb_ea168954","line":119,"updated":"2015-04-23 02:16:27.000000000","message":"I\u0027m not sure that in this particular case, and a few others, it is actually beneficial to remove the helper \u0027msg\u0027 variable.\n\nI can understand for small one-liners it doesn\u0027t make sense to add another variable and collapsing them is an improvement, but in this case (and some others being changed) the code goes from a nice single line string to broken up over two lines and doesn\u0027t leave much room for the template parameters since its indented further over.\n\nDefinitely not a blocking issue or anything... it still works fine either way, but I think we may want to re-evaluate where all we are collapsing these exception+msg lines together in the patchset.","commit_id":"d0f243e0aee0df2627b6e6c28359152637414ea9"},{"author":{"_account_id":12924,"name":"Patrick East","email":"east.patrick@gmail.com","username":"patrick.east"},"change_message_id":"555d893ee09c21a14c29b78fc99e792c5ec54a5a","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            if host_state.host \u003d\u003d host:"},{"line_number":117,"context_line":"                return host_state"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        raise exception.NoValidHost(reason\u003d_(\u0027Cannot place volume %(id)s on \u0027"},{"line_number":120,"context_line":"                                             \u0027%(host)s\u0027) %"},{"line_number":121,"context_line":"                                    {\u0027id\u0027: request_spec[\u0027volume_id\u0027],"},{"line_number":122,"context_line":"                                     \u0027host\u0027: host})"}],"source_content_type":"text/x-python","patch_set":4,"id":"bab921fb_011bb71c","line":119,"in_reply_to":"bab921fb_69571103","updated":"2015-04-23 20:28:16.000000000","message":"Ok, cool. Sounds like we are on the same page. I\u0027m fine with this change to make them consistent, but agree for future ones we should go on more of a case by case basis.","commit_id":"d0f243e0aee0df2627b6e6c28359152637414ea9"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"95aaac3de202181d44eb94b635465eb69493b894","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            if host_state.host \u003d\u003d host:"},{"line_number":117,"context_line":"                return host_state"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        raise exception.NoValidHost(reason\u003d_(\u0027Cannot place volume %(id)s on \u0027"},{"line_number":120,"context_line":"                                             \u0027%(host)s\u0027) %"},{"line_number":121,"context_line":"                                    {\u0027id\u0027: request_spec[\u0027volume_id\u0027],"},{"line_number":122,"context_line":"                                     \u0027host\u0027: host})"}],"source_content_type":"text/x-python","patch_set":4,"id":"bab921fb_69571103","line":119,"in_reply_to":"bab921fb_ea168954","updated":"2015-04-23 13:52:55.000000000","message":"I actually do agree with you Patrick. I think in some cases it does make the code more readable to break it out into two steps.\n\nI don\u0027t feel too strongly either way though, so since I got feedback on an earlier patchset I went ahead and changed them. I do think in future patches we should consider if the reduction in code is at the cost of less readability.\n\nThanks!","commit_id":"d0f243e0aee0df2627b6e6c28359152637414ea9"}],"cinder/scheduler/flows/create_volume.py":[{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        #"},{"line_number":50,"context_line":"        # In the future we might want to have a lock on the volume_id so that"},{"line_number":51,"context_line":"        # the volume can not be deleted while its still being created?"},{"line_number":52,"context_line":"        if not volume_id:"},{"line_number":53,"context_line":"            msg \u003d _(\"No volume_id provided to populate a request_spec from\")"},{"line_number":54,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":55,"context_line":"        volume_ref \u003d self.db_api.volume_get(context, volume_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_682f28a2","line":52,"updated":"2015-04-17 10:59:44.000000000","message":"Can\u0027t we collapse these two lines, and just use\n\nraise exception.InvalidInput(reason\u003d_(\"text\"))","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        #"},{"line_number":50,"context_line":"        # In the future we might want to have a lock on the volume_id so that"},{"line_number":51,"context_line":"        # the volume can not be deleted while its still being created?"},{"line_number":52,"context_line":"        if not volume_id:"},{"line_number":53,"context_line":"            msg \u003d _(\"No volume_id provided to populate a request_spec from\")"},{"line_number":54,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":55,"context_line":"        volume_ref \u003d self.db_api.volume_get(context, volume_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_bf1d5611","line":52,"in_reply_to":"3ab451fb_682f28a2","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"}],"cinder/scheduler/host_manager.py":[{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":399,"context_line":"                    break"},{"line_number":400,"context_line":"            if not found_class:"},{"line_number":401,"context_line":"                bad_filters.append(filter_name)"},{"line_number":402,"context_line":"        if bad_filters:"},{"line_number":403,"context_line":"            msg \u003d \", \".join(bad_filters)"},{"line_number":404,"context_line":"            raise exception.SchedulerHostFilterNotFound(filter_name\u003dmsg)"},{"line_number":405,"context_line":"        return good_filters"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_2e2b6984","line":402,"updated":"2015-04-17 10:59:44.000000000","message":"Can we collapse these two lines as msg variable is only used once here.","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":399,"context_line":"                    break"},{"line_number":400,"context_line":"            if not found_class:"},{"line_number":401,"context_line":"                bad_filters.append(filter_name)"},{"line_number":402,"context_line":"        if bad_filters:"},{"line_number":403,"context_line":"            msg \u003d \", \".join(bad_filters)"},{"line_number":404,"context_line":"            raise exception.SchedulerHostFilterNotFound(filter_name\u003dmsg)"},{"line_number":405,"context_line":"        return good_filters"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_3fa6e6c1","line":402,"in_reply_to":"3ab451fb_2e2b6984","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":427,"context_line":"                    break"},{"line_number":428,"context_line":"            if not found_class:"},{"line_number":429,"context_line":"                bad_weighers.append(weigher_name)"},{"line_number":430,"context_line":"        if bad_weighers:"},{"line_number":431,"context_line":"            msg \u003d \", \".join(bad_weighers)"},{"line_number":432,"context_line":"            raise exception.SchedulerHostWeigherNotFound(weigher_name\u003dmsg)"},{"line_number":433,"context_line":"        return good_weighers"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_ee2461b0","line":430,"updated":"2015-04-17 10:59:44.000000000","message":"ditto","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":427,"context_line":"                    break"},{"line_number":428,"context_line":"            if not found_class:"},{"line_number":429,"context_line":"                bad_weighers.append(weigher_name)"},{"line_number":430,"context_line":"        if bad_weighers:"},{"line_number":431,"context_line":"            msg \u003d \", \".join(bad_weighers)"},{"line_number":432,"context_line":"            raise exception.SchedulerHostWeigherNotFound(weigher_name\u003dmsg)"},{"line_number":433,"context_line":"        return good_weighers"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_1fab2a8b","line":430,"in_reply_to":"3ab451fb_ee2461b0","updated":"2015-04-17 14:01:46.000000000","message":"Done","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"}],"cinder/scheduler/manager.py":[{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                                                 image_id)"},{"line_number":142,"context_line":"        except Exception:"},{"line_number":143,"context_line":"            LOG.exception(_LE(\"Failed to create scheduler \""},{"line_number":144,"context_line":"                              \"manager volume flow\"))"},{"line_number":145,"context_line":"            raise exception.CinderException("},{"line_number":146,"context_line":"                _(\"Failed to create scheduler manager volume flow\"))"},{"line_number":147,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_eea901e1","line":144,"updated":"2015-04-17 10:59:44.000000000","message":"Remove duplicate message, just define\n\nmsg \u003d _(\"Failed to create scheduler manager volume flow.\")\n\nand use it at both the places.","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                                                 image_id)"},{"line_number":142,"context_line":"        except Exception:"},{"line_number":143,"context_line":"            LOG.exception(_LE(\"Failed to create scheduler \""},{"line_number":144,"context_line":"                              \"manager volume flow\"))"},{"line_number":145,"context_line":"            raise exception.CinderException("},{"line_number":146,"context_line":"                _(\"Failed to create scheduler manager volume flow\"))"},{"line_number":147,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_7f9c6e69","line":144,"in_reply_to":"3ab451fb_eea901e1","updated":"2015-04-17 14:01:46.000000000","message":"Good catch!","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        # TODO(harlowja): move into a task that just does this later."},{"line_number":279,"context_line":"        if not msg:"},{"line_number":280,"context_line":"            msg \u003d (_(\"Failed to schedule_%(method)s: %(ex)s\") %"},{"line_number":281,"context_line":"                   {\u0027method\u0027: method, \u0027ex\u0027: six.text_type(ex)})"},{"line_number":282,"context_line":"        LOG.error(msg)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"        volume_state \u003d updates[\u0027volume_state\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_6e8df17a","line":281,"updated":"2015-04-17 10:59:44.000000000","message":"IMO, we need _LE() here.","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        # TODO(harlowja): move into a task that just does this later."},{"line_number":279,"context_line":"        if not msg:"},{"line_number":280,"context_line":"            msg \u003d (_(\"Failed to schedule_%(method)s: %(ex)s\") %"},{"line_number":281,"context_line":"                   {\u0027method\u0027: method, \u0027ex\u0027: six.text_type(ex)})"},{"line_number":282,"context_line":"        LOG.error(msg)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"        volume_state \u003d updates[\u0027volume_state\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_ff9d1e5a","line":281,"in_reply_to":"3ab451fb_6e8df17a","updated":"2015-04-17 14:01:46.000000000","message":"You are correct. Missed this one.","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"}],"cinder/scheduler/scheduler_options.py":[{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            return json.load(handle)"},{"line_number":78,"context_line":"        except ValueError:"},{"line_number":79,"context_line":"            LOG.exception(_LE(\"Could not decode scheduler options.\"))"},{"line_number":80,"context_line":"            return {}"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def _get_time_now(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_4e5eb5ea","line":79,"updated":"2015-04-17 10:59:44.000000000","message":"Why we are removing original exception failure from here.","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            return json.load(handle)"},{"line_number":78,"context_line":"        except ValueError:"},{"line_number":79,"context_line":"            LOG.exception(_LE(\"Could not decode scheduler options.\"))"},{"line_number":80,"context_line":"            return {}"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def _get_time_now(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_3fe266d6","line":79,"in_reply_to":"3ab451fb_4e5eb5ea","updated":"2015-04-17 14:01:46.000000000","message":"LOG.exception logs the exception so this was redundant and would actually cause the exception to be written to the log twice.","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"1d20ba15c2fb45f45d96d6033aa633f095f6b145","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            return os.path.getmtime(filename)"},{"line_number":68,"context_line":"        except os.error:"},{"line_number":69,"context_line":"            LOG.exception(_LE(\"Could not stat scheduler options file \""},{"line_number":70,"context_line":"                              \"%(filename)s.\"),"},{"line_number":71,"context_line":"                          {\u0027filename\u0027: filename})"},{"line_number":72,"context_line":"            raise"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3ab451fb_a03776af","line":70,"updated":"2015-04-20 06:53:32.000000000","message":"same as below.","commit_id":"d4e751e75f0b537391651f8bd3119b39fa3f17ae"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"1d20ba15c2fb45f45d96d6033aa633f095f6b145","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        \"\"\"Decode the JSON file. Broken out for testing.\"\"\""},{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            return json.load(handle)"},{"line_number":78,"context_line":"        except ValueError:"},{"line_number":79,"context_line":"            LOG.exception(_LE(\"Could not decode scheduler options.\"))"},{"line_number":80,"context_line":"            return {}"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3ab451fb_c0e4c23c","line":78,"updated":"2015-04-20 06:53:32.000000000","message":"I don\u0027t think its good to remove existing log info here. Because it adds information about the exact reason of failure from json.load()\n\nBy removing this user will not be able to find in logs why it could not decode scheduler options.","commit_id":"d4e751e75f0b537391651f8bd3119b39fa3f17ae"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"3e8b20a7b9a6c63a39a13f2df06e25e1cacef16b","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        \"\"\"Decode the JSON file. Broken out for testing.\"\"\""},{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            return json.load(handle)"},{"line_number":78,"context_line":"        except ValueError:"},{"line_number":79,"context_line":"            LOG.exception(_LE(\"Could not decode scheduler options.\"))"},{"line_number":80,"context_line":"            return {}"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"dac4157f_26e711e6","line":78,"in_reply_to":"3ab451fb_c0e4c23c","updated":"2015-04-20 12:15:14.000000000","message":"Exception information is not being removed here. LOG.exception logs all of the exception information. Then the previous string was also including the exception information, resulting in it being double logged. This is cleaning up that redundancy.","commit_id":"d4e751e75f0b537391651f8bd3119b39fa3f17ae"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"c564b34085b51987c027713bd43404da61b20b20","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        \"\"\"Decode the JSON file. Broken out for testing.\"\"\""},{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            return json.load(handle)"},{"line_number":78,"context_line":"        except ValueError:"},{"line_number":79,"context_line":"            LOG.exception(_LE(\"Could not decode scheduler options.\"))"},{"line_number":80,"context_line":"            return {}"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"dac4157f_ffa99ce0","line":78,"in_reply_to":"dac4157f_26e711e6","updated":"2015-04-20 13:15:12.000000000","message":"I got your point, Thank you !","commit_id":"d4e751e75f0b537391651f8bd3119b39fa3f17ae"}],"cinder/tests/scheduler/test_host_manager.py":[{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        for service in services:"},{"line_number":275,"context_line":"            expected.append(mock.call(service))"},{"line_number":276,"context_line":"        self.assertEqual(expected, _mock_service_is_up.call_args_list)"},{"line_number":277,"context_line":"        self.assertTrue(_mock_warning.call_count \u003e 0)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        # Get host_state_map and make sure we have the first 2 hosts (host3 is"},{"line_number":280,"context_line":"        # down, host4 is missing capabilities)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_6e1731ee","line":277,"updated":"2015-04-17 10:59:44.000000000","message":"Can\u0027t we strict it to call_count \u003d 1","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        for service in services:"},{"line_number":275,"context_line":"            expected.append(mock.call(service))"},{"line_number":276,"context_line":"        self.assertEqual(expected, _mock_service_is_up.call_args_list)"},{"line_number":277,"context_line":"        self.assertTrue(_mock_warning.call_count \u003e 0)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        # Get host_state_map and make sure we have the first 2 hosts (host3 is"},{"line_number":280,"context_line":"        # down, host4 is missing capabilities)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_ff02be6e","line":277,"in_reply_to":"3ab451fb_6e1731ee","updated":"2015-04-17 14:01:46.000000000","message":"We don\u0027t really care if it was called once or called 10 times. The important thing to verify that there are warning log messages getting logged for this situation.","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"1d20ba15c2fb45f45d96d6033aa633f095f6b145","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        for service in services:"},{"line_number":275,"context_line":"            expected.append(mock.call(service))"},{"line_number":276,"context_line":"        self.assertEqual(expected, _mock_service_is_up.call_args_list)"},{"line_number":277,"context_line":"        self.assertTrue(_mock_warning.call_count \u003e 0)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        # Get host_state_map and make sure we have the first 2 hosts (host3 is"},{"line_number":280,"context_line":"        # down, host4 is missing capabilities)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3ab451fb_00cf4a57","line":277,"updated":"2015-04-20 06:53:32.000000000","message":"IMO, we should not duplicate the log calls. So it should be only called once. Thats the reason that earlier it had been assert with assert_called_once_with instead of assert_called_with.","commit_id":"d4e751e75f0b537391651f8bd3119b39fa3f17ae"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"3e8b20a7b9a6c63a39a13f2df06e25e1cacef16b","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        for service in services:"},{"line_number":275,"context_line":"            expected.append(mock.call(service))"},{"line_number":276,"context_line":"        self.assertEqual(expected, _mock_service_is_up.call_args_list)"},{"line_number":277,"context_line":"        self.assertTrue(_mock_warning.call_count \u003e 0)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        # Get host_state_map and make sure we have the first 2 hosts (host3 is"},{"line_number":280,"context_line":"        # down, host4 is missing capabilities)"}],"source_content_type":"text/x-python","patch_set":3,"id":"dac4157f_0611adac","line":277,"in_reply_to":"3ab451fb_00cf4a57","updated":"2015-04-20 12:15:14.000000000","message":"The problem is it\u0027s not a matter of duplicating the calls. Someone could update the code to add additional information. We would not want unit tests to fail because of that.\n\nThe main concern is that warning logs are being emitted by this scenario. Whether that\u0027s one log message or 10, it doesn\u0027t really matter. The important thing is that it is not 0.","commit_id":"d4e751e75f0b537391651f8bd3119b39fa3f17ae"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"c564b34085b51987c027713bd43404da61b20b20","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        for service in services:"},{"line_number":275,"context_line":"            expected.append(mock.call(service))"},{"line_number":276,"context_line":"        self.assertEqual(expected, _mock_service_is_up.call_args_list)"},{"line_number":277,"context_line":"        self.assertTrue(_mock_warning.call_count \u003e 0)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        # Get host_state_map and make sure we have the first 2 hosts (host3 is"},{"line_number":280,"context_line":"        # down, host4 is missing capabilities)"}],"source_content_type":"text/x-python","patch_set":3,"id":"dac4157f_1f0fb0e2","line":277,"in_reply_to":"dac4157f_0611adac","updated":"2015-04-20 13:15:12.000000000","message":"Sorry, I am still not agree with your point, because even someone update the code to add additional information to the log message the also the call count would be same. As you said log count doesn\u0027t matter here, so we should not make that change, IMHO.\nLets see other reviewers opinion on this.","commit_id":"d4e751e75f0b537391651f8bd3119b39fa3f17ae"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"7f45d25ace41d9cb5b54ab8add37436f82d449c3","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        for service in services:"},{"line_number":275,"context_line":"            expected.append(mock.call(service))"},{"line_number":276,"context_line":"        self.assertEqual(expected, _mock_service_is_up.call_args_list)"},{"line_number":277,"context_line":"        self.assertTrue(_mock_warning.call_count \u003e 0)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        # Get host_state_map and make sure we have the first 2 hosts (host3 is"},{"line_number":280,"context_line":"        # down, host4 is missing capabilities)"}],"source_content_type":"text/x-python","patch_set":3,"id":"dac4157f_7120019c","line":277,"in_reply_to":"dac4157f_1f0fb0e2","updated":"2015-04-21 06:23:18.000000000","message":"Downgrading my vote based on Duncan\u0027s comment. Thank you !","commit_id":"d4e751e75f0b537391651f8bd3119b39fa3f17ae"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"2266f502d58c908094e7f5795bf19dd1af2977a9","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        for service in services:"},{"line_number":275,"context_line":"            expected.append(mock.call(service))"},{"line_number":276,"context_line":"        self.assertEqual(expected, _mock_service_is_up.call_args_list)"},{"line_number":277,"context_line":"        self.assertTrue(_mock_warning.call_count \u003e 0)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        # Get host_state_map and make sure we have the first 2 hosts (host3 is"},{"line_number":280,"context_line":"        # down, host4 is missing capabilities)"}],"source_content_type":"text/x-python","patch_set":3,"id":"dac4157f_ba5b3254","line":277,"in_reply_to":"dac4157f_1f0fb0e2","updated":"2015-04-20 13:51:39.000000000","message":"I agree with Sean, the pattern for unit tests should not be that they duplicate the code, they should test the intent of the code. If this function logs more than one warning in future that doesn\u0027t make it broken, so we don\u0027t want the unit test to break because of that. Future deprecation warnings for example with cause assert_called_once to erroniously fail.\n\nI think that assert(call_count \u003e 0) is a better pattern to spread throughout the unit tests.","commit_id":"d4e751e75f0b537391651f8bd3119b39fa3f17ae"}],"cinder/tests/scheduler/test_scheduler.py":[{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":279,"context_line":"                              self.context,"},{"line_number":280,"context_line":"                              \u0027volume\u0027,"},{"line_number":281,"context_line":"                              group_id)"},{"line_number":282,"context_line":"            self.assertTrue(LOG.exception.call_count \u003e 0)"},{"line_number":283,"context_line":"            db.consistencygroup_update.assert_called_once_with("},{"line_number":284,"context_line":"                self.context, group_id, {\u0027status\u0027: \u0027error\u0027})"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_eee10100","line":282,"updated":"2015-04-17 10:59:44.000000000","message":"Can we strict it to call_count \u003d 1, if only exception message has been changed ?","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":279,"context_line":"                              self.context,"},{"line_number":280,"context_line":"                              \u0027volume\u0027,"},{"line_number":281,"context_line":"                              group_id)"},{"line_number":282,"context_line":"            self.assertTrue(LOG.exception.call_count \u003e 0)"},{"line_number":283,"context_line":"            db.consistencygroup_update.assert_called_once_with("},{"line_number":284,"context_line":"                self.context, group_id, {\u0027status\u0027: \u0027error\u0027})"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_7fefceb0","line":282,"in_reply_to":"3ab451fb_eee10100","updated":"2015-04-17 14:01:46.000000000","message":"Same as other comment.","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"4eb72936b42078ff82a62faf6b12e410d35644ea","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                reason\u003d\"No weighed hosts available\")"},{"line_number":292,"context_line":"            self.manager.create_consistencygroup("},{"line_number":293,"context_line":"                self.context, \u0027volume\u0027, group_id)"},{"line_number":294,"context_line":"            self.assertTrue(LOG.error.call_count \u003e 0)"},{"line_number":295,"context_line":"            db.consistencygroup_update.assert_called_once_with("},{"line_number":296,"context_line":"                self.context, group_id, {\u0027status\u0027: \u0027error\u0027})"},{"line_number":297,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_aee4190d","line":294,"updated":"2015-04-17 10:59:44.000000000","message":"ditto","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"5f137d643b82dbe9661d67526c0d920ed8b1a870","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                reason\u003d\"No weighed hosts available\")"},{"line_number":292,"context_line":"            self.manager.create_consistencygroup("},{"line_number":293,"context_line":"                self.context, \u0027volume\u0027, group_id)"},{"line_number":294,"context_line":"            self.assertTrue(LOG.error.call_count \u003e 0)"},{"line_number":295,"context_line":"            db.consistencygroup_update.assert_called_once_with("},{"line_number":296,"context_line":"                self.context, group_id, {\u0027status\u0027: \u0027error\u0027})"},{"line_number":297,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_5f2bf2eb","line":294,"in_reply_to":"3ab451fb_aee4190d","updated":"2015-04-17 14:01:46.000000000","message":"Same","commit_id":"fa75c7d2819295d74f01f150fc067f4277e55193"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"1d20ba15c2fb45f45d96d6033aa633f095f6b145","unresolved":false,"context_lines":[{"line_number":279,"context_line":"                              self.context,"},{"line_number":280,"context_line":"                              \u0027volume\u0027,"},{"line_number":281,"context_line":"                              group_id)"},{"line_number":282,"context_line":"            self.assertTrue(LOG.exception.call_count \u003e 0)"},{"line_number":283,"context_line":"            db.consistencygroup_update.assert_called_once_with("},{"line_number":284,"context_line":"                self.context, group_id, {\u0027status\u0027: \u0027error\u0027})"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3ab451fb_403af237","line":282,"updated":"2015-04-20 06:53:32.000000000","message":"Same as other comment.","commit_id":"d4e751e75f0b537391651f8bd3119b39fa3f17ae"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"3e8b20a7b9a6c63a39a13f2df06e25e1cacef16b","unresolved":false,"context_lines":[{"line_number":279,"context_line":"                              self.context,"},{"line_number":280,"context_line":"                              \u0027volume\u0027,"},{"line_number":281,"context_line":"                              group_id)"},{"line_number":282,"context_line":"            self.assertTrue(LOG.exception.call_count \u003e 0)"},{"line_number":283,"context_line":"            db.consistencygroup_update.assert_called_once_with("},{"line_number":284,"context_line":"                self.context, group_id, {\u0027status\u0027: \u0027error\u0027})"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"dac4157f_268391ce","line":282,"in_reply_to":"3ab451fb_403af237","updated":"2015-04-20 12:15:14.000000000","message":"See warning logging comment in previous file.","commit_id":"d4e751e75f0b537391651f8bd3119b39fa3f17ae"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"1d20ba15c2fb45f45d96d6033aa633f095f6b145","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                reason\u003d\"No weighed hosts available\")"},{"line_number":292,"context_line":"            self.manager.create_consistencygroup("},{"line_number":293,"context_line":"                self.context, \u0027volume\u0027, group_id)"},{"line_number":294,"context_line":"            self.assertTrue(LOG.error.call_count \u003e 0)"},{"line_number":295,"context_line":"            db.consistencygroup_update.assert_called_once_with("},{"line_number":296,"context_line":"                self.context, group_id, {\u0027status\u0027: \u0027error\u0027})"},{"line_number":297,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3ab451fb_204006a5","line":294,"updated":"2015-04-20 06:53:32.000000000","message":"Same as other comment.","commit_id":"d4e751e75f0b537391651f8bd3119b39fa3f17ae"}]}
