)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c85fae39303917249e35d91691835d5434af71ac","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-10-17 17:34:36 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add logging to driver vendor_passthru functions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I17006611fd59d5f4dc78fdaefdf802e9fb7caff2"},{"line_number":10,"context_line":"Closes-Bug: 1372979"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9aa7fdbe_4203120d","line":8,"updated":"2014-10-21 23:58:32.000000000","message":"It might be helpful to explain why you are adding logging. You could copy/paste from the bug ;)","commit_id":"2be638898bd4c0cdbda4b16a00eec9644e4f00aa"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"c148acd54e1f3dbbc6d3c6dd0aa2e316e465b1e3","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-10-17 17:34:36 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add logging to driver vendor_passthru functions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I17006611fd59d5f4dc78fdaefdf802e9fb7caff2"},{"line_number":10,"context_line":"Closes-Bug: 1372979"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9aa7fdbe_69962d4e","line":8,"in_reply_to":"9aa7fdbe_4203120d","updated":"2014-10-22 11:30:45.000000000","message":"Done","commit_id":"2be638898bd4c0cdbda4b16a00eec9644e4f00aa"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3ff8707cc8993e8004d2fdb02f99720b6d0c6d8c","unresolved":false,"context_lines":[{"line_number":13,"context_line":"This patch adds a decorator that can be used to wrap passthru function"},{"line_number":14,"context_line":"calls and ensure that any exceptions get logged correctly, also adds"},{"line_number":15,"context_line":"unit tests to ensure decorators functionality."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I17006611fd59d5f4dc78fdaefdf802e9fb7caff2"},{"line_number":18,"context_line":"Closes-Bug: 1372979"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9aa7fdbe_2e0814d9","line":16,"updated":"2014-10-28 18:05:59.000000000","message":"As the blueprint work is going to use this patch as base I think it makes sense to add it as part of the blueprint (I will add ur name as a contributor to the blueprint in the spec). If you agree we should put this tag here in the commit message:\n\nImplements: blueprint extended-vendor-passthru","commit_id":"43e667d3cf36e9d1da78a5a836991dfd9aa29636"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"206bb48c74250472ecc3ba1cbe0eea08ddb78c7e","unresolved":false,"context_lines":[{"line_number":13,"context_line":"This patch adds a decorator that can be used to wrap passthru function"},{"line_number":14,"context_line":"calls and ensure that any exceptions get logged correctly, also adds"},{"line_number":15,"context_line":"unit tests to ensure decorators functionality."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I17006611fd59d5f4dc78fdaefdf802e9fb7caff2"},{"line_number":18,"context_line":"Closes-Bug: 1372979"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9aa7fdbe_bdd982f6","line":16,"in_reply_to":"9aa7fdbe_2e0814d9","updated":"2014-10-29 12:36:40.000000000","message":"Done","commit_id":"43e667d3cf36e9d1da78a5a836991dfd9aa29636"}],"ironic/drivers/base.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c85fae39303917249e35d91691835d5434af71ac","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from ironic.common.i18n import _LE"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def passthru_with_logging(logger, func, *args, **kwargs):"},{"line_number":31,"context_line":"    method \u003d kwargs[\u0027method\u0027]"},{"line_number":32,"context_line":"    kwargs[\u0027passMethod\u0027] \u003d kwargs.get(\u0027passMethod\u0027, True)"},{"line_number":33,"context_line":"    if not kwargs[\u0027passMethod\u0027]:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa7fdbe_df77d900","line":30,"updated":"2014-10-21 23:58:32.000000000","message":"Have you thought about moving this to VendorInterface.passthru_with_logging() or VendorInterface._passthru_with_logging()?\n\nMy other thought was to move it to utils.py.\n\nMaybe it is fine here too, although I\u0027m not sure I like it here.\n\nA docstring might be nice too, although it does seem obvious.","commit_id":"2be638898bd4c0cdbda4b16a00eec9644e4f00aa"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"c148acd54e1f3dbbc6d3c6dd0aa2e316e465b1e3","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from ironic.common.i18n import _LE"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def passthru_with_logging(logger, func, *args, **kwargs):"},{"line_number":31,"context_line":"    method \u003d kwargs[\u0027method\u0027]"},{"line_number":32,"context_line":"    kwargs[\u0027passMethod\u0027] \u003d kwargs.get(\u0027passMethod\u0027, True)"},{"line_number":33,"context_line":"    if not kwargs[\u0027passMethod\u0027]:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa7fdbe_a9773539","line":30,"in_reply_to":"9aa7fdbe_df77d900","updated":"2014-10-22 11:30:45.000000000","message":"Done","commit_id":"2be638898bd4c0cdbda4b16a00eec9644e4f00aa"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c85fae39303917249e35d91691835d5434af71ac","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    kwargs[\u0027passMethod\u0027] \u003d kwargs.get(\u0027passMethod\u0027, True)"},{"line_number":33,"context_line":"    if not kwargs[\u0027passMethod\u0027]:"},{"line_number":34,"context_line":"        del kwargs[\u0027method\u0027]"},{"line_number":35,"context_line":"    del kwargs[\u0027passMethod\u0027]"},{"line_number":36,"context_line":"    try:"},{"line_number":37,"context_line":"        return func(*args, **kwargs)"},{"line_number":38,"context_line":"    except exception.IronicException as e:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa7fdbe_3f646548","line":35,"updated":"2014-10-21 23:58:32.000000000","message":"I don\u0027t understand the reason for the \u0027passMethod\u0027 and \u0027method\u0027 stuff here. Maybe some comments would help.","commit_id":"2be638898bd4c0cdbda4b16a00eec9644e4f00aa"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"c148acd54e1f3dbbc6d3c6dd0aa2e316e465b1e3","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    kwargs[\u0027passMethod\u0027] \u003d kwargs.get(\u0027passMethod\u0027, True)"},{"line_number":33,"context_line":"    if not kwargs[\u0027passMethod\u0027]:"},{"line_number":34,"context_line":"        del kwargs[\u0027method\u0027]"},{"line_number":35,"context_line":"    del kwargs[\u0027passMethod\u0027]"},{"line_number":36,"context_line":"    try:"},{"line_number":37,"context_line":"        return func(*args, **kwargs)"},{"line_number":38,"context_line":"    except exception.IronicException as e:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa7fdbe_e9b77dd6","line":35,"in_reply_to":"9aa7fdbe_3f646548","updated":"2014-10-22 11:30:45.000000000","message":"In the latest version this code is not needed anymore.","commit_id":"2be638898bd4c0cdbda4b16a00eec9644e4f00aa"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"102fbc0bc1968160ed5ba59c6e1d2fe0569e0a8c","unresolved":false,"context_lines":[{"line_number":415,"context_line":"            _(\u0027Vendor interface does not support driver vendor_passthru \u0027"},{"line_number":416,"context_line":"              \u0027method: %s\u0027) % method)"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"    def _passthru_with_logging(self, logger, method, func):"},{"line_number":421,"context_line":"        \"\"\"Wrap function calls with correct logging for any exceptions.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_af8f30cb","line":418,"updated":"2014-10-22 15:07:30.000000000","message":"Maybe put this in the function.","commit_id":"4b3b147fad21fc2ebf8b90b11c4a807af52b30e4"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"faa7be8e89080e8217640a579fa0a7e92ea3e94e","unresolved":false,"context_lines":[{"line_number":415,"context_line":"            _(\u0027Vendor interface does not support driver vendor_passthru \u0027"},{"line_number":416,"context_line":"              \u0027method: %s\u0027) % method)"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"    def _passthru_with_logging(self, logger, method, func):"},{"line_number":421,"context_line":"        \"\"\"Wrap function calls with correct logging for any exceptions.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_45030542","line":418,"in_reply_to":"9aa7fdbe_af8f30cb","updated":"2014-10-22 15:59:29.000000000","message":"Done","commit_id":"4b3b147fad21fc2ebf8b90b11c4a807af52b30e4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"102fbc0bc1968160ed5ba59c6e1d2fe0569e0a8c","unresolved":false,"context_lines":[{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"    def _passthru_with_logging(self, logger, method, func):"},{"line_number":421,"context_line":"        \"\"\"Wrap function calls with correct logging for any exceptions.\"\"\""},{"line_number":422,"context_line":"        def logged_function(*args, **kwargs):"},{"line_number":423,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_42213b4c","line":420,"updated":"2014-10-22 15:07:30.000000000","message":"I was thinking about this. It isn\u0027t only handling logging, it is also raising VendorPassthruException for non-Ironic exceptions.\n\nMaybe change it to be something more general like _invoke_method(self, method, func, logger) ( _handle_passthru()? _process_method()? _do_passthru_method())\n\nI wonder if what we\u0027re logging is sufficient, but maybe that\u0027s food for a separate patch (unless someone else has a suggestion).","commit_id":"4b3b147fad21fc2ebf8b90b11c4a807af52b30e4"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"faa7be8e89080e8217640a579fa0a7e92ea3e94e","unresolved":false,"context_lines":[{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"    def _passthru_with_logging(self, logger, method, func):"},{"line_number":421,"context_line":"        \"\"\"Wrap function calls with correct logging for any exceptions.\"\"\""},{"line_number":422,"context_line":"        def logged_function(*args, **kwargs):"},{"line_number":423,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_65fe493a","line":420,"in_reply_to":"9aa7fdbe_42213b4c","updated":"2014-10-22 15:59:29.000000000","message":"Done","commit_id":"4b3b147fad21fc2ebf8b90b11c4a807af52b30e4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"102fbc0bc1968160ed5ba59c6e1d2fe0569e0a8c","unresolved":false,"context_lines":[{"line_number":418,"context_line":"    passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"    def _passthru_with_logging(self, logger, method, func):"},{"line_number":421,"context_line":"        \"\"\"Wrap function calls with correct logging for any exceptions.\"\"\""},{"line_number":422,"context_line":"        def logged_function(*args, **kwargs):"},{"line_number":423,"context_line":"            try:"},{"line_number":424,"context_line":"                return func(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_2f0ee034","line":421,"updated":"2014-10-22 15:07:30.000000000","message":"\u0027correct\u0027? Not sure that is needed. Makes me think we also allow incorrect logging ;)\n\nMaybe describe method \u0026 func (I wasn\u0027t sure what the diff was when I first looked).","commit_id":"4b3b147fad21fc2ebf8b90b11c4a807af52b30e4"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"faa7be8e89080e8217640a579fa0a7e92ea3e94e","unresolved":false,"context_lines":[{"line_number":418,"context_line":"    passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"    def _passthru_with_logging(self, logger, method, func):"},{"line_number":421,"context_line":"        \"\"\"Wrap function calls with correct logging for any exceptions.\"\"\""},{"line_number":422,"context_line":"        def logged_function(*args, **kwargs):"},{"line_number":423,"context_line":"            try:"},{"line_number":424,"context_line":"                return func(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_85fded3c","line":421,"in_reply_to":"9aa7fdbe_2f0ee034","updated":"2014-10-22 15:59:29.000000000","message":"Done","commit_id":"4b3b147fad21fc2ebf8b90b11c4a807af52b30e4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"102fbc0bc1968160ed5ba59c6e1d2fe0569e0a8c","unresolved":false,"context_lines":[{"line_number":430,"context_line":"            except Exception as e:"},{"line_number":431,"context_line":"                # catch-all in case something bubbles up here"},{"line_number":432,"context_line":"                # log this because even though the exception is being"},{"line_number":433,"context_line":"                # reraised, it won\u0027t be handled if it is an async. call."},{"line_number":434,"context_line":"                logger.exception(self.passthru_logmessage % method)"},{"line_number":435,"context_line":"                raise exception.VendorPassthruException(message\u003de)"},{"line_number":436,"context_line":"        return logged_function"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_4f6964bd","line":433,"updated":"2014-10-22 15:07:30.000000000","message":"I think you can move this comment (\"log this ...\") into the docstring for the method.","commit_id":"4b3b147fad21fc2ebf8b90b11c4a807af52b30e4"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"faa7be8e89080e8217640a579fa0a7e92ea3e94e","unresolved":false,"context_lines":[{"line_number":430,"context_line":"            except Exception as e:"},{"line_number":431,"context_line":"                # catch-all in case something bubbles up here"},{"line_number":432,"context_line":"                # log this because even though the exception is being"},{"line_number":433,"context_line":"                # reraised, it won\u0027t be handled if it is an async. call."},{"line_number":434,"context_line":"                logger.exception(self.passthru_logmessage % method)"},{"line_number":435,"context_line":"                raise exception.VendorPassthruException(message\u003de)"},{"line_number":436,"context_line":"        return logged_function"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_e5995920","line":433,"in_reply_to":"9aa7fdbe_4f6964bd","updated":"2014-10-22 15:59:29.000000000","message":"Done","commit_id":"4b3b147fad21fc2ebf8b90b11c4a807af52b30e4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"759d9528b4cb3d86448d8c5a9f145747e1753d6d","unresolved":false,"context_lines":[{"line_number":415,"context_line":"            _(\u0027Vendor interface does not support driver vendor_passthru \u0027"},{"line_number":416,"context_line":"              \u0027method: %s\u0027) % method)"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    def _handle_passthru(self, logger, method, func):"},{"line_number":419,"context_line":"        \"\"\"Wrap function calls with logging for any exceptions."},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        _handle_passthru returns a new function that wraps func in a try"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa7fdbe_b154ef21","line":418,"updated":"2014-10-22 18:08:46.000000000","message":"Since it is handling the method, I wonder if it makes more sense to reorder the parameters, eg: (self, method, func, logger) but maybe this is just a nit.","commit_id":"68e8883ad21a019dd73950f9cd3b9551cbd27371"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"759d9528b4cb3d86448d8c5a9f145747e1753d6d","unresolved":false,"context_lines":[{"line_number":416,"context_line":"              \u0027method: %s\u0027) % method)"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    def _handle_passthru(self, logger, method, func):"},{"line_number":419,"context_line":"        \"\"\"Wrap function calls with logging for any exceptions."},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        _handle_passthru returns a new function that wraps func in a try"},{"line_number":422,"context_line":"        except ready to catch any ironic exceptions and reraise them after"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa7fdbe_91828b92","line":419,"updated":"2014-10-22 18:08:46.000000000","message":"How about \u0027Call the passthru method and handle any exceptions\u0027","commit_id":"68e8883ad21a019dd73950f9cd3b9551cbd27371"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"9fc0622f0f9075138b96a87b9f8bea717d518c2b","unresolved":false,"context_lines":[{"line_number":416,"context_line":"              \u0027method: %s\u0027) % method)"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    def _handle_passthru(self, logger, method, func):"},{"line_number":419,"context_line":"        \"\"\"Wrap function calls with logging for any exceptions."},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        _handle_passthru returns a new function that wraps func in a try"},{"line_number":422,"context_line":"        except ready to catch any ironic exceptions and reraise them after"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa7fdbe_7b7a3378","line":419,"in_reply_to":"9aa7fdbe_91828b92","updated":"2014-10-24 09:42:18.000000000","message":"Done","commit_id":"68e8883ad21a019dd73950f9cd3b9551cbd27371"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"759d9528b4cb3d86448d8c5a9f145747e1753d6d","unresolved":false,"context_lines":[{"line_number":424,"context_line":"        them as a VendorPassthruException after writing a log."},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"        Logs need to be added because even though the exception is being"},{"line_number":427,"context_line":"        reraised, it won\u0027t be handled if it is an async. call."},{"line_number":428,"context_line":"        \"\"\""},{"line_number":429,"context_line":"        passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":430,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa7fdbe_3569cabe","line":427,"updated":"2014-10-22 18:08:46.000000000","message":"for completeness, please add :param method:, :param func:, and :param method: docstrings.","commit_id":"68e8883ad21a019dd73950f9cd3b9551cbd27371"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"9fc0622f0f9075138b96a87b9f8bea717d518c2b","unresolved":false,"context_lines":[{"line_number":424,"context_line":"        them as a VendorPassthruException after writing a log."},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"        Logs need to be added because even though the exception is being"},{"line_number":427,"context_line":"        reraised, it won\u0027t be handled if it is an async. call."},{"line_number":428,"context_line":"        \"\"\""},{"line_number":429,"context_line":"        passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":430,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa7fdbe_9b7fd765","line":427,"in_reply_to":"9aa7fdbe_3569cabe","updated":"2014-10-24 09:42:18.000000000","message":"Done","commit_id":"68e8883ad21a019dd73950f9cd3b9551cbd27371"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"759d9528b4cb3d86448d8c5a9f145747e1753d6d","unresolved":false,"context_lines":[{"line_number":428,"context_line":"        \"\"\""},{"line_number":429,"context_line":"        passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":430,"context_line":""},{"line_number":431,"context_line":"        def logged_function(*args, **kwargs):"},{"line_number":432,"context_line":"            try:"},{"line_number":433,"context_line":"                return func(*args, **kwargs)"},{"line_number":434,"context_line":"            except exception.IronicException as e:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa7fdbe_f52102a0","line":431,"updated":"2014-10-22 18:08:46.000000000","message":"maybe you can call this something else since it isn\u0027t just logging. Eg \u0027passthru_handler()\u0027.","commit_id":"68e8883ad21a019dd73950f9cd3b9551cbd27371"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"9fc0622f0f9075138b96a87b9f8bea717d518c2b","unresolved":false,"context_lines":[{"line_number":428,"context_line":"        \"\"\""},{"line_number":429,"context_line":"        passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":430,"context_line":""},{"line_number":431,"context_line":"        def logged_function(*args, **kwargs):"},{"line_number":432,"context_line":"            try:"},{"line_number":433,"context_line":"                return func(*args, **kwargs)"},{"line_number":434,"context_line":"            except exception.IronicException as e:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa7fdbe_bb973b8f","line":431,"in_reply_to":"9aa7fdbe_f52102a0","updated":"2014-10-24 09:42:18.000000000","message":"Done","commit_id":"68e8883ad21a019dd73950f9cd3b9551cbd27371"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"cfb5b08c628dc7d8872843652aecc37d45184b2a","unresolved":false,"context_lines":[{"line_number":354,"context_line":"        \"\"\""},{"line_number":355,"context_line":""},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"def register_passthru(method):"},{"line_number":358,"context_line":"    \"\"\"A decorator for registering a function as a passthru function."},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"    handle_passthru returns a new function that wraps func in a try"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_02f14f95","line":357,"updated":"2014-10-29 12:02:20.000000000","message":"Also, instead of accepting method name, you could just take function __name__ (probably dropping leading _)","commit_id":"43e667d3cf36e9d1da78a5a836991dfd9aa29636"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"b58c335cf30c241f2c10bbc57d968864ca5c0de0","unresolved":false,"context_lines":[{"line_number":354,"context_line":"        \"\"\""},{"line_number":355,"context_line":""},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"def register_passthru(method):"},{"line_number":358,"context_line":"    \"\"\"A decorator for registering a function as a passthru function."},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"    handle_passthru returns a new function that wraps func in a try"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_a213230c","line":357,"updated":"2014-10-29 11:58:55.000000000","message":"I don\u0027t insist, but looks like names of decorators are usually nouns, describing what the decorated function is, so IMO it should be just passthru().\n\nEven if you don\u0027t agree with just \"passthru\", it should not be called \"register\" - it does not register anything.","commit_id":"43e667d3cf36e9d1da78a5a836991dfd9aa29636"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"206bb48c74250472ecc3ba1cbe0eea08ddb78c7e","unresolved":false,"context_lines":[{"line_number":354,"context_line":"        \"\"\""},{"line_number":355,"context_line":""},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"def register_passthru(method):"},{"line_number":358,"context_line":"    \"\"\"A decorator for registering a function as a passthru function."},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"    handle_passthru returns a new function that wraps func in a try"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_7d0e3ae7","line":357,"in_reply_to":"9aa7fdbe_02f14f95","updated":"2014-10-29 12:36:40.000000000","message":"This isn\u0027t necessarily the function name this is the string that is passed to the vendor_passthru function to decide the action to take.","commit_id":"43e667d3cf36e9d1da78a5a836991dfd9aa29636"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"b58c335cf30c241f2c10bbc57d968864ca5c0de0","unresolved":false,"context_lines":[{"line_number":357,"context_line":"def register_passthru(method):"},{"line_number":358,"context_line":"    \"\"\"A decorator for registering a function as a passthru function."},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"    handle_passthru returns a new function that wraps func in a try"},{"line_number":361,"context_line":"    except ready to catch any ironic exceptions and reraise them after"},{"line_number":362,"context_line":"    logging the issue. It also catches non-ironic exceptions reraising"},{"line_number":363,"context_line":"    them as a VendorPassthruException after writing a log."}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_62305b9f","line":360,"updated":"2014-10-29 11:58:55.000000000","message":"I don\u0027t think you should mention internal function name (handle_passthru) in the docstring.","commit_id":"43e667d3cf36e9d1da78a5a836991dfd9aa29636"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"206bb48c74250472ecc3ba1cbe0eea08ddb78c7e","unresolved":false,"context_lines":[{"line_number":357,"context_line":"def register_passthru(method):"},{"line_number":358,"context_line":"    \"\"\"A decorator for registering a function as a passthru function."},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"    handle_passthru returns a new function that wraps func in a try"},{"line_number":361,"context_line":"    except ready to catch any ironic exceptions and reraise them after"},{"line_number":362,"context_line":"    logging the issue. It also catches non-ironic exceptions reraising"},{"line_number":363,"context_line":"    them as a VendorPassthruException after writing a log."}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_5dcb361e","line":360,"in_reply_to":"9aa7fdbe_62305b9f","updated":"2014-10-29 12:36:40.000000000","message":"Done","commit_id":"43e667d3cf36e9d1da78a5a836991dfd9aa29636"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3ff8707cc8993e8004d2fdb02f99720b6d0c6d8c","unresolved":false,"context_lines":[{"line_number":370,"context_line":"    def handle_passthru(func):"},{"line_number":371,"context_line":"        passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"        def passthru_handler(*args, **kwargs):"},{"line_number":374,"context_line":"            try:"},{"line_number":375,"context_line":"                return func(*args, **kwargs)"},{"line_number":376,"context_line":"            except exception.IronicException as e:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_9a221ba1","line":373,"updated":"2014-10-28 18:05:59.000000000","message":"We should wrap the decoratored function so we don\u0027t lose the meta informations about it[1] :\n\n @functools.wrap(func)\n def passthru_handler(*args, **kwargs):\n    ...\n\n[1] http://stackoverflow.com/questions/308999/what-does-functools-wraps-do","commit_id":"43e667d3cf36e9d1da78a5a836991dfd9aa29636"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"206bb48c74250472ecc3ba1cbe0eea08ddb78c7e","unresolved":false,"context_lines":[{"line_number":370,"context_line":"    def handle_passthru(func):"},{"line_number":371,"context_line":"        passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"        def passthru_handler(*args, **kwargs):"},{"line_number":374,"context_line":"            try:"},{"line_number":375,"context_line":"                return func(*args, **kwargs)"},{"line_number":376,"context_line":"            except exception.IronicException as e:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_7dd0fac9","line":373,"in_reply_to":"9aa7fdbe_9a221ba1","updated":"2014-10-29 12:36:40.000000000","message":"Done","commit_id":"43e667d3cf36e9d1da78a5a836991dfd9aa29636"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e4b9cf52d2b29950d47a8ba5b796184f945dd877","unresolved":false,"context_lines":[{"line_number":355,"context_line":"        \"\"\""},{"line_number":356,"context_line":""},{"line_number":357,"context_line":""},{"line_number":358,"context_line":"def register_passthru(method):"},{"line_number":359,"context_line":"    \"\"\"A decorator for registering a function as a passthru function."},{"line_number":360,"context_line":""},{"line_number":361,"context_line":"    Decorator ensures function is ready to catch any ironic exceptions"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa7fdbe_9d3f5ed6","line":358,"updated":"2014-10-29 12:44:32.000000000","message":"writing things like\n\n @register_passthru(\u0027method\u0027)\n def method(...)\n\nseems redundant to me, but as you wish.\n\nThe last thing from the previous patchset: please do not call it \"register\". It\u0027s not doing any registration. I would prefer a noun like \"passthru\".","commit_id":"c73acd253a13df045d8edb835fe6dc129d7c14ae"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"cf4b1333f5354b71174ffe74a76eb4258993f0ed","unresolved":false,"context_lines":[{"line_number":355,"context_line":"        \"\"\""},{"line_number":356,"context_line":""},{"line_number":357,"context_line":""},{"line_number":358,"context_line":"def register_passthru(method):"},{"line_number":359,"context_line":"    \"\"\"A decorator for registering a function as a passthru function."},{"line_number":360,"context_line":""},{"line_number":361,"context_line":"    Decorator ensures function is ready to catch any ironic exceptions"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa7fdbe_04ca3a6e","line":358,"in_reply_to":"9aa7fdbe_9d3f5ed6","updated":"2014-10-29 13:43:19.000000000","message":"Patch set 10 shortens the name to @passthru","commit_id":"c73acd253a13df045d8edb835fe6dc129d7c14ae"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2ce8f8b1058e54fc01023ced865df1892f3b51a6","unresolved":false,"context_lines":[{"line_number":366,"context_line":"    Logs need to be added because even though the exception is being"},{"line_number":367,"context_line":"    reraised, it won\u0027t be handled if it is an async. call."},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    :param method: an arbitrary string describing the action to be taken."},{"line_number":370,"context_line":"    \"\"\""},{"line_number":371,"context_line":"    def handle_passthru(func):"},{"line_number":372,"context_line":"        api_method \u003d method"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a8c0949_2c5e2be7","line":369,"updated":"2014-10-31 10:06:18.000000000","message":"maybe worth saying that this is the name that will be exposed in the API, and if not given we are going to use the function __name__ for it.","commit_id":"e129faef1762b8335b226298554ed83204c2696a"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"52824cd369946ca418c95b03fb82d0b12dc6b04b","unresolved":false,"context_lines":[{"line_number":369,"context_line":"    :param method: an arbitrary string describing the action to be taken."},{"line_number":370,"context_line":"    \"\"\""},{"line_number":371,"context_line":"    def handle_passthru(func):"},{"line_number":372,"context_line":"        api_method \u003d method"},{"line_number":373,"context_line":"        if api_method is None:"},{"line_number":374,"context_line":"            api_method \u003d func.__name__"},{"line_number":375,"context_line":"        passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9aa7fdbe_2adaa517","line":372,"updated":"2014-10-29 14:32:54.000000000","message":"no point in having this variable","commit_id":"e129faef1762b8335b226298554ed83204c2696a"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"6436dd9dc15f42b2b724b5fa4e746c21c1cc8965","unresolved":false,"context_lines":[{"line_number":369,"context_line":"    :param method: an arbitrary string describing the action to be taken."},{"line_number":370,"context_line":"    \"\"\""},{"line_number":371,"context_line":"    def handle_passthru(func):"},{"line_number":372,"context_line":"        api_method \u003d method"},{"line_number":373,"context_line":"        if api_method is None:"},{"line_number":374,"context_line":"            api_method \u003d func.__name__"},{"line_number":375,"context_line":"        passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a8c0949_2cee2b89","line":372,"in_reply_to":"7a8c0949_6cf59382","updated":"2014-10-31 10:35:46.000000000","message":"Ah, you guys are right, odd... Cause we still using method, api_method \u003d method is referencing the method variable as. \n\nI\u0027m happy with the \"api_method \u003d method\" assigment for now then, but I will investigate why, just out of curiosity.\n\nThanks","commit_id":"e129faef1762b8335b226298554ed83204c2696a"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"a5d55d2a4ed28e367d02c94f6b5e105078f51315","unresolved":false,"context_lines":[{"line_number":369,"context_line":"    :param method: an arbitrary string describing the action to be taken."},{"line_number":370,"context_line":"    \"\"\""},{"line_number":371,"context_line":"    def handle_passthru(func):"},{"line_number":372,"context_line":"        api_method \u003d method"},{"line_number":373,"context_line":"        if api_method is None:"},{"line_number":374,"context_line":"            api_method \u003d func.__name__"},{"line_number":375,"context_line":"        passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9aa7fdbe_d5d9baf5","line":372,"in_reply_to":"9aa7fdbe_2adaa517","updated":"2014-10-31 10:16:59.000000000","message":"I tried this:\n\nif method is None:\n    method \u003d func.__name__\n\nand pep8 wouldn\u0027t pass because it didn\u0027t understand that method was in scope from the outer function, so it complained that method was being accessed before initialization.","commit_id":"e129faef1762b8335b226298554ed83204c2696a"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2ce8f8b1058e54fc01023ced865df1892f3b51a6","unresolved":false,"context_lines":[{"line_number":369,"context_line":"    :param method: an arbitrary string describing the action to be taken."},{"line_number":370,"context_line":"    \"\"\""},{"line_number":371,"context_line":"    def handle_passthru(func):"},{"line_number":372,"context_line":"        api_method \u003d method"},{"line_number":373,"context_line":"        if api_method is None:"},{"line_number":374,"context_line":"            api_method \u003d func.__name__"},{"line_number":375,"context_line":"        passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a8c0949_8c6c7f9e","line":372,"in_reply_to":"9aa7fdbe_2adaa517","updated":"2014-10-31 10:06:18.000000000","message":"yeah seems we could simply test if method is None:\n\n if method is None:\n     method \u003d func.__name__","commit_id":"e129faef1762b8335b226298554ed83204c2696a"},{"author":{"_account_id":7882,"name":"Yuiko Takada Mori","email":"yuiko-mori@nec.com","username":"YuikoTakada"},"change_message_id":"3d6d65bc2b75cfea56ef0eaabb1f020e764ee0f0","unresolved":false,"context_lines":[{"line_number":369,"context_line":"    :param method: an arbitrary string describing the action to be taken."},{"line_number":370,"context_line":"    \"\"\""},{"line_number":371,"context_line":"    def handle_passthru(func):"},{"line_number":372,"context_line":"        api_method \u003d method"},{"line_number":373,"context_line":"        if api_method is None:"},{"line_number":374,"context_line":"            api_method \u003d func.__name__"},{"line_number":375,"context_line":"        passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a8c0949_6cf59382","line":372,"in_reply_to":"9aa7fdbe_d5d9baf5","updated":"2014-10-31 10:21:36.000000000","message":"Me, too, Sam. I also tried to fix as Dmitry and Lucas say.\nBelow Error occured with ironic/tests/test_pxe_utils.py .\nUnboundLocalError: local variable \u0027method\u0027 referenced before assignment\nAre there some more codes which should be written...?","commit_id":"e129faef1762b8335b226298554ed83204c2696a"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2ce8f8b1058e54fc01023ced865df1892f3b51a6","unresolved":false,"context_lines":[{"line_number":372,"context_line":"        api_method \u003d method"},{"line_number":373,"context_line":"        if api_method is None:"},{"line_number":374,"context_line":"            api_method \u003d func.__name__"},{"line_number":375,"context_line":"        passthru_logmessage \u003d _LE(\u0027vendor_passthru failed with method %s\u0027)"},{"line_number":376,"context_line":""},{"line_number":377,"context_line":"        @functools.wraps(func)"},{"line_number":378,"context_line":"        def passthru_handler(*args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a8c0949_0c108f00","line":375,"updated":"2014-10-31 10:06:18.000000000","message":"super nit: This can be generated outside the function scope as well","commit_id":"e129faef1762b8335b226298554ed83204c2696a"}],"ironic/drivers/modules/fake.py":[{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"4ae8634102913abe3c10c2a2f3df642482909d4f","unresolved":false,"context_lines":[{"line_number":32,"context_line":"from ironic.openstack.common import log as logging"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def _raise_unsupported_error(method\u003dNone):"},{"line_number":38,"context_line":"    if method:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a8c0949_a8204e9c","line":35,"updated":"2014-10-30 22:24:34.000000000","message":"LOG isn\u0027t used. Is it needed?","commit_id":"e129faef1762b8335b226298554ed83204c2696a"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"a5d55d2a4ed28e367d02c94f6b5e105078f51315","unresolved":false,"context_lines":[{"line_number":32,"context_line":"from ironic.openstack.common import log as logging"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def _raise_unsupported_error(method\u003dNone):"},{"line_number":38,"context_line":"    if method:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a8c0949_2c154bf1","line":35,"in_reply_to":"7a8c0949_3bdd8771","updated":"2014-10-31 10:16:59.000000000","message":"Done","commit_id":"e129faef1762b8335b226298554ed83204c2696a"},{"author":{"_account_id":7882,"name":"Yuiko Takada Mori","email":"yuiko-mori@nec.com","username":"YuikoTakada"},"change_message_id":"318a6e748efb2e2644a0cb917698c1804fd7a92a","unresolved":false,"context_lines":[{"line_number":32,"context_line":"from ironic.openstack.common import log as logging"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def _raise_unsupported_error(method\u003dNone):"},{"line_number":38,"context_line":"    if method:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a8c0949_3bdd8771","line":35,"in_reply_to":"7a8c0949_a8204e9c","updated":"2014-10-31 04:56:37.000000000","message":"+1","commit_id":"e129faef1762b8335b226298554ed83204c2696a"}],"ironic/drivers/modules/ipmitool.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"25c6c292c6623b7c070c1dca365c13ed5aba1e54","unresolved":false,"context_lines":[{"line_number":793,"context_line":"                         \"the system path when checking ipmitool version\"))"},{"line_number":794,"context_line":""},{"line_number":795,"context_line":"    @base.passthru()"},{"line_number":796,"context_line":"    @task_manager.require_exclusive_lock"},{"line_number":797,"context_line":"    def send_raw(self, task, raw_bytes):"},{"line_number":798,"context_line":"        \"\"\"Send raw bytes to the BMC. Bytes should be a string of bytes."},{"line_number":799,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9aa7fdbe_8a863164","line":796,"updated":"2014-10-29 14:17:58.000000000","message":"@task_manager.require_exclusive_lock does not seem to use @functools.wraps, this may break using __name__. I think it should be fixed as well","commit_id":"18da2eddd36626ef66b9952970543705838f87c6"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"76b5ca30e40adfab4d4ab1b7cf62c5f6ef5a039c","unresolved":false,"context_lines":[{"line_number":793,"context_line":"                         \"the system path when checking ipmitool version\"))"},{"line_number":794,"context_line":""},{"line_number":795,"context_line":"    @base.passthru()"},{"line_number":796,"context_line":"    @task_manager.require_exclusive_lock"},{"line_number":797,"context_line":"    def send_raw(self, task, raw_bytes):"},{"line_number":798,"context_line":"        \"\"\"Send raw bytes to the BMC. Bytes should be a string of bytes."},{"line_number":799,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9aa7fdbe_aafdb570","line":796,"in_reply_to":"9aa7fdbe_8a863164","updated":"2014-10-29 14:31:27.000000000","message":"Done","commit_id":"18da2eddd36626ef66b9952970543705838f87c6"}],"ironic/tests/drivers/test_agent.py":[{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"06512f0e79dede82bb387a8057e9711759aab60a","unresolved":false,"context_lines":[{"line_number":338,"context_line":"    @mock.patch(\u0027ironic.drivers.modules.agent.AgentVendorInterface\u0027"},{"line_number":339,"context_line":"                \u0027.heartbeat\u0027)"},{"line_number":340,"context_line":"    def test_vendor_passthru_heartbeat(self, mock_heartbeat):"},{"line_number":341,"context_line":"        mock_heartbeat.__name__ \u003d \"heartbeat\""},{"line_number":342,"context_line":"        kwargs \u003d {"},{"line_number":343,"context_line":"            \u0027method\u0027: \u0027heartbeat\u0027,"},{"line_number":344,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":12,"id":"9aa7fdbe_6a490d8e","line":341,"updated":"2014-10-29 14:39:20.000000000","message":"I wonder if we can refactor these tests to not need this sort of thing...","commit_id":"e129faef1762b8335b226298554ed83204c2696a"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"a5d55d2a4ed28e367d02c94f6b5e105078f51315","unresolved":false,"context_lines":[{"line_number":338,"context_line":"    @mock.patch(\u0027ironic.drivers.modules.agent.AgentVendorInterface\u0027"},{"line_number":339,"context_line":"                \u0027.heartbeat\u0027)"},{"line_number":340,"context_line":"    def test_vendor_passthru_heartbeat(self, mock_heartbeat):"},{"line_number":341,"context_line":"        mock_heartbeat.__name__ \u003d \"heartbeat\""},{"line_number":342,"context_line":"        kwargs \u003d {"},{"line_number":343,"context_line":"            \u0027method\u0027: \u0027heartbeat\u0027,"},{"line_number":344,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a8c0949_ac73fb4b","line":341,"in_reply_to":"9aa7fdbe_6a490d8e","updated":"2014-10-31 10:16:59.000000000","message":"Done","commit_id":"e129faef1762b8335b226298554ed83204c2696a"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"06512f0e79dede82bb387a8057e9711759aab60a","unresolved":false,"context_lines":[{"line_number":343,"context_line":"            \u0027method\u0027: \u0027heartbeat\u0027,"},{"line_number":344,"context_line":"        }"},{"line_number":345,"context_line":"        self.passthru.vendor_routes[\u0027heartbeat\u0027] \u003d ("},{"line_number":346,"context_line":"            driver_base.passthru(\u0027heartbeat\u0027)(mock_heartbeat))"},{"line_number":347,"context_line":"        with task_manager.acquire("},{"line_number":348,"context_line":"                self.context, self.node[\u0027uuid\u0027], shared\u003dTrue) as task:"},{"line_number":349,"context_line":"            self.passthru.vendor_passthru(task, **kwargs)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9aa7fdbe_aa43f56a","line":346,"updated":"2014-10-29 14:39:20.000000000","message":"Ditto","commit_id":"e129faef1762b8335b226298554ed83204c2696a"}],"ironic/tests/drivers/test_base.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"9651b2779f5646974647fd8ef62fc9b2cb3e0516","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        fvi \u003d FakeVendorInterface()"},{"line_number":37,"context_line":"        logger \u003d mock.Mock()"},{"line_number":38,"context_line":"        passthru \u003d fvi._handle_passthru(logger, method.__name__, method)"},{"line_number":39,"context_line":"        self.assertEqual(callable(passthru), True)"},{"line_number":40,"context_line":"        return passthru, logger"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def test__handle_passthru_noexception(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aa7fdbe_fea17b46","line":39,"updated":"2014-10-27 18:31:26.000000000","message":"The order of the parameters is (expected, actual), so this should be (True, callable(passthru)).\n\nHaving said that, why not just self.assertTrue(callable(passthru))?","commit_id":"cda9c06d7a6ddef725ef1a060b7c170d50ffaec0"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"4d1a3433309d3fa4d220b831bd9c6531a77b6556","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        fvi \u003d FakeVendorInterface()"},{"line_number":37,"context_line":"        logger \u003d mock.Mock()"},{"line_number":38,"context_line":"        passthru \u003d fvi._handle_passthru(logger, method.__name__, method)"},{"line_number":39,"context_line":"        self.assertEqual(callable(passthru), True)"},{"line_number":40,"context_line":"        return passthru, logger"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def test__handle_passthru_noexception(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aa7fdbe_3c1a1cc6","line":39,"in_reply_to":"9aa7fdbe_fea17b46","updated":"2014-10-28 10:10:46.000000000","message":"Done","commit_id":"cda9c06d7a6ddef725ef1a060b7c170d50ffaec0"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"9651b2779f5646974647fd8ef62fc9b2cb3e0516","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        passthru, logger \u003d self._common_handle_passthru(fakevendorpassthru)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        result \u003d passthru()"},{"line_number":49,"context_line":"        self.assertEqual(result, fakevendorpassthru())"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def test__handle_passthru_ironicexception(self):"},{"line_number":52,"context_line":"        def fakevendorpassthru():"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aa7fdbe_7e8d8bd2","line":49,"updated":"2014-10-27 18:31:26.000000000","message":"The order of the parameters should be reversed, (expected, actual).","commit_id":"cda9c06d7a6ddef725ef1a060b7c170d50ffaec0"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"4d1a3433309d3fa4d220b831bd9c6531a77b6556","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        passthru, logger \u003d self._common_handle_passthru(fakevendorpassthru)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        result \u003d passthru()"},{"line_number":49,"context_line":"        self.assertEqual(result, fakevendorpassthru())"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def test__handle_passthru_ironicexception(self):"},{"line_number":52,"context_line":"        def fakevendorpassthru():"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aa7fdbe_5c7c40ec","line":49,"in_reply_to":"9aa7fdbe_7e8d8bd2","updated":"2014-10-28 10:10:46.000000000","message":"Done","commit_id":"cda9c06d7a6ddef725ef1a060b7c170d50ffaec0"}]}
