)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"9c835fe284e67090eb3b850892b38ad439177e8f","unresolved":false,"context_lines":[{"line_number":12,"context_line":"until the lock_dir is manually removed."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"- Move create/remove lock code into methods"},{"line_number":15,"context_line":"- Wrap the get_async_count/dump_cron_cache calls wit bettwe exception"},{"line_number":16,"context_line":"handling to ensure the lock_dir is always removed"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I7bfe4c7871aa5fbc77078344dffe0e2a0bb2fc2e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAATn%2F%2BDpY%3D","line":15,"updated":"2013-12-03 00:15:12.000000000","message":"\"wit bettwe\"?","commit_id":"d0b27f179600d46319cb7f137785d0608d50127f"}],"bin/swift-recon-cron":[{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"9c835fe284e67090eb3b850892b38ad439177e8f","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    lock_dir \u003d os.path.join(recon_lock_path, \"swift-recon-object-cron\")"},{"line_number":72,"context_line":"    conf[\u0027log_name\u0027] \u003d conf.get(\u0027log_name\u0027, \u0027recon-cron\u0027)"},{"line_number":73,"context_line":"    logger \u003d get_logger(conf, log_route\u003d\u0027recon-cron\u0027)"},{"line_number":74,"context_line":"    create_lock(lock_dir, logger)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    try:"},{"line_number":77,"context_line":"        asyncs \u003d get_async_count(device_dir, logger)"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAATn%2F%2BDqk%3D","line":74,"updated":"2013-12-03 00:15:12.000000000","message":"I\u0027m not going to hold the patch for this, but moving sys.exit() from main() is not a good thing. I understand that this change is simple and expeditious and creates a matching bracket for remove_lock(), but still please consider.\n\nThere\u0027s an excellent example of side effects from scattering sys.exit() all around, only a few lines below.","commit_id":"d0b27f179600d46319cb7f137785d0608d50127f"},{"author":{"_account_id":6714,"name":"Christopher H. Laco","email":"chris.laco@rackspace.com","username":"chrislaco"},"change_message_id":"f243043a61dfca5ac812105aca36388a1c4a0b0a","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    lock_dir \u003d os.path.join(recon_lock_path, \"swift-recon-object-cron\")"},{"line_number":72,"context_line":"    conf[\u0027log_name\u0027] \u003d conf.get(\u0027log_name\u0027, \u0027recon-cron\u0027)"},{"line_number":73,"context_line":"    logger \u003d get_logger(conf, log_route\u003d\u0027recon-cron\u0027)"},{"line_number":74,"context_line":"    create_lock(lock_dir, logger)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    try:"},{"line_number":77,"context_line":"        asyncs \u003d get_async_count(device_dir, logger)"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAATn%2F%2BDBU%3D","line":74,"in_reply_to":"AAAATn%2F%2BDqk%3D","updated":"2013-12-03 03:43:43.000000000","message":"Valid point. Not really sure about the overall coding style of the various scripts, but I went for a few methods to try and make main() a bit shorter. I\u0027m happy enough to undo this black if if matches the overall style of the changes below.","commit_id":"d0b27f179600d46319cb7f137785d0608d50127f"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"9c835fe284e67090eb3b850892b38ad439177e8f","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        asyncs \u003d get_async_count(device_dir, logger)"},{"line_number":78,"context_line":"    except Exception as e:"},{"line_number":79,"context_line":"        remove_lock(lock_dir, logger)"},{"line_number":80,"context_line":"        logger.exception("},{"line_number":81,"context_line":"            _(\u0027Exception during recon-cron while accessing devices\u0027))"},{"line_number":82,"context_line":"        print str(e)"},{"line_number":83,"context_line":"        sys.exit(1)"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAATn%2F%2BDqI%3D","line":80,"updated":"2013-12-03 00:15:12.000000000","message":"Logs out of order in case of exception. Find a better way.","commit_id":"d0b27f179600d46319cb7f137785d0608d50127f"},{"author":{"_account_id":6714,"name":"Christopher H. Laco","email":"chris.laco@rackspace.com","username":"chrislaco"},"change_message_id":"f243043a61dfca5ac812105aca36388a1c4a0b0a","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        asyncs \u003d get_async_count(device_dir, logger)"},{"line_number":78,"context_line":"    except Exception as e:"},{"line_number":79,"context_line":"        remove_lock(lock_dir, logger)"},{"line_number":80,"context_line":"        logger.exception("},{"line_number":81,"context_line":"            _(\u0027Exception during recon-cron while accessing devices\u0027))"},{"line_number":82,"context_line":"        print str(e)"},{"line_number":83,"context_line":"        sys.exit(1)"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAATn%2F%2BDBg%3D","line":80,"in_reply_to":"AAAATn%2F%2BDqI%3D","updated":"2013-12-03 03:43:43.000000000","message":"I think I just missed the obvious order of operations here. Are you ok with simply revering these lines?","commit_id":"d0b27f179600d46319cb7f137785d0608d50127f"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"9c835fe284e67090eb3b850892b38ad439177e8f","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            _(\u0027Exception during recon-cron while dumping cache\u0027))"},{"line_number":90,"context_line":"        print str(e)"},{"line_number":91,"context_line":"        sys.exit(1)"},{"line_number":92,"context_line":"    finally:"},{"line_number":93,"context_line":"        remove_lock(lock_dir, logger)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAATn%2F%2BDpc%3D","line":92,"updated":"2013-12-03 00:15:12.000000000","message":"Does this actually work as you expect (e.g. sys.exit() raises, but does it end in finally: in such case?)","commit_id":"d0b27f179600d46319cb7f137785d0608d50127f"},{"author":{"_account_id":6714,"name":"Christopher H. Laco","email":"chris.laco@rackspace.com","username":"chrislaco"},"change_message_id":"f243043a61dfca5ac812105aca36388a1c4a0b0a","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            _(\u0027Exception during recon-cron while dumping cache\u0027))"},{"line_number":90,"context_line":"        print str(e)"},{"line_number":91,"context_line":"        sys.exit(1)"},{"line_number":92,"context_line":"    finally:"},{"line_number":93,"context_line":"        remove_lock(lock_dir, logger)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAATn%2F%2BDEw%3D","line":92,"in_reply_to":"AAAATn%2F%2BDpc%3D","updated":"2013-12-03 03:43:43.000000000","message":"Actually, it does. I tested the script by changing the cache_file param to cache_files and it actually does print the exception and finally removed the lock_dir.","commit_id":"d0b27f179600d46319cb7f137785d0608d50127f"}]}
