)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"0a3879217657751d0917f8771c911f7ec2d45cc4","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix db purge type validation"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Moved validation for age_in_days and max_rows from"},{"line_number":10,"context_line":"glance.db.sqlalchemy.api to glance.cmd.manage since"},{"line_number":11,"context_line":"code from purge_deleted_rows() method of"},{"line_number":12,"context_line":"glance.db.sqlalchemy.api is unreachable as it is"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"ba0121b8_b52f97f5","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":5},"updated":"2016-03-28 18:43:43.000000000","message":"Nit: this is slightly misleading because you didn\u0027t remove the checks from db.sqlalchemy.api in this patch, you just added them here.","commit_id":"371043656b64904e536f09afcd23e41e8758fe38"}],"glance/cmd/manage.py":[{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"dbb891aebf949f3ffa03194cafac67730c59420d","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    def purge(self, age_in_days\u003d30, max_rows\u003d100):"},{"line_number":159,"context_line":"        \"\"\"Purge deleted rows older than a given age from glance tables.\"\"\""},{"line_number":160,"context_line":"        try:"},{"line_number":161,"context_line":"            age_in_days \u003d int(age_in_days)"},{"line_number":162,"context_line":"        except ValueError:"},{"line_number":163,"context_line":"            print((\"Invalid int value for age_in_days: \""},{"line_number":164,"context_line":"                   \"%(age_in_days)s.\") % {\u0027age_in_days\u0027: age_in_days})"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_d56e292e","line":161,"updated":"2016-03-17 09:10:38.000000000","message":"You don\u0027t need this AFAIK. argparse does some validation before passing params.","commit_id":"11e2f45b43298a13efa7384b644bf4bf71543329"},{"author":{"_account_id":20191,"name":"Dinesh Bhor","email":"bhordinesh07@gmail.com","username":"dineshbhor"},"change_message_id":"5d6e5eb9dee66e49f5344dd0f299e2a69e71e3c9","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    def purge(self, age_in_days\u003d30, max_rows\u003d100):"},{"line_number":159,"context_line":"        \"\"\"Purge deleted rows older than a given age from glance tables.\"\"\""},{"line_number":160,"context_line":"        try:"},{"line_number":161,"context_line":"            age_in_days \u003d int(age_in_days)"},{"line_number":162,"context_line":"        except ValueError:"},{"line_number":163,"context_line":"            print((\"Invalid int value for age_in_days: \""},{"line_number":164,"context_line":"                   \"%(age_in_days)s.\") % {\u0027age_in_days\u0027: age_in_days})"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_e8e1cc9b","line":161,"in_reply_to":"1af94dfe_d56e292e","updated":"2016-03-17 09:40:26.000000000","message":"Positional arguments for purge are not getting validated here as they are getting added to parser under \u0027action_args\u0027(line no:289) without any type validation. If we run command as: \n$ glance-manage db purge --age_in_days \u0027value\u0027\nthen \u0027value\u0027 will go through validation in parser.\nBut in the following case:\n$ glance-manage db purge \u0027value\u0027\n\u0027value\u0027 will not be validated in parser.\n\nNOTE: And this will be the case for all glance-manage commands.","commit_id":"11e2f45b43298a13efa7384b644bf4bf71543329"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"51f5567a096239de32de35cfe3e9360dde70b27b","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        except ValueError:"},{"line_number":163,"context_line":"            print((\"Invalid int value for age_in_days: \""},{"line_number":164,"context_line":"                   \"%(age_in_days)s.\") % {\u0027age_in_days\u0027: age_in_days})"},{"line_number":165,"context_line":"            sys.exit(1)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        try:"},{"line_number":168,"context_line":"            max_rows \u003d int(max_rows)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_5b0ce9ec","line":165,"range":{"start_line":165,"start_character":20,"end_line":165,"end_character":23},"updated":"2016-03-23 11:43:06.000000000","message":"There a quite a few occurrences in the code where the message is just printed out in the sys.exit. Do you think that would look cleaner?","commit_id":"11e2f45b43298a13efa7384b644bf4bf71543329"},{"author":{"_account_id":20191,"name":"Dinesh Bhor","email":"bhordinesh07@gmail.com","username":"dineshbhor"},"change_message_id":"ec0dd67bbb8913496b1473ec63cd410bc53ea8ae","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        except ValueError:"},{"line_number":163,"context_line":"            print((\"Invalid int value for age_in_days: \""},{"line_number":164,"context_line":"                   \"%(age_in_days)s.\") % {\u0027age_in_days\u0027: age_in_days})"},{"line_number":165,"context_line":"            sys.exit(1)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        try:"},{"line_number":168,"context_line":"            max_rows \u003d int(max_rows)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_4cd744bf","line":165,"range":{"start_line":165,"start_character":20,"end_line":165,"end_character":23},"in_reply_to":"fa0719c6_5b0ce9ec","updated":"2016-03-28 05:57:47.000000000","message":"Done","commit_id":"11e2f45b43298a13efa7384b644bf4bf71543329"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"51f5567a096239de32de35cfe3e9360dde70b27b","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        except ValueError:"},{"line_number":170,"context_line":"            print((\"Invalid int value for max_rows: \""},{"line_number":171,"context_line":"                   \"%(max_rows)s.\") % {\u0027max_rows\u0027: max_rows})"},{"line_number":172,"context_line":"            sys.exit(1)"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        if age_in_days \u003c\u003d 0:"},{"line_number":175,"context_line":"            sys.exit(_(\"Must supply a positive, non-zero value for age.\"))"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_3b02d5b4","line":172,"range":{"start_line":172,"start_character":20,"end_line":172,"end_character":23},"updated":"2016-03-23 11:43:06.000000000","message":"Ditto.","commit_id":"11e2f45b43298a13efa7384b644bf4bf71543329"},{"author":{"_account_id":20191,"name":"Dinesh Bhor","email":"bhordinesh07@gmail.com","username":"dineshbhor"},"change_message_id":"ec0dd67bbb8913496b1473ec63cd410bc53ea8ae","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        except ValueError:"},{"line_number":170,"context_line":"            print((\"Invalid int value for max_rows: \""},{"line_number":171,"context_line":"                   \"%(max_rows)s.\") % {\u0027max_rows\u0027: max_rows})"},{"line_number":172,"context_line":"            sys.exit(1)"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        if age_in_days \u003c\u003d 0:"},{"line_number":175,"context_line":"            sys.exit(_(\"Must supply a positive, non-zero value for age.\"))"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_8ce15c9d","line":172,"range":{"start_line":172,"start_character":20,"end_line":172,"end_character":23},"in_reply_to":"fa0719c6_3b02d5b4","updated":"2016-03-28 05:57:47.000000000","message":"Done","commit_id":"11e2f45b43298a13efa7384b644bf4bf71543329"}],"glance/db/sqlalchemy/api.py":[{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"dbb891aebf949f3ffa03194cafac67730c59420d","unresolved":false,"context_lines":[{"line_number":1274,"context_line":"    according to given age for relevant models."},{"line_number":1275,"context_line":"    \"\"\""},{"line_number":1276,"context_line":"    try:"},{"line_number":1277,"context_line":"        age_in_days \u003d int(age_in_days)"},{"line_number":1278,"context_line":"    except ValueError:"},{"line_number":1279,"context_line":"        LOG.exception(_LE(\u0027Invalid value for age, %(age)d\u0027),"},{"line_number":1280,"context_line":"                      {\u0027age\u0027: age_in_days})"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_15225100","side":"PARENT","line":1277,"updated":"2016-03-17 09:10:38.000000000","message":"I tend to agree that db_api is possibly not good place to validate types.\nPerhaps assumption about types needs to be documented in doc string.","commit_id":"c5dcf9021af609b81edc4a22c38ddf7bdd440cee"}]}
