)]}'
{"glance/cmd/cache_manage.py":[{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"a9dc32ede3dcb42dcc44cdf5da0e73fbaa06fab7","unresolved":false,"context_lines":[{"line_number":426,"context_line":"        parser.print_help()"},{"line_number":427,"context_line":"        sys.exit(0)"},{"line_number":428,"context_line":"    if len(args) !\u003d 1:"},{"line_number":429,"context_line":"        sys.exit(\"Please specify one command\")"},{"line_number":430,"context_line":""},{"line_number":431,"context_line":"    command_name \u003d args.pop()"},{"line_number":432,"context_line":"    command \u003d lookup_command(parser, command_name)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_61a34c50","line":429,"updated":"2016-01-13 17:00:47.000000000","message":"It does seem that other glance CLIs return `error: unrecognized arguments` in this case. Maybe this would be an improvement on the others.","commit_id":"faf123b96a66768bfe94fcce84ad3e1c15bc037b"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"a148f578ed01489a048c4ad354bba35172b7ed3f","unresolved":false,"context_lines":[{"line_number":426,"context_line":"        parser.print_help()"},{"line_number":427,"context_line":"        sys.exit(0)"},{"line_number":428,"context_line":"    if len(args) !\u003d 1:"},{"line_number":429,"context_line":"        sys.exit(\"Please specify one command\")"},{"line_number":430,"context_line":""},{"line_number":431,"context_line":"    command_name \u003d args.pop()"},{"line_number":432,"context_line":"    command \u003d lookup_command(parser, command_name)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_96846d5e","line":429,"in_reply_to":"da6ed579_61a34c50","updated":"2016-01-14 02:18:30.000000000","message":"if the command like: glance-cache-manage help 1\nit will return \"Unknown command: 1\"\nif the command like: glance-cache-manage help  list-cached 1\nit will return \"Please specify one command\"\n\nSo maybe it\u0027s ok here?","commit_id":"faf123b96a66768bfe94fcce84ad3e1c15bc037b"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"6abc34d821508f8da03241d8d208d08554da59fe","unresolved":false,"context_lines":[{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    if not args:"},{"line_number":426,"context_line":"        parser.print_help()"},{"line_number":427,"context_line":"        sys.exit(0)"},{"line_number":428,"context_line":"    if len(args) !\u003d 1:"},{"line_number":429,"context_line":"        sys.exit(\"Please specify one command\")"},{"line_number":430,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_50dc0b46","line":427,"range":{"start_line":427,"start_character":12,"end_line":427,"end_character":16},"updated":"2016-01-18 10:51:23.000000000","message":"Looks like we shouldn\u0027t exit here because the result printed here:\nhttps://github.com/openstack/glance/blob/master/glance/cmd/cache_manage.py#L515","commit_id":"0a9e3b6677f4e6eae1f90dec668eae7c31036e60"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"b385d18c8341704ee4e8181327e83221fa74d02b","unresolved":false,"context_lines":[{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    if not args:"},{"line_number":426,"context_line":"        parser.print_help()"},{"line_number":427,"context_line":"        sys.exit(0)"},{"line_number":428,"context_line":"    if len(args) !\u003d 1:"},{"line_number":429,"context_line":"        sys.exit(\"Please specify one command\")"},{"line_number":430,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_665b952f","line":427,"range":{"start_line":427,"start_character":12,"end_line":427,"end_character":16},"in_reply_to":"da6ed579_50dc0b46","updated":"2016-01-18 11:15:11.000000000","message":"Nope, if user only use \"glance-cache-manage help\", the program should be stop here. And there is no return value in this function.\n\nparser.print_help() will print the help message to screen.","commit_id":"0a9e3b6677f4e6eae1f90dec668eae7c31036e60"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"4b726b24d5faa7069d1da75fb3a0154f76f94725","unresolved":false,"context_lines":[{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    if not args:"},{"line_number":426,"context_line":"        parser.print_help()"},{"line_number":427,"context_line":"        sys.exit(0)"},{"line_number":428,"context_line":"    if len(args) !\u003d 1:"},{"line_number":429,"context_line":"        sys.exit(\"Please specify one command\")"},{"line_number":430,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_8687a911","line":427,"range":{"start_line":427,"start_character":12,"end_line":427,"end_character":16},"in_reply_to":"da6ed579_665b952f","updated":"2016-01-18 11:19:55.000000000","message":"Hmm.. Just a question, why don\u0027t we stop here if glance-cache-manage help \u003csubcommand\u003e was executed? What\u0027s the difference between these 2 cases.","commit_id":"0a9e3b6677f4e6eae1f90dec668eae7c31036e60"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"60e1e1123331884e4c96f5031156b11b039e3728","unresolved":false,"context_lines":[{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    if not args:"},{"line_number":426,"context_line":"        parser.print_help()"},{"line_number":427,"context_line":"        sys.exit(0)"},{"line_number":428,"context_line":"    if len(args) !\u003d 1:"},{"line_number":429,"context_line":"        sys.exit(\"Please specify one command\")"},{"line_number":430,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_a1a5f7b5","line":427,"range":{"start_line":427,"start_character":12,"end_line":427,"end_character":16},"in_reply_to":"da6ed579_8687a911","updated":"2016-01-18 11:42:50.000000000","message":"If we don\u0027t exit here. the sys.exit(\"Please specify one command\") at L429 will be printed. of cause we can remove the exit() here and let L428 bee \"len(args) \u003e 1\".  It both works.\n\nWith the suggestion you wrote below, I can remove the exit() here. Just feel free","commit_id":"0a9e3b6677f4e6eae1f90dec668eae7c31036e60"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"6abc34d821508f8da03241d8d208d08554da59fe","unresolved":false,"context_lines":[{"line_number":428,"context_line":"    if len(args) !\u003d 1:"},{"line_number":429,"context_line":"        sys.exit(\"Please specify one command\")"},{"line_number":430,"context_line":""},{"line_number":431,"context_line":"    command_name \u003d args.pop()"},{"line_number":432,"context_line":"    command \u003d lookup_command(parser, command_name)"},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"    print(command.__doc__ % {\u0027prog\u0027: os.path.basename(sys.argv[0])})"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_90b5a3d1","line":431,"updated":"2016-01-18 10:51:23.000000000","message":"I also would recommend to re-structurize the code like this:\nnumber_of_commands \u003d len(args)\nif number_of_commands \u003d\u003d 0:\n   #print common help\nelif number_of_commands \u003d\u003d 1:\n   #print specific help\nelse:\n   #raise an error.\nIMO, it is a bit clearer to the contributors.","commit_id":"0a9e3b6677f4e6eae1f90dec668eae7c31036e60"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"b385d18c8341704ee4e8181327e83221fa74d02b","unresolved":false,"context_lines":[{"line_number":428,"context_line":"    if len(args) !\u003d 1:"},{"line_number":429,"context_line":"        sys.exit(\"Please specify one command\")"},{"line_number":430,"context_line":""},{"line_number":431,"context_line":"    command_name \u003d args.pop()"},{"line_number":432,"context_line":"    command \u003d lookup_command(parser, command_name)"},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"    print(command.__doc__ % {\u0027prog\u0027: os.path.basename(sys.argv[0])})"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_ab9f16b3","line":431,"in_reply_to":"da6ed579_90b5a3d1","updated":"2016-01-18 11:15:11.000000000","message":"Sure, it looks better. BTW, NoneType has no len()","commit_id":"0a9e3b6677f4e6eae1f90dec668eae7c31036e60"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"d6330215390c1859b569e7894d29d5ea8cf25cc5","unresolved":false,"context_lines":[{"line_number":422,"context_line":"    \"\"\""},{"line_number":423,"context_line":"    parser \u003d options.__parser"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    if not args:"},{"line_number":426,"context_line":"        parser.print_help()"},{"line_number":427,"context_line":""},{"line_number":428,"context_line":"    number_of_commands \u003d len(args)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_b25a264f","line":425,"range":{"start_line":425,"start_character":7,"end_line":425,"end_character":10},"updated":"2016-01-21 11:45:18.000000000","message":"Not reason for -1 but why it is not included into if condition below?\nEvery time we don\u0027t have args we are calculating len(arg).\nIt doesn\u0027t lead to big performance but adding \nif not args:\n   #\nelse:\n   number of commands \u003d len(args)\nIMO is a little but clearer.","commit_id":"426bf1e8b3c2889ca7f95079a2ee0b8640f26e48"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"e0b7561f0fb2f1af6071349b08c4b609d7ad26a4","unresolved":false,"context_lines":[{"line_number":422,"context_line":"    \"\"\""},{"line_number":423,"context_line":"    parser \u003d options.__parser"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    if not args:"},{"line_number":426,"context_line":"        parser.print_help()"},{"line_number":427,"context_line":""},{"line_number":428,"context_line":"    number_of_commands \u003d len(args)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_c364854a","line":425,"range":{"start_line":425,"start_character":7,"end_line":425,"end_character":10},"in_reply_to":"9a68dd71_b25a264f","updated":"2016-01-22 03:10:33.000000000","message":"Done","commit_id":"426bf1e8b3c2889ca7f95079a2ee0b8640f26e48"}],"glance/cmd/replicator.py":[{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"50a29e9bbec18a122901c4de774557a9cb6c6e69","unresolved":false,"context_lines":[{"line_number":660,"context_line":"    options: the parsed command line options"},{"line_number":661,"context_line":"    args: the command line"},{"line_number":662,"context_line":"    \"\"\""},{"line_number":663,"context_line":"    if args is None:"},{"line_number":664,"context_line":"        print(COMMANDS)"},{"line_number":665,"context_line":"        sys.exit(1)"},{"line_number":666,"context_line":"    command_name \u003d args.pop()"}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_28035eba","line":663,"range":{"start_line":663,"start_character":0,"end_line":663,"end_character":4},"updated":"2016-01-12 03:52:24.000000000","message":"(nit): How about using if not args","commit_id":"bb1dd5fb7685b5f7b96bece69941233e957480dc"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"6abc34d821508f8da03241d8d208d08554da59fe","unresolved":false,"context_lines":[{"line_number":660,"context_line":"    options: the parsed command line options"},{"line_number":661,"context_line":"    args: the command line"},{"line_number":662,"context_line":"    \"\"\""},{"line_number":663,"context_line":"    if not args:"},{"line_number":664,"context_line":"        print(COMMANDS)"},{"line_number":665,"context_line":"        sys.exit(1)"},{"line_number":666,"context_line":"    command_name \u003d args.pop()"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_b0646749","line":663,"range":{"start_line":663,"start_character":11,"end_line":663,"end_character":15},"updated":"2016-01-18 10:51:23.000000000","message":"Are we going to raise some error if there is two or more sub-commands in args? It seems inconsistent that we have this behavior for cache_manage but we do the different thing for replicator.","commit_id":"0a9e3b6677f4e6eae1f90dec668eae7c31036e60"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"b385d18c8341704ee4e8181327e83221fa74d02b","unresolved":false,"context_lines":[{"line_number":660,"context_line":"    options: the parsed command line options"},{"line_number":661,"context_line":"    args: the command line"},{"line_number":662,"context_line":"    \"\"\""},{"line_number":663,"context_line":"    if not args:"},{"line_number":664,"context_line":"        print(COMMANDS)"},{"line_number":665,"context_line":"        sys.exit(1)"},{"line_number":666,"context_line":"    command_name \u003d args.pop()"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_8b8ed225","line":663,"range":{"start_line":663,"start_character":11,"end_line":663,"end_character":15},"in_reply_to":"da6ed579_b0646749","updated":"2016-01-18 11:15:11.000000000","message":"Done","commit_id":"0a9e3b6677f4e6eae1f90dec668eae7c31036e60"}]}
