)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"97f843f6942fedb3ad76474cbd39f9ec0dad415f","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2016-07-04 16:27:20 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add validator to test integers"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I63a96f9b8565d5829192055a4d7784845f0c794d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1aa78d24_4d1e6264","line":8,"updated":"2016-07-04 14:58:23.000000000","message":"It took me some time to search and find out why you want to add this to neutron-lib. IMO, additions to neutron-lib should include a reason for the addition. Please add a note here referring to the lbaas patch.","commit_id":"976a2d4846af8069f3da3c27f6e643a47be8cffd"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"5ca4bcfff0458edf33b65188e6ed0b9d9fbd17d5","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add validator to test integers"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This is needed by neutron-lbaas to add a validator to weight in"},{"line_number":10,"context_line":"    https://review.openstack.org/336461 in order to  close"},{"line_number":11,"context_line":"    the bug https://launchpad.net/bugs/1573857 ."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"1aa78d24_80181186","line":9,"updated":"2016-07-04 15:38:09.000000000","message":"NOTE:\n\nGenerally speaking, when only one project needs something it would not be added to neutron-lib. However, in this case we have a very generic thing (validator for integer) and its complexity is low enough that I am fine with allowing it to be added.","commit_id":"83867f1b592bfc8cb1f31bb8f3d27b37608b10ff"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"f5878fb9b552a3bff25576a80c4d6f4a143fd897","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add validator to test integers"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This is needed to add a validator to weight in"},{"line_number":10,"context_line":"    https://review.openstack.org/#/c/336461/ in order to  close"},{"line_number":11,"context_line":"    the bug https://launchpad.net/bugs/1573857."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I63a96f9b8565d5829192055a4d7784845f0c794d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":29,"id":"dada55a8_82741968","line":10,"range":{"start_line":10,"start_character":0,"end_line":10,"end_character":4},"updated":"2016-07-21 01:42:28.000000000","message":"What is the space for?","commit_id":"eab3ab838d4128f3ab162dec78a61a17bc49c083"},{"author":{"_account_id":16448,"name":"Pablo","email":"Pablo.Iranzo@gmail.com","username":"iranzo"},"change_message_id":"797c838a757ac459d79359f7ae028f0ef90b8226","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add validator to test integers"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This is needed to add a validator to weight in"},{"line_number":10,"context_line":"    https://review.openstack.org/#/c/336461/ in order to  close"},{"line_number":11,"context_line":"    the bug https://launchpad.net/bugs/1573857."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I63a96f9b8565d5829192055a4d7784845f0c794d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":29,"id":"dada55a8_9029fa8c","line":10,"range":{"start_line":10,"start_character":0,"end_line":10,"end_character":4},"in_reply_to":"dada55a8_82741968","updated":"2016-07-21 08:25:57.000000000","message":"Done","commit_id":"eab3ab838d4128f3ab162dec78a61a17bc49c083"}],"neutron_lib/api/validators.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"135670a06f2af3072de4cba1000601768f4e2abf","unresolved":false,"context_lines":[{"line_number":148,"context_line":"    except (ValueError, TypeError):"},{"line_number":149,"context_line":"        LOG.debug(msg)"},{"line_number":150,"context_line":"        return msg"},{"line_number":151,"context_line":"    else:"},{"line_number":152,"context_line":"        if fl_n !\u003d int_n:"},{"line_number":153,"context_line":"            LOG.debug(msg)"},{"line_number":154,"context_line":"            return msg"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_aa252cac","line":151,"updated":"2016-07-04 14:41:12.000000000","message":"nitpick (no action required) the else is not necessary since you return on except.","commit_id":"976a2d4846af8069f3da3c27f6e643a47be8cffd"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"1050799ed7c8c67a5af46d521a2c5c8b38d27841","unresolved":false,"context_lines":[{"line_number":143,"context_line":"def validate_integer(data, valid_values\u003dNone):"},{"line_number":144,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":145,"context_line":"    try:"},{"line_number":146,"context_line":"        fl_n \u003d float(data)"},{"line_number":147,"context_line":"        int_n \u003d int(data)"},{"line_number":148,"context_line":"    except (ValueError, TypeError):"},{"line_number":149,"context_line":"        LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_ba6671b8","line":146,"updated":"2016-07-07 12:40:04.000000000","message":"Wouldn\u0027t it be easier and more effective to check if isinstance(data, int)?\n\nThe problem with the current approach is that some non-int values can slip through. For example:\n\n\u003e\u003e\u003e float(True) \u003d\u003d int(True)\nTrue","commit_id":"782cddcae7fb793cae644d4fad4b6c0940ddcf08"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"30cf38f1cf8c4e4f0802e1dbbd77586a5698456b","unresolved":false,"context_lines":[{"line_number":143,"context_line":"def validate_integer(data, valid_values\u003dNone):"},{"line_number":144,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":145,"context_line":"    try:"},{"line_number":146,"context_line":"        fl_n \u003d float(data)"},{"line_number":147,"context_line":"        int_n \u003d int(data)"},{"line_number":148,"context_line":"    except (ValueError, TypeError):"},{"line_number":149,"context_line":"        LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_515ad0f2","line":146,"in_reply_to":"1aa78d24_ba6671b8","updated":"2016-07-07 13:55:40.000000000","message":"It wouldn\u0027t work for all quoted numbers, so it\u0027s not really a good idea","commit_id":"782cddcae7fb793cae644d4fad4b6c0940ddcf08"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"1050799ed7c8c67a5af46d521a2c5c8b38d27841","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    try:"},{"line_number":146,"context_line":"        fl_n \u003d float(data)"},{"line_number":147,"context_line":"        int_n \u003d int(data)"},{"line_number":148,"context_line":"    except (ValueError, TypeError):"},{"line_number":149,"context_line":"        LOG.debug(msg)"},{"line_number":150,"context_line":"        return msg"},{"line_number":151,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_7a3889d3","line":148,"updated":"2016-07-07 12:40:04.000000000","message":"Based on the coverage report, this except branch is not validated. We are looking for 100% coverage here. If you could please add/update your UTs to cover that would be great.","commit_id":"782cddcae7fb793cae644d4fad4b6c0940ddcf08"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"21dd9a9664827537c05bc9e0ed3c2d3d7cec41f0","unresolved":false,"context_lines":[{"line_number":141,"context_line":""},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"def validate_integer(data, valid_values\u003dNone):"},{"line_number":144,"context_line":"    if not isinstance(data, int):"},{"line_number":145,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":146,"context_line":"        LOG.debug(msg)"},{"line_number":147,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_ccb8e713","line":144,"range":{"start_line":144,"start_character":4,"end_line":144,"end_character":32},"updated":"2016-07-07 14:07:22.000000000","message":"Please see my comment to PS7, that won\u0027t work in case of strings","commit_id":"fef366ceb5fe4acd332cf13ca657a06f0c9578a3"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"4bf12abaf7361e27cc63e13b6631de54d56bf673","unresolved":false,"context_lines":[{"line_number":141,"context_line":""},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"def validate_integer(data, valid_values\u003dNone):"},{"line_number":144,"context_line":"    if not isinstance(data, int):"},{"line_number":145,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":146,"context_line":"        LOG.debug(msg)"},{"line_number":147,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_4f11845c","line":144,"range":{"start_line":144,"start_character":4,"end_line":144,"end_character":32},"in_reply_to":"1aa78d24_ccb8e713","updated":"2016-07-07 15:31:34.000000000","message":"Does it really need to work with strings?\n\n\nIIUC these are REST API values via JSON so if we doc/support a numeric value (will be a number via JSON marshalling) why would we need to also support parsing numbers from their string repr?\n\n\nThis is more for my own knowledge than anything.","commit_id":"fef366ceb5fe4acd332cf13ca657a06f0c9578a3"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"5d6bf27e64ce8f59c3ac06723c10ed3177222be9","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        LOG.debug(msg)"},{"line_number":150,"context_line":"        return msg"},{"line_number":151,"context_line":"    else:"},{"line_number":152,"context_line":"        # Numbers are not equal or it\u0027s a boolean will also pass the tests"},{"line_number":153,"context_line":"        if fl_n !\u003d int_n or isinstance(data, bool):"},{"line_number":154,"context_line":"            LOG.debug(msg)"},{"line_number":155,"context_line":"            return msg"}],"source_content_type":"text/x-python","patch_set":10,"id":"1aa78d24_863e9227","line":152,"range":{"start_line":152,"start_character":40,"end_line":152,"end_character":74},"updated":"2016-07-08 08:11:29.000000000","message":"nit: this comment has to be updated now","commit_id":"77390cbbbaaf4354e0ce8f0ed82a23415aa3dacf"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"b0eac2d7b9dfd375210950696ac2f525ec75d61a","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        return msg"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"def validate_integer(data, valid_values\u003dNone):"},{"line_number":144,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":145,"context_line":"    try:"},{"line_number":146,"context_line":"        fl_n \u003d float(data)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1aa78d24_e15c321b","line":143,"range":{"start_line":143,"start_character":4,"end_line":143,"end_character":20},"updated":"2016-07-11 17:33:00.000000000","message":"Since this is new public API in neutron-lib, please add some pydoc for this function including the fact that it can handle validating numbers or numbers in str form.","commit_id":"8ef28403ccc2d491670fb95161e3a475da519be9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77f9b2354f43e27bb03995ebb88e04332b4fa703","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":155,"context_line":"    try:"},{"line_number":156,"context_line":"        fl_n \u003d float(data)"},{"line_number":157,"context_line":"        int_n \u003d int(data)"},{"line_number":158,"context_line":"    except (ValueError, TypeError):"},{"line_number":159,"context_line":"        LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_f4546eff","line":156,"updated":"2016-07-13 18:18:03.000000000","message":"do we want to cap the integer to an actual max integer?","commit_id":"7388e8bd0fb6b9c406e4bfbaf9ace09be86848a1"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"d3bffa6acac34cd067c25fc28ebe94aad2c87e3c","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":155,"context_line":"    try:"},{"line_number":156,"context_line":"        fl_n \u003d float(data)"},{"line_number":157,"context_line":"        int_n \u003d int(data)"},{"line_number":158,"context_line":"    except (ValueError, TypeError):"},{"line_number":159,"context_line":"        LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_c839cea5","line":156,"in_reply_to":"1aa78d24_4d24d00d","updated":"2016-07-13 21:20:12.000000000","message":"Sorry, I misinterpreted the question. It is not necessary for this particular use case. If there are situations where the check should be strict, then why not?","commit_id":"7388e8bd0fb6b9c406e4bfbaf9ace09be86848a1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b4cd291d9fa57e923be8f0aec24c8f0bbd599a6f","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":155,"context_line":"    try:"},{"line_number":156,"context_line":"        fl_n \u003d float(data)"},{"line_number":157,"context_line":"        int_n \u003d int(data)"},{"line_number":158,"context_line":"    except (ValueError, TypeError):"},{"line_number":159,"context_line":"        LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_03cd79b7","line":156,"in_reply_to":"1aa78d24_c839cea5","updated":"2016-07-13 21:40:53.000000000","message":"No worries, my point being: this validator may end up being useful in other situations. Rather than tailoring/restricting the validation logic to a specific use case, now it\u0027s the time we ask ourselves how and whether we want to make this a little more generic. If not, that\u0027s fine, but now it\u0027s the time to ponder :)","commit_id":"7388e8bd0fb6b9c406e4bfbaf9ace09be86848a1"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"9e82338c5e0dc4c0ca6c76c481db4598f81eb577","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":155,"context_line":"    try:"},{"line_number":156,"context_line":"        fl_n \u003d float(data)"},{"line_number":157,"context_line":"        int_n \u003d int(data)"},{"line_number":158,"context_line":"    except (ValueError, TypeError):"},{"line_number":159,"context_line":"        LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_f70e2b8b","line":156,"in_reply_to":"1aa78d24_f4546eff","updated":"2016-07-13 20:22:29.000000000","message":"This validator is introduced primarily to avoid converting floating numbers to integers, please see bug https://bugs.launchpad.net/neutron/+bug/1573857","commit_id":"7388e8bd0fb6b9c406e4bfbaf9ace09be86848a1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ec7de4402f7c4ea39646fcb4a661afc8a5e21c74","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":155,"context_line":"    try:"},{"line_number":156,"context_line":"        fl_n \u003d float(data)"},{"line_number":157,"context_line":"        int_n \u003d int(data)"},{"line_number":158,"context_line":"    except (ValueError, TypeError):"},{"line_number":159,"context_line":"        LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_4d24d00d","line":156,"in_reply_to":"1aa78d24_f70e2b8b","updated":"2016-07-13 21:02:55.000000000","message":"that\u0027s not really answering my question!","commit_id":"7388e8bd0fb6b9c406e4bfbaf9ace09be86848a1"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"a0081fc469b191a38d7d574d8c1c532c21a65d91","unresolved":false,"context_lines":[{"line_number":147,"context_line":"    integer and returns a message with the error if it\u0027s not"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    :param data: The string or number to validate as integer"},{"line_number":150,"context_line":"    :param valid_values: Ignored"},{"line_number":151,"context_line":"    :return: Message if not an integer."},{"line_number":152,"context_line":"    \"\"\""},{"line_number":153,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"1aa78d24_41a63854","line":150,"range":{"start_line":150,"start_character":4,"end_line":150,"end_character":32},"updated":"2016-07-14 14:10:51.000000000","message":"I wonder if we could run into a problem here.\n\nIf we ignore it now, then we could have trouble enabling it later. It might break someone\u0027s code who relied on it being ignored.\n\nI think we should either enable checking against valid_values now, or fail if valid_values is not None.\n\nIf we add the check:\n\n  if valid_values is not None:\n      return \"Parameter \u0027valid_values\u0027 not yet supported.\"\n\nthen we can support it later without breaking anyone.","commit_id":"7e87c0993d19cc5e760aa21186845977e8994eab"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a2e8ac38e6141e261552b3d7b7e716df386c0864","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    \"\"\""},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    if valid_values is not None:"},{"line_number":155,"context_line":"        return \"Parameter \u0027valid_values\u0027 not yet supported.\""},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":158,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":21,"id":"1aa78d24_db0a0d79","line":155,"updated":"2016-07-14 15:34:00.000000000","message":"why can\u0027t we support it now? We have validator at line 89 that does that, seems a step backwards.","commit_id":"c5732d5e46299d89a2979b6595053bdc131fa8c8"},{"author":{"_account_id":16448,"name":"Pablo","email":"Pablo.Iranzo@gmail.com","username":"iranzo"},"change_message_id":"ca1e7bf7a51281c368f6e24f4298345926e43562","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    \"\"\""},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    if valid_values is not None:"},{"line_number":155,"context_line":"        return \"Parameter \u0027valid_values\u0027 not yet supported.\""},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":158,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":21,"id":"1aa78d24_e9861915","line":155,"in_reply_to":"1aa78d24_db0a0d79","updated":"2016-07-14 21:20:30.000000000","message":"Let me code it and submit it.\n\nAs other functions are not doing the validation, like validate_boolean, wouldn\u0027t it make sense to do separately and implement validation on all of them at the same time?","commit_id":"c5732d5e46299d89a2979b6595053bdc131fa8c8"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"a1b2ba50aa36560302cc38bf689d8df3b31c617d","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    \"\"\""},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    if valid_values is not None:"},{"line_number":155,"context_line":"        return \"Parameter \u0027valid_values\u0027 not yet supported.\""},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":158,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":21,"id":"1aa78d24_3d1fb75c","line":155,"in_reply_to":"1aa78d24_db0a0d79","updated":"2016-07-14 21:10:52.000000000","message":"Yeah that looks easy to do. I am fine with doing it in this review, or a follow-up.","commit_id":"c5732d5e46299d89a2979b6595053bdc131fa8c8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f7fe895a63db0f345b3b716d616ebe9bf7003f60","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    \"\"\""},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    if valid_values is not None:"},{"line_number":155,"context_line":"        return \"Parameter \u0027valid_values\u0027 not yet supported.\""},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":158,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":21,"id":"fad55976_9176db3c","line":155,"in_reply_to":"1aa78d24_e9861915","updated":"2016-07-15 16:34:13.000000000","message":"the message should be translated","commit_id":"c5732d5e46299d89a2979b6595053bdc131fa8c8"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"c108d857fd1cef53d6bc8c54b762927447123205","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    \"\"\""},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    if valid_values is not None:"},{"line_number":155,"context_line":"        return \"Parameter \u0027valid_values\u0027 not yet supported.\""},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":158,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":21,"id":"dada55a8_79d693c6","line":155,"in_reply_to":"fad55976_27da4d79","updated":"2016-07-18 14:56:29.000000000","message":"Unless I\u0027m missing something none of the other msg\u0027s are translated in neutron-lib nor in neutron.","commit_id":"c5732d5e46299d89a2979b6595053bdc131fa8c8"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"537048b7fe2ee971d433efde962f5b1ec357eb24","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    \"\"\""},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    if valid_values is not None:"},{"line_number":155,"context_line":"        return \"Parameter \u0027valid_values\u0027 not yet supported.\""},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    msg \u003d _(\"\u0027%s\u0027 is not an integer\") % data"},{"line_number":158,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":21,"id":"fad55976_27da4d79","line":155,"in_reply_to":"fad55976_9176db3c","updated":"2016-07-15 17:09:52.000000000","message":"True, even though it is hopefully quite temporary.","commit_id":"c5732d5e46299d89a2979b6595053bdc131fa8c8"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f54936c8fda126915100eb186fc8dd09a6c9495","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        LOG.debug(msg)"},{"line_number":169,"context_line":"        return msg"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    try:"},{"line_number":172,"context_line":"        if valid_values and (data not in valid_values):"},{"line_number":173,"context_line":"            msg \u003d (_(\"\u0027%(data)s\u0027 is not within \u0027%(valid_values)s\u0027\") %"},{"line_number":174,"context_line":"                   {\u0027data\u0027: data, \u0027valid_values\u0027: valid_values})"}],"source_content_type":"text/x-python","patch_set":27,"id":"dada55a8_0e658644","line":171,"range":{"start_line":171,"start_character":4,"end_line":171,"end_character":7},"updated":"2016-07-18 16:02:43.000000000","message":"I think it is better in this case to check:\n\n  hasattr(valid_values, \u0027__contains__\u0027)\n\nThis means it supports the \u0027in\u0027 operation.","commit_id":"26be9df9096874f3b3103ce4dd2f6029e6f0849a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f54936c8fda126915100eb186fc8dd09a6c9495","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        return msg"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    try:"},{"line_number":172,"context_line":"        if valid_values and (data not in valid_values):"},{"line_number":173,"context_line":"            msg \u003d (_(\"\u0027%(data)s\u0027 is not within \u0027%(valid_values)s\u0027\") %"},{"line_number":174,"context_line":"                   {\u0027data\u0027: data, \u0027valid_values\u0027: valid_values})"},{"line_number":175,"context_line":"            return msg"}],"source_content_type":"text/x-python","patch_set":27,"id":"dada55a8_aed1dafd","line":172,"range":{"start_line":172,"start_character":11,"end_line":172,"end_character":23},"updated":"2016-07-18 16:02:43.000000000","message":"What if valid_values is [] or {} etc.? Is the user saying there are no valid values, or should we treat empty containers as an error? Either way, the current behavior for empty valid_values is wrong.","commit_id":"26be9df9096874f3b3103ce4dd2f6029e6f0849a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f54936c8fda126915100eb186fc8dd09a6c9495","unresolved":false,"context_lines":[{"line_number":171,"context_line":"    try:"},{"line_number":172,"context_line":"        if valid_values and (data not in valid_values):"},{"line_number":173,"context_line":"            msg \u003d (_(\"\u0027%(data)s\u0027 is not within \u0027%(valid_values)s\u0027\") %"},{"line_number":174,"context_line":"                   {\u0027data\u0027: data, \u0027valid_values\u0027: valid_values})"},{"line_number":175,"context_line":"            return msg"},{"line_number":176,"context_line":"    except TypeError:"},{"line_number":177,"context_line":"        msg \u003d (_(\"Provided \u0027%(data)s\u0027 or \u0027%(valid_values)s\u0027 with wrong type\") %"}],"source_content_type":"text/x-python","patch_set":27,"id":"dada55a8_0ec106e5","line":174,"range":{"start_line":174,"start_character":50,"end_line":174,"end_character":62},"updated":"2016-07-18 16:02:43.000000000","message":"If valid_values is a huge list or range, do we want to include it in the msg?\n\nFor example, in python 2, range(1,65536) will give a pretty nasty blob. The caller could use six.moves.range(), but we can\u0027t control that usage from here.","commit_id":"26be9df9096874f3b3103ce4dd2f6029e6f0849a"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"f5041f6961152168a075de9ac0f9f617744c9dc4","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            msg \u003d (_(\"\u0027%(data)s\u0027 is not within \u0027%(valid_values)s\u0027\") %"},{"line_number":174,"context_line":"                   {\u0027data\u0027: data, \u0027valid_values\u0027: valid_values})"},{"line_number":175,"context_line":"            return msg"},{"line_number":176,"context_line":"    except TypeError:"},{"line_number":177,"context_line":"        msg \u003d (_(\"Provided \u0027%(data)s\u0027 or \u0027%(valid_values)s\u0027 with wrong type\") %"},{"line_number":178,"context_line":"               {\u0027data\u0027: data, \u0027valid_values\u0027: valid_values})"},{"line_number":179,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":27,"id":"dada55a8_d13153ee","line":176,"updated":"2016-07-18 16:04:04.000000000","message":"IMHO we should have a private function like:\n\n\n_assert_valid_values(valid_values\u003dNone):\n    if not valid_values:\n        return\n    try:\n        iter(valid_values)\n        return\n    except TypeError:\n        return _(\"valid_values must be iterable\")\n\n\nand then assert valid_values early on in the validators that use it failing if its not iterable.\n\n\nIf we agree to this, we\u0027d also need a follow-on patch to address other such uses. For example: https://github.com/openstack/neutron-lib/blob/master/neutron_lib/api/validators.py#L91","commit_id":"26be9df9096874f3b3103ce4dd2f6029e6f0849a"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"3293a72d8c8afc0acf0f864bad18b01811eb5aee","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            msg \u003d (_(\"\u0027%(data)s\u0027 is not within \u0027%(valid_values)s\u0027\") %"},{"line_number":174,"context_line":"                   {\u0027data\u0027: data, \u0027valid_values\u0027: valid_values})"},{"line_number":175,"context_line":"            return msg"},{"line_number":176,"context_line":"    except TypeError:"},{"line_number":177,"context_line":"        msg \u003d (_(\"Provided \u0027%(data)s\u0027 or \u0027%(valid_values)s\u0027 with wrong type\") %"},{"line_number":178,"context_line":"               {\u0027data\u0027: data, \u0027valid_values\u0027: valid_values})"},{"line_number":179,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":27,"id":"dada55a8_24606b35","line":176,"in_reply_to":"dada55a8_11176ba4","updated":"2016-07-18 16:25:49.000000000","message":"Henry: I agree; checking to ensure we can call \u0027in\u0027 as you said is more complete.","commit_id":"26be9df9096874f3b3103ce4dd2f6029e6f0849a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"851821b13450abe3d8e015173c1393a7712156ba","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            msg \u003d (_(\"\u0027%(data)s\u0027 is not within \u0027%(valid_values)s\u0027\") %"},{"line_number":174,"context_line":"                   {\u0027data\u0027: data, \u0027valid_values\u0027: valid_values})"},{"line_number":175,"context_line":"            return msg"},{"line_number":176,"context_line":"    except TypeError:"},{"line_number":177,"context_line":"        msg \u003d (_(\"Provided \u0027%(data)s\u0027 or \u0027%(valid_values)s\u0027 with wrong type\") %"},{"line_number":178,"context_line":"               {\u0027data\u0027: data, \u0027valid_values\u0027: valid_values})"},{"line_number":179,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":27,"id":"dada55a8_11176ba4","line":176,"in_reply_to":"dada55a8_d13153ee","updated":"2016-07-18 16:09:14.000000000","message":"IMO being iterable is not quite what we want. The user could create a custom class that supports \u0027in\u0027 without being iterable. It just has to have a __contains__ method.","commit_id":"26be9df9096874f3b3103ce4dd2f6029e6f0849a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2d0fb0cfbd11bdf8885c85f2f76a8f7b89a23564","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    :return: Message if not an integer."},{"line_number":152,"context_line":"    \"\"\""},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    if valid_values:"},{"line_number":155,"context_line":"        msg \u003d validate_values(data\u003dNone, valid_values\u003dNone)"},{"line_number":156,"context_line":"        if msg:"},{"line_number":157,"context_line":"            return msg"}],"source_content_type":"text/x-python","patch_set":28,"id":"dada55a8_5659d059","line":154,"range":{"start_line":154,"start_character":7,"end_line":154,"end_character":19},"updated":"2016-07-18 18:58:41.000000000","message":"if valid_values is not None:","commit_id":"fe719fb92471c6683ebfed65cf39f07148683941"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2d0fb0cfbd11bdf8885c85f2f76a8f7b89a23564","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    \"\"\""},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    if valid_values:"},{"line_number":155,"context_line":"        msg \u003d validate_values(data\u003dNone, valid_values\u003dNone)"},{"line_number":156,"context_line":"        if msg:"},{"line_number":157,"context_line":"            return msg"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"dada55a8_b6176c50","line":155,"range":{"start_line":155,"start_character":30,"end_line":155,"end_character":58},"updated":"2016-07-18 18:58:41.000000000","message":"data\u003ddata, valid_values\u003dvalid_values","commit_id":"fe719fb92471c6683ebfed65cf39f07148683941"}],"neutron_lib/tests/unit/api/test_validators.py":[{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"56be1fdef3c6d4c7cbe4ba68d593ad885dfc4ad2","unresolved":false,"context_lines":[{"line_number":184,"context_line":"    def test_validate_integer(self):"},{"line_number":185,"context_line":"        msg \u003d validators.validate_integer(1)"},{"line_number":186,"context_line":"        self.assertIsNone(msg)"},{"line_number":187,"context_line":"        msg \u003d validators.validate_integer(0.1)"},{"line_number":188,"context_line":"        self.assertEqual(\"\u00270.1\u0027 is not an integer\", msg)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"    def test_validate_no_whitespace(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_11c0484f","line":187,"range":{"start_line":187,"start_character":8,"end_line":187,"end_character":46},"updated":"2016-07-07 13:57:29.000000000","message":"I feel we need more test cases for this function that would check that it works correctly for quoted integers and float numbers","commit_id":"30b56d5666833a81726c9c0dad3199bae8971267"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77f9b2354f43e27bb03995ebb88e04332b4fa703","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        self.assertEqual(\"\u00270.1\u0027 is not an integer\", msg)"},{"line_number":193,"context_line":"        msg \u003d validators.validate_integer(True)"},{"line_number":194,"context_line":"        self.assertEqual(\"\u0027True\u0027 is not an integer\", msg)"},{"line_number":195,"context_line":"        msg \u003d validators.validate_integer(False)"},{"line_number":196,"context_line":"        self.assertEqual(\"\u0027False\u0027 is not an integer\", msg)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"    def test_validate_no_whitespace(self):"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_d1b86478","line":195,"updated":"2016-07-13 18:18:03.000000000","message":"what about None? and \u0027inf\u0027?","commit_id":"7388e8bd0fb6b9c406e4bfbaf9ace09be86848a1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"11251abea83440893111942583984b2eaf5c68d8","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        self.assertEqual(\"\u0027True\u0027 is not an integer\", msg)"},{"line_number":195,"context_line":"        msg \u003d validators.validate_integer(False)"},{"line_number":196,"context_line":"        self.assertEqual(\"\u0027False\u0027 is not an integer\", msg)"},{"line_number":197,"context_line":"        msg \u003d validators.validate_integer(float(\u0027Inf\u0027))"},{"line_number":198,"context_line":"        self.assertEqual(\"\u0027inf\u0027 is not an integer\", msg)"},{"line_number":199,"context_line":"        msg \u003d validators.validate_integer(None)"},{"line_number":200,"context_line":"        self.assertEqual(\"\u0027None\u0027 is not an integer\", msg)"}],"source_content_type":"text/x-python","patch_set":16,"id":"1aa78d24_2356b5ce","line":197,"updated":"2016-07-13 21:43:41.000000000","message":"this should have been simply \u0027inf\u0027 or you must catch OverflowError too. I think the former suffices.","commit_id":"65901353273b7803bb2957159b0ae05333780c3c"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"56865b60f77cb144a73e23cecaf2e680bae5a2f3","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        msg \u003d validators.validate_boolean(\"fasle\")"},{"line_number":182,"context_line":"        self.assertEqual(\"\u0027fasle\u0027 is not a valid boolean value\", msg)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def test_validate_integer(self):"},{"line_number":185,"context_line":"        msg \u003d validators.validate_integer(1)"},{"line_number":186,"context_line":"        self.assertIsNone(msg)"},{"line_number":187,"context_line":"        msg \u003d validators.validate_integer(0.1)"}],"source_content_type":"text/x-python","patch_set":27,"id":"dada55a8_24186b84","line":184,"range":{"start_line":184,"start_character":8,"end_line":184,"end_character":29},"updated":"2016-07-18 16:28:45.000000000","message":"Also a consideration: maybe we should split these tests into 2 methods; one that tests validating using valid_values and the other that doesn\u0027t?","commit_id":"26be9df9096874f3b3103ce4dd2f6029e6f0849a"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"f5041f6961152168a075de9ac0f9f617744c9dc4","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        msg \u003d validators.validate_integer(1, [2, 3, 4, 5])"},{"line_number":206,"context_line":"        self.assertEqual(\"\u00271\u0027 is not within \u0027[2, 3, 4, 5]\u0027\", msg)"},{"line_number":207,"context_line":"        msg \u003d validators.validate_integer(1, \"[2, 3, 4, 5]\")"},{"line_number":208,"context_line":"        self.assertEqual(\"Provided \u00271\u0027 or \u0027[2, 3, 4, 5]\u0027 with wrong type\", msg)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def test_validate_no_whitespace(self):"},{"line_number":211,"context_line":"        data \u003d \u0027no_white_space\u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"dada55a8_d18dd37c","line":208,"range":{"start_line":208,"start_character":13,"end_line":208,"end_character":24},"updated":"2016-07-18 16:04:04.000000000","message":"I agree this should fail. However I think something like this should pass:\n\n\nvalidators.validate_integer(\"1\", [\"2\", \"1\", \"4\"])\n\n\nI don\u0027t think we should do any coercion of the valid_values in the validators, just make sure its iterable and then check if data is in it.","commit_id":"26be9df9096874f3b3103ce4dd2f6029e6f0849a"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"f5878fb9b552a3bff25576a80c4d6f4a143fd897","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        self.assertEqual(\"\u0027inf\u0027 is not an integer\", msg)"},{"line_number":199,"context_line":"        msg \u003d validators.validate_integer(None)"},{"line_number":200,"context_line":"        self.assertEqual(\"\u0027None\u0027 is not an integer\", msg)"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"# TODO(iranzo) Once that the validate_values function is fixed, check them"},{"line_number":203,"context_line":"#   def test_validate_integer_values(self):"},{"line_number":204,"context_line":"#        msg \u003d validators.validate_integer(1, \"test\")"}],"source_content_type":"text/x-python","patch_set":29,"id":"dada55a8_824d3940","line":201,"updated":"2016-07-21 01:42:28.000000000","message":"It\u0027s better to add validators.validate_integer(16.**256) because the validator checks OverflowError although I understand there’s a very low probability of this error occurring.","commit_id":"eab3ab838d4128f3ab162dec78a61a17bc49c083"},{"author":{"_account_id":16448,"name":"Pablo","email":"Pablo.Iranzo@gmail.com","username":"iranzo"},"change_message_id":"797c838a757ac459d79359f7ae028f0ef90b8226","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        self.assertEqual(\"\u0027inf\u0027 is not an integer\", msg)"},{"line_number":199,"context_line":"        msg \u003d validators.validate_integer(None)"},{"line_number":200,"context_line":"        self.assertEqual(\"\u0027None\u0027 is not an integer\", msg)"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"# TODO(iranzo) Once that the validate_values function is fixed, check them"},{"line_number":203,"context_line":"#   def test_validate_integer_values(self):"},{"line_number":204,"context_line":"#        msg \u003d validators.validate_integer(1, \"test\")"}],"source_content_type":"text/x-python","patch_set":29,"id":"dada55a8_700ba6d6","line":201,"in_reply_to":"dada55a8_824d3940","updated":"2016-07-21 08:25:57.000000000","message":"Overflow occurs already on the test_validate_integer call, it doesn\u0027t get to validate_integer:\n\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nFailed 1 tests - output below:\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nneutron_lib.tests.unit.api.test_validators.TestAttributeValidation.test_validate_integer\n----------------------------------------------------------------------------------------\n\nCaptured traceback:\n~~~~~~~~~~~~~~~~~~~\n    Traceback (most recent call last):\n      File \"neutron_lib/tests/unit/api/test_validators.py\", line 201, in test_validate_integer\n        msg \u003d validators.validate_integer(16.**256)\n    OverflowError: (34, \u0027Numerical result out of range\u0027)","commit_id":"eab3ab838d4128f3ab162dec78a61a17bc49c083"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b29de434e01a9763eef27e7d9dcb7156c9b20636","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        msg \u003d validators.validate_integer(None)"},{"line_number":200,"context_line":"        self.assertEqual(\"\u0027None\u0027 is not an integer\", msg)"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"# TODO(iranzo) Once that the validate_values function is fixed, check them"},{"line_number":203,"context_line":"#   def test_validate_integer_values(self):"},{"line_number":204,"context_line":"#        msg \u003d validators.validate_integer(1, \"test\")"},{"line_number":205,"context_line":"#        self.assertEqual(\"Provided \u00271\u0027 or \u0027test\u0027 with wrong type\", msg)"}],"source_content_type":"text/x-python","patch_set":29,"id":"dada55a8_c224a4b0","line":202,"updated":"2016-07-19 16:13:45.000000000","message":"it is not clear why we need this code below","commit_id":"eab3ab838d4128f3ab162dec78a61a17bc49c083"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"424efaff3283d05454830ecb15a083736f3e6993","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        msg \u003d validators.validate_integer(None)"},{"line_number":200,"context_line":"        self.assertEqual(\"\u0027None\u0027 is not an integer\", msg)"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"# TODO(iranzo) Once that the validate_values function is fixed, check them"},{"line_number":203,"context_line":"#   def test_validate_integer_values(self):"},{"line_number":204,"context_line":"#        msg \u003d validators.validate_integer(1, \"test\")"},{"line_number":205,"context_line":"#        self.assertEqual(\"Provided \u00271\u0027 or \u0027test\u0027 with wrong type\", msg)"}],"source_content_type":"text/x-python","patch_set":29,"id":"dada55a8_22978049","line":202,"in_reply_to":"dada55a8_c224a4b0","updated":"2016-07-19 16:19:38.000000000","message":"Maybe this patch should depend on: https://review.openstack.org/#/c/343799/  in which case this block could be uncommented.","commit_id":"eab3ab838d4128f3ab162dec78a61a17bc49c083"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2dcb3b572224a1b4d7f78c002511f1fb6018f840","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        msg \u003d validators.validate_integer(None)"},{"line_number":200,"context_line":"        self.assertEqual(\"\u0027None\u0027 is not an integer\", msg)"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"# TODO(iranzo) Once that the validate_values function is fixed, check them"},{"line_number":203,"context_line":"#   def test_validate_integer_values(self):"},{"line_number":204,"context_line":"#        msg \u003d validators.validate_integer(1, \"test\")"},{"line_number":205,"context_line":"#        self.assertEqual(\"Provided \u00271\u0027 or \u0027test\u0027 with wrong type\", msg)"},{"line_number":206,"context_line":"#        msg \u003d validators.validate_integer(2, [2, 3, 4, 5])"},{"line_number":207,"context_line":"#        self.assertIsNone(msg)"},{"line_number":208,"context_line":"#        msg \u003d validators.validate_integer(1, [2, 3, 4, 5])"},{"line_number":209,"context_line":"#        self.assertEqual(\"\u00271\u0027 is not within \u0027[2, 3, 4, 5]\u0027\", msg)"},{"line_number":210,"context_line":"#        msg \u003d validators.validate_integer(1, \"[2, 3, 4, 5]\")"},{"line_number":211,"context_line":"#        self.assertEqual(\"Provided \u00271\u0027or \u0027[2, 3, 4, 5]\u0027 with wrong type\", msg)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def test_validate_no_whitespace(self):"},{"line_number":214,"context_line":"        data \u003d \u0027no_white_space\u0027"}],"source_content_type":"text/x-python","patch_set":30,"id":"dada55a8_5d981f6a","line":211,"range":{"start_line":202,"start_character":0,"end_line":211,"end_character":79},"updated":"2016-07-21 15:38:09.000000000","message":"I dislike commented out code, even if it is intended to be temporary.\n\nI think for this patch you can add some basic valid value checks for simple sets/ranges supported by the current version of validate_values(), and some negative tests for obviously bad valid values.","commit_id":"1551d465d46e6e36486408cd941b09b6dc06540a"},{"author":{"_account_id":16448,"name":"Pablo","email":"Pablo.Iranzo@gmail.com","username":"iranzo"},"change_message_id":"24e502036e31d909a6019bd5798ae1e567f5346f","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        msg \u003d validators.validate_integer(None)"},{"line_number":200,"context_line":"        self.assertEqual(\"\u0027None\u0027 is not an integer\", msg)"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"# TODO(iranzo) Once that the validate_values function is fixed, check them"},{"line_number":203,"context_line":"#   def test_validate_integer_values(self):"},{"line_number":204,"context_line":"#        msg \u003d validators.validate_integer(1, \"test\")"},{"line_number":205,"context_line":"#        self.assertEqual(\"Provided \u00271\u0027 or \u0027test\u0027 with wrong type\", msg)"},{"line_number":206,"context_line":"#        msg \u003d validators.validate_integer(2, [2, 3, 4, 5])"},{"line_number":207,"context_line":"#        self.assertIsNone(msg)"},{"line_number":208,"context_line":"#        msg \u003d validators.validate_integer(1, [2, 3, 4, 5])"},{"line_number":209,"context_line":"#        self.assertEqual(\"\u00271\u0027 is not within \u0027[2, 3, 4, 5]\u0027\", msg)"},{"line_number":210,"context_line":"#        msg \u003d validators.validate_integer(1, \"[2, 3, 4, 5]\")"},{"line_number":211,"context_line":"#        self.assertEqual(\"Provided \u00271\u0027or \u0027[2, 3, 4, 5]\u0027 with wrong type\", msg)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def test_validate_no_whitespace(self):"},{"line_number":214,"context_line":"        data \u003d \u0027no_white_space\u0027"}],"source_content_type":"text/x-python","patch_set":30,"id":"dada55a8_003d9c8e","line":211,"range":{"start_line":202,"start_character":0,"end_line":211,"end_character":79},"in_reply_to":"dada55a8_5d981f6a","updated":"2016-07-21 15:51:38.000000000","message":"Done","commit_id":"1551d465d46e6e36486408cd941b09b6dc06540a"}]}
