)]}'
{"rally/task/validation.py":[{"author":{"_account_id":7369,"name":"Sergey Skripnick","email":"sskripnick@mirantis.com","username":"redixin"},"change_message_id":"19bae1a47c365c91a87ada22b755309e50b135cd","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    :param required: Boolean indicating whether this argument is required."},{"line_number":163,"context_line":"    \"\"\""},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    return _file_access_ok("},{"line_number":166,"context_line":"        config.get(\"args\", {}).get(os.path.expanduser(param_name)),"},{"line_number":167,"context_line":"        mode, param_name, required"},{"line_number":168,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_00b19fdf","line":165,"updated":"2015-09-07 16:45:40.000000000","message":"File path should not be modified here. It should check path as is","commit_id":"4dda573fcc809140711d3da762b67711d06545d5"},{"author":{"_account_id":8592,"name":"Anastasia Kuznetsova","email":"akuznetsova@mirantis.com","username":"nastya-kuz"},"change_message_id":"1fbbbc0067d5a1a23be87024d62509638bf15006","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    :param required: Boolean indicating whether this argument is required."},{"line_number":163,"context_line":"    \"\"\""},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    return _file_access_ok("},{"line_number":166,"context_line":"        config.get(\"args\", {}).get(os.path.expanduser(param_name)),"},{"line_number":167,"context_line":"        mode, param_name, required"},{"line_number":168,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_bb9346a2","line":165,"in_reply_to":"da20952f_00b19fdf","updated":"2015-09-07 17:08:20.000000000","message":"I will add one more class to types to modify path before","commit_id":"4dda573fcc809140711d3da762b67711d06545d5"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"d100d3e064f95371a28f81f803f4338b7d1ab728","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    if not filename:"},{"line_number":136,"context_line":"        return ValidationResult(not required,"},{"line_number":137,"context_line":"                                \"Parameter %s required\" % param_name)"},{"line_number":138,"context_line":"    if not os.access(os.path.expanduser(filename), mode):"},{"line_number":139,"context_line":"        return ValidationResult("},{"line_number":140,"context_line":"            False, \"Could not open %(filename)s with mode %(mode)s \""},{"line_number":141,"context_line":"            \"for parameter %(param_name)s\""}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_a867ebb5","line":138,"updated":"2015-09-16 10:17:12.000000000","message":"This change looks reasonable, however in some cases it actually makes validation wrong, because we can not be sure that code, which uses this validation, is also uses os.path.expanduser.\n\nFor example, here is a real case when validation becomes useless:\n\nIf we use script\u003d\"~/path/to/existent/script\" in scenario VMTasks.boot_runcommand_delete, the validation will pass, but the scenario will fail with error:\n\nInvalid scenario argument: \u0027Could not open ~/path/to/existent/script with mode 4 for parameter script\u0027\n\nAny ideas how to deal with this?","commit_id":"15bd711582e69443fd4f9109046bd6eba55be119"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"bd360cfc06530bd097a177fe918b1a09f93e6132","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    if not filename:"},{"line_number":136,"context_line":"        return ValidationResult(not required,"},{"line_number":137,"context_line":"                                \"Parameter %s required\" % param_name)"},{"line_number":138,"context_line":"    if not os.access(os.path.expanduser(filename), mode):"},{"line_number":139,"context_line":"        return ValidationResult("},{"line_number":140,"context_line":"            False, \"Could not open %(filename)s with mode %(mode)s \""},{"line_number":141,"context_line":"            \"for parameter %(param_name)s\""}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_ebe63d14","line":138,"in_reply_to":"ba15a1d1_a867ebb5","updated":"2015-09-16 10:35:07.000000000","message":"Imo, the problem you describe relates to VMTasks.boot_runcommand_delete, not to this validator.","commit_id":"15bd711582e69443fd4f9109046bd6eba55be119"},{"author":{"_account_id":8592,"name":"Anastasia Kuznetsova","email":"akuznetsova@mirantis.com","username":"nastya-kuz"},"change_message_id":"e6225466d32f9d91bf0e5da53011dbe9242a8d77","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    if not filename:"},{"line_number":136,"context_line":"        return ValidationResult(not required,"},{"line_number":137,"context_line":"                                \"Parameter %s required\" % param_name)"},{"line_number":138,"context_line":"    if not os.access(os.path.expanduser(filename), mode):"},{"line_number":139,"context_line":"        return ValidationResult("},{"line_number":140,"context_line":"            False, \"Could not open %(filename)s with mode %(mode)s \""},{"line_number":141,"context_line":"            \"for parameter %(param_name)s\""}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_bcf72958","line":138,"in_reply_to":"ba15a1d1_ebe63d14","updated":"2015-09-16 12:08:58.000000000","message":"As you can see from error message, problem is that path was not expanded. So I am trying to fix it)\n\ne.g:\n\n\u003e\u003e\u003e f \u003d \"/home/ubuntu/rally/etc\"\n\n\u003e\u003e\u003e if not os.access(f, os.R_OK):\n\n...    print (\"%s\" % f)\n\n... \n\n\u003e\u003e\u003e f \u003d \"~/rally/etc\"\n\n\u003e\u003e\u003e if not os.access(f, os.R_OK):\n\n...    print (\"%s\" % f)\n\n... \n\n~/rally/etc\n\n\u003e\u003e\u003e if not os.access(os.path.expanduser(f), os.R_OK):\n\n...    print (\"%s\" % f)\n\n... \n\n\u003e\u003e\u003e","commit_id":"15bd711582e69443fd4f9109046bd6eba55be119"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"bd360cfc06530bd097a177fe918b1a09f93e6132","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"@validator"},{"line_number":147,"context_line":"def file_exists(config, clients, deployment, param_name, mode\u003dos.R_OK,"},{"line_number":148,"context_line":"                required\u003dTrue):"},{"line_number":149,"context_line":"    \"\"\"Validator checks parameter is proper path to file with proper mode."},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    Ensure a file exists and can be accessed with the specified mode."}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_6bc1cd53","line":148,"updated":"2015-09-16 10:35:07.000000000","message":"Please, add info about usage of `expanduser` here.","commit_id":"15bd711582e69443fd4f9109046bd6eba55be119"},{"author":{"_account_id":8592,"name":"Anastasia Kuznetsova","email":"akuznetsova@mirantis.com","username":"nastya-kuz"},"change_message_id":"e6225466d32f9d91bf0e5da53011dbe9242a8d77","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"@validator"},{"line_number":147,"context_line":"def file_exists(config, clients, deployment, param_name, mode\u003dos.R_OK,"},{"line_number":148,"context_line":"                required\u003dTrue):"},{"line_number":149,"context_line":"    \"\"\"Validator checks parameter is proper path to file with proper mode."},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    Ensure a file exists and can be accessed with the specified mode."}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_17e5ceda","line":148,"in_reply_to":"ba15a1d1_6bc1cd53","updated":"2015-09-16 12:08:58.000000000","message":"What do you mean ? Add a couple of words that before access checking pass will be expanded? I am not sure that it is so important, because we don\u0027t return path","commit_id":"15bd711582e69443fd4f9109046bd6eba55be119"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"bd360cfc06530bd097a177fe918b1a09f93e6132","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    :param required: Boolean indicating whether this argument is required."},{"line_number":163,"context_line":"    \"\"\""},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    return _file_access_ok("},{"line_number":166,"context_line":"        config.get(\"args\", {}).get(param_name),"},{"line_number":167,"context_line":"        mode, param_name, required"},{"line_number":168,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_e0fe8f37","line":165,"updated":"2015-09-16 10:35:07.000000000","message":"Does it related change?","commit_id":"15bd711582e69443fd4f9109046bd6eba55be119"},{"author":{"_account_id":8592,"name":"Anastasia Kuznetsova","email":"akuznetsova@mirantis.com","username":"nastya-kuz"},"change_message_id":"e6225466d32f9d91bf0e5da53011dbe9242a8d77","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    :param required: Boolean indicating whether this argument is required."},{"line_number":163,"context_line":"    \"\"\""},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    return _file_access_ok("},{"line_number":166,"context_line":"        config.get(\"args\", {}).get(param_name),"},{"line_number":167,"context_line":"        mode, param_name, required"},{"line_number":168,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_dcb21d94","line":165,"in_reply_to":"ba15a1d1_e0fe8f37","updated":"2015-09-16 12:08:58.000000000","message":"No, seems that it came from one of the previous patch sets. Will fix it","commit_id":"15bd711582e69443fd4f9109046bd6eba55be119"}]}
