)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"0c9352cdd86216dbd428dffc746c57d23c955c3f","unresolved":false,"context_lines":[{"line_number":10,"context_line":"now keep information which was the last executed filter if hosts"},{"line_number":11,"context_line":"filtering failed."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Implements Blueprint user-messages"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I9ce096eebda3249687268e361b7141dea4032b57"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"3f044301_26555751","line":13,"range":{"start_line":13,"start_character":0,"end_line":13,"end_character":10},"updated":"2017-05-04 02:46:33.000000000","message":"Partially Implements","commit_id":"d4313dacb8f6c0c4f77bd76a5568231c4ab7c9d7"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"19285f647850612a1374c589104c3c89e47629bc","unresolved":false,"context_lines":[{"line_number":11,"context_line":"filtering failed."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Partially-implements: blueprint user-messages"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I9ce096eebda3249687268e361b7141dea4032b57"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":27,"id":"ff346bd7_1de4e6ab","line":14,"range":{"start_line":14,"start_character":0,"end_line":14,"end_character":0},"updated":"2017-07-23 22:14:31.000000000","message":"Please add:\n\nDocImpact\n\n\nEnd users may not be aware of what to do with these Filter messages, we should write some end user documentation","commit_id":"05f8e16315f9553d6c1effa86c35876972f500fd"}],"manila/message/message_field.py":[{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"0c9352cdd86216dbd428dffc746c57d23c955c3f","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"def _translate_filter_exception(ex):"},{"line_number":119,"context_line":"    details \u003d getattr(ex, \u0027detail_data\u0027, {})"},{"line_number":120,"context_line":"    last_filter \u003d details.get(\u0027last_filter\u0027, None)"},{"line_number":121,"context_line":"    return Detail.FILTER_DETAIL_MAPPINGS.get("},{"line_number":122,"context_line":"        last_filter, Detail.NO_VALID_HOST)[0]"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3f044301_86354bfa","line":120,"range":{"start_line":120,"start_character":25,"end_line":120,"end_character":50},"updated":"2017-05-04 02:46:33.000000000","message":"s/details.get(\u0027last_filter\u0027, None)/details.get(\u0027last_filter\u0027)","commit_id":"d4313dacb8f6c0c4f77bd76a5568231c4ab7c9d7"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"0c9352cdd86216dbd428dffc746c57d23c955c3f","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"def translate_detail_id(excep, detail):"},{"line_number":126,"context_line":"    if excep is not None:"},{"line_number":127,"context_line":"        if isinstance(excep, exception.NoValidHost):"},{"line_number":128,"context_line":"            return _translate_filter_exception(excep)"},{"line_number":129,"context_line":"        if isinstance(excep, Exception):"},{"line_number":130,"context_line":"            for key, value in Detail.EXCEPTION_DETAIL_MAPPINGS.items():"},{"line_number":131,"context_line":"                if excep.__class__.__name__ in value:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f044301_9927ecb7","line":128,"range":{"start_line":127,"start_character":8,"end_line":128,"end_character":53},"updated":"2017-05-04 02:46:33.000000000","message":"if isinstance(excep, exception.NoValidHost):\nIf we get NoValidHost exception, and we need to translate detail from FILTER_DETAIL_MAPPINGS ???","commit_id":"d4313dacb8f6c0c4f77bd76a5568231c4ab7c9d7"},{"author":{"_account_id":7582,"name":"Jan Provaznik","email":"jan.provaznik@gmail.com","username":"jprovazn"},"change_message_id":"b729afdbd10fe8e265bd5e86fa5ed1011a6c8a2e","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"def translate_detail_id(excep, detail):"},{"line_number":126,"context_line":"    if excep is not None:"},{"line_number":127,"context_line":"        if isinstance(excep, exception.NoValidHost):"},{"line_number":128,"context_line":"            return _translate_filter_exception(excep)"},{"line_number":129,"context_line":"        if isinstance(excep, Exception):"},{"line_number":130,"context_line":"            for key, value in Detail.EXCEPTION_DETAIL_MAPPINGS.items():"},{"line_number":131,"context_line":"                if excep.__class__.__name__ in value:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f044301_1f7a31f0","line":128,"range":{"start_line":127,"start_character":8,"end_line":128,"end_character":53},"in_reply_to":"3f044301_9927ecb7","updated":"2017-05-09 18:34:54.000000000","message":"Yes. The reason is that if NoValidHost is raised because a specific filter failed, it\u0027s better to distinguish between filters based on last executed filter. The other exceptions are translated based on EXCEPTION_DETAIL_MAPPING.\n\nAn alternative would be to raise filter-specific exceptions in filters but it\u0027s not ideal because each filter would then need to define it\u0027s own exception.\n\nI\u0027ll add a comment in the next patchset.","commit_id":"d4313dacb8f6c0c4f77bd76a5568231c4ab7c9d7"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"0c9352cdd86216dbd428dffc746c57d23c955c3f","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        if isinstance(excep, exception.NoValidHost):"},{"line_number":128,"context_line":"            return _translate_filter_exception(excep)"},{"line_number":129,"context_line":"        if isinstance(excep, Exception):"},{"line_number":130,"context_line":"            for key, value in Detail.EXCEPTION_DETAIL_MAPPINGS.items():"},{"line_number":131,"context_line":"                if excep.__class__.__name__ in value:"},{"line_number":132,"context_line":"                    return key[0]"},{"line_number":133,"context_line":"    if (detail in Detail.ALL and"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f044301_7903000f","line":130,"range":{"start_line":130,"start_character":37,"end_line":130,"end_character":62},"updated":"2017-05-04 02:46:33.000000000","message":"above, If we get exception without NoValidHost, and we need to translate detail from EXCEPTION_DETAIL_MAPPINGS ???","commit_id":"d4313dacb8f6c0c4f77bd76a5568231c4ab7c9d7"}],"manila/scheduler/drivers/filter.py":[{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"d997babbb504f0fe92f34619803b0f6db8862184","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            hosts, filter_properties)"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        if not hosts:"},{"line_number":226,"context_line":"            msg \u003d _(\u0027Failed to find a weighted host, the last executed filter\u0027"},{"line_number":227,"context_line":"                    \u0027 was %s.\u0027)"},{"line_number":228,"context_line":"            raise exception.NoValidHost("},{"line_number":229,"context_line":"                reason\u003dmsg % last_filter,"},{"line_number":230,"context_line":"                detail_data\u003d{\u0027last_filter\u0027: last_filter})"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        LOG.debug(\"Filtered share %(hosts)s\", {\"hosts\": hosts})"},{"line_number":233,"context_line":"        # weighted_host \u003d WeightedHost() ... the best"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a22e58a_1d405e56","line":230,"range":{"start_line":226,"start_character":11,"end_line":230,"end_character":57},"updated":"2017-03-14 11:31:35.000000000","message":"If we return None, We can raise the NoValidHost error(please see https://github.com/openstack/manila/blob/master/manila/scheduler/drivers/filter.py#L83\nhttps://github.com/openstack/manila/blob/master/manila/scheduler/drivers/filter.py#L112\n), why we need to add it again?","commit_id":"2a4d7da6d97fe65569b79b09b6739fac3789f72f"},{"author":{"_account_id":7582,"name":"Jan Provaznik","email":"jan.provaznik@gmail.com","username":"jprovazn"},"change_message_id":"c9241db250c36232ae6c917ce8223ff3a2aa70b6","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            hosts, filter_properties)"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        if not hosts:"},{"line_number":226,"context_line":"            msg \u003d _(\u0027Failed to find a weighted host, the last executed filter\u0027"},{"line_number":227,"context_line":"                    \u0027 was %s.\u0027)"},{"line_number":228,"context_line":"            raise exception.NoValidHost("},{"line_number":229,"context_line":"                reason\u003dmsg % last_filter,"},{"line_number":230,"context_line":"                detail_data\u003d{\u0027last_filter\u0027: last_filter})"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        LOG.debug(\"Filtered share %(hosts)s\", {\"hosts\": hosts})"},{"line_number":233,"context_line":"        # weighted_host \u003d WeightedHost() ... the best"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_c6d6b226","line":230,"range":{"start_line":226,"start_character":11,"end_line":230,"end_character":57},"in_reply_to":"5a22e58a_1d405e56","updated":"2017-03-20 11:26:20.000000000","message":"This is more suitable place for raising the exception instead of raising NoValidHost from upper methods (no code duplicaiton and no need to pass the last_filter back). I\u0027ve removed NoValidHost exception from upper methods in the new patchset.","commit_id":"2a4d7da6d97fe65569b79b09b6739fac3789f72f"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"d997babbb504f0fe92f34619803b0f6db8862184","unresolved":false,"context_lines":[{"line_number":483,"context_line":"            if tgt_host.obj.host \u003d\u003d host:"},{"line_number":484,"context_line":"                return tgt_host.obj"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"        msg \u003d (_(\u0027Cannot place share %(id)s on %(host)s\u0027)"},{"line_number":487,"context_line":"               % {\u0027id\u0027: request_spec[\u0027share_id\u0027], \u0027host\u0027: host})"},{"line_number":488,"context_line":"        raise exception.NoValidHost(reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a22e58a_fd0b827b","line":487,"range":{"start_line":486,"start_character":8,"end_line":487,"end_character":64},"updated":"2017-03-14 11:31:35.000000000","message":"You could add last_filter in the log.","commit_id":"2a4d7da6d97fe65569b79b09b6739fac3789f72f"},{"author":{"_account_id":7582,"name":"Jan Provaznik","email":"jan.provaznik@gmail.com","username":"jprovazn"},"change_message_id":"c9241db250c36232ae6c917ce8223ff3a2aa70b6","unresolved":false,"context_lines":[{"line_number":483,"context_line":"            if tgt_host.obj.host \u003d\u003d host:"},{"line_number":484,"context_line":"                return tgt_host.obj"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"        msg \u003d (_(\u0027Cannot place share %(id)s on %(host)s\u0027)"},{"line_number":487,"context_line":"               % {\u0027id\u0027: request_spec[\u0027share_id\u0027], \u0027host\u0027: host})"},{"line_number":488,"context_line":"        raise exception.NoValidHost(reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_9126b2b8","line":487,"range":{"start_line":486,"start_character":8,"end_line":487,"end_character":64},"in_reply_to":"5a22e58a_fd0b827b","updated":"2017-03-20 11:26:20.000000000","message":"Done, more detailed info about filter processing is already logged by filters itself.","commit_id":"2a4d7da6d97fe65569b79b09b6739fac3789f72f"}]}
