)]}'
{"nova/compute/flavors.py":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"19447f446f194da1ac1edd945b9818345aeac42b","unresolved":false,"context_lines":[{"line_number":142,"context_line":"                (kwargs[\u0027rxtx_factor\u0027] \u003e SQL_FLOAT_MAX):"},{"line_number":143,"context_line":"            raise ValueError()"},{"line_number":144,"context_line":"    except ValueError:"},{"line_number":145,"context_line":"        msg \u003d (_(\"\u0027rxtx_factor\u0027 argument must float \u003e 0 and \u003c %f\") %"},{"line_number":146,"context_line":"               SQL_FLOAT_MAX)"},{"line_number":147,"context_line":"        raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9keA%3D","line":145,"updated":"2013-12-10 05:37:06.000000000","message":"\u003e0 and \u003c\u003d%f would be better","commit_id":"17efe691bd169d00f59e4f27c8df2b84ea89bcb3"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"4671091687c60ebdb5c3e1ea8d157dc69d53470f","unresolved":false,"context_lines":[{"line_number":142,"context_line":"                (kwargs[\u0027rxtx_factor\u0027] \u003e SQL_FLOAT_MAX):"},{"line_number":143,"context_line":"            raise ValueError()"},{"line_number":144,"context_line":"    except ValueError:"},{"line_number":145,"context_line":"        msg \u003d (_(\"\u0027rxtx_factor\u0027 argument must float \u003e 0 and \u003c %f\") %"},{"line_number":146,"context_line":"               SQL_FLOAT_MAX)"},{"line_number":147,"context_line":"        raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9j%2BI%3D","line":145,"in_reply_to":"AAAATn%2F9keA%3D","updated":"2013-12-10 08:15:50.000000000","message":"Done","commit_id":"17efe691bd169d00f59e4f27c8df2b84ea89bcb3"},{"author":{"_account_id":9420,"name":"Matthew Gilliard","email":"matthew.gilliard@hp.com","username":"gilliard"},"change_message_id":"cddcdf155f1c218b496443763deaa5ac3a90ca09","unresolved":false,"context_lines":[{"line_number":56,"context_line":"# to ascii characters."},{"line_number":57,"context_line":"VALID_ID_REGEX \u003d re.compile(\"^[\\w\\.\\- ]*$\")"},{"line_number":58,"context_line":"VALID_NAME_REGEX \u003d re.compile(\"^[\\w\\.\\- ]*$\", re.UNICODE)"},{"line_number":59,"context_line":"SQL_FLOAT_MAX \u003d 3.40282e+38"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def _int_or_none(val):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9jfI%3D","line":59,"updated":"2013-12-10 10:09:35.000000000","message":"This is a magic number - should be available as a constant from some DB code.  And, how was it determined?  Is this value valid for MySQL/PostGres/SqlLite etc?","commit_id":"5077535c864888b78f65e6903d9d710ec35cf544"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"f13c8e15a9385fce070b0448cc83563053f4feb1","unresolved":false,"context_lines":[{"line_number":56,"context_line":"# to ascii characters."},{"line_number":57,"context_line":"VALID_ID_REGEX \u003d re.compile(\"^[\\w\\.\\- ]*$\")"},{"line_number":58,"context_line":"VALID_NAME_REGEX \u003d re.compile(\"^[\\w\\.\\- ]*$\", re.UNICODE)"},{"line_number":59,"context_line":"SQL_FLOAT_MAX \u003d 3.40282e+38"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def _int_or_none(val):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9i3A%3D","line":59,"in_reply_to":"AAAATn%2F9i3s%3D","updated":"2013-12-10 12:09:00.000000000","message":"Fair enough I\u0027ll add one in.","commit_id":"5077535c864888b78f65e6903d9d710ec35cf544"},{"author":{"_account_id":9420,"name":"Matthew Gilliard","email":"matthew.gilliard@hp.com","username":"gilliard"},"change_message_id":"43eca1af07f78b0f25d859fc5ba262e9998deee1","unresolved":false,"context_lines":[{"line_number":56,"context_line":"# to ascii characters."},{"line_number":57,"context_line":"VALID_ID_REGEX \u003d re.compile(\"^[\\w\\.\\- ]*$\")"},{"line_number":58,"context_line":"VALID_NAME_REGEX \u003d re.compile(\"^[\\w\\.\\- ]*$\", re.UNICODE)"},{"line_number":59,"context_line":"SQL_FLOAT_MAX \u003d 3.40282e+38"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def _int_or_none(val):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9i3s%3D","line":59,"in_reply_to":"AAAATn%2F9jaw%3D","updated":"2013-12-10 11:57:11.000000000","message":"Fair enough, but I\u0027m still not sure this is the right place to put this constant.  In any case an explanatory comment would be helpful.","commit_id":"5077535c864888b78f65e6903d9d710ec35cf544"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"e715003a2c914b757f2d90c7a4fb16e6472d925f","unresolved":false,"context_lines":[{"line_number":56,"context_line":"# to ascii characters."},{"line_number":57,"context_line":"VALID_ID_REGEX \u003d re.compile(\"^[\\w\\.\\- ]*$\")"},{"line_number":58,"context_line":"VALID_NAME_REGEX \u003d re.compile(\"^[\\w\\.\\- ]*$\", re.UNICODE)"},{"line_number":59,"context_line":"SQL_FLOAT_MAX \u003d 3.40282e+38"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def _int_or_none(val):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9jaw%3D","line":59,"in_reply_to":"AAAATn%2F9jfI%3D","updated":"2013-12-10 11:47:10.000000000","message":"I know this is not ideal and I was not able to find a constant to represent this in the code but this seems to be the documented maximum for most SQL dbs e.g. mysql, postgresql. Sqlite uses dynamic typing so this would not apply there but we would want to imply this rule anyway. One way to determine this is to put an oversize value into the db Float and see what comes out when you read it.\n\nSome tests to prove this:\n\nPOSTGRES:\n#!/bin/bash -ux\nsqlfile\u003d\"`mktemp`\"\ncat \u003c\u003c EOF \u003e $sqlfile\ncreate table t1 (c1 Real);\ninsert into t1 (c1) values(3.40282e+38);\ninsert into t1 (c1) values(3.40282e+39);\nselect c1 from t1;\ndrop table t1;\nEOF\nchmod 744 $sqlfile\nsudo -u postgres psql -c \"create database float_test;\"\nsudo -u postgres psql float_test -f $sqlfile\nsudo -u postgres psql -c \"drop database float_test;\"\n\nMYSQL:\n#!/bin/bash -eux\nmysql -e \"create database float_test;\"\nmysql float_test \u003c\u003c EOF\nuse float_test;\ncreate table t1 (c1 Float);\ninsert into t1 (c1) values(3.40282e+38);\ninsert into t1 (c1) values(3.40282e+39);\nselect c1 from t1;\ndrop table t1;\ndrop database float_test;\nEOF","commit_id":"5077535c864888b78f65e6903d9d710ec35cf544"},{"author":{"_account_id":9420,"name":"Matthew Gilliard","email":"matthew.gilliard@hp.com","username":"gilliard"},"change_message_id":"cddcdf155f1c218b496443763deaa5ac3a90ca09","unresolved":false,"context_lines":[{"line_number":142,"context_line":"                (kwargs[\u0027rxtx_factor\u0027] \u003e SQL_FLOAT_MAX):"},{"line_number":143,"context_line":"            raise ValueError()"},{"line_number":144,"context_line":"    except ValueError:"},{"line_number":145,"context_line":"        msg \u003d (_(\"\u0027rxtx_factor\u0027 argument must float \u003e 0 and \u003c\u003d %f\") %"},{"line_number":146,"context_line":"               SQL_FLOAT_MAX)"},{"line_number":147,"context_line":"        raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9je8%3D","line":145,"updated":"2013-12-10 10:09:35.000000000","message":"Better to use %g (which will print 3.40282e+38) than %f (which will print 340282000000000014192072600942972764160.000000)","commit_id":"5077535c864888b78f65e6903d9d710ec35cf544"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"e715003a2c914b757f2d90c7a4fb16e6472d925f","unresolved":false,"context_lines":[{"line_number":142,"context_line":"                (kwargs[\u0027rxtx_factor\u0027] \u003e SQL_FLOAT_MAX):"},{"line_number":143,"context_line":"            raise ValueError()"},{"line_number":144,"context_line":"    except ValueError:"},{"line_number":145,"context_line":"        msg \u003d (_(\"\u0027rxtx_factor\u0027 argument must float \u003e 0 and \u003c\u003d %f\") %"},{"line_number":146,"context_line":"               SQL_FLOAT_MAX)"},{"line_number":147,"context_line":"        raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9jak%3D","line":145,"in_reply_to":"AAAATn%2F9je8%3D","updated":"2013-12-10 11:47:10.000000000","message":"Spotted. I\u0027ll fix this.","commit_id":"5077535c864888b78f65e6903d9d710ec35cf544"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"455f2338ecc0e611c799610e00f15782ec44a816","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    # rxtx_factor should be a positive float"},{"line_number":146,"context_line":"    try:"},{"line_number":147,"context_line":"        kwargs[\u0027rxtx_factor\u0027] \u003d float(kwargs[\u0027rxtx_factor\u0027])"},{"line_number":148,"context_line":"        if (kwargs[\u0027rxtx_factor\u0027] \u003c\u003d 0) or \\"},{"line_number":149,"context_line":"                (kwargs[\u0027rxtx_factor\u0027] \u003e SQL_SP_FLOAT_MAX):"},{"line_number":150,"context_line":"            raise ValueError()"},{"line_number":151,"context_line":"    except ValueError:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2FlYE%3D","line":148,"updated":"2014-01-10 19:27:21.000000000","message":"Please use parentheses to eliminate the backslash.  In fact, this could be rewritten as:\n\n    if (kwargs[\u0027rxtx_factor\u0027] \u003c\u003d 0 or\n            kwargs[\u0027rxtx_factor\u0027] \u003e SQL_SP_FLOAT_MAX):","commit_id":"c1f39fc04d1db46f5356032588cfc4cd0a8de7ab"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"3b946dca16eb0a04fa2031890df60fd693d1d53d","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    # rxtx_factor should be a positive float"},{"line_number":146,"context_line":"    try:"},{"line_number":147,"context_line":"        kwargs[\u0027rxtx_factor\u0027] \u003d float(kwargs[\u0027rxtx_factor\u0027])"},{"line_number":148,"context_line":"        if (kwargs[\u0027rxtx_factor\u0027] \u003c\u003d 0) or \\"},{"line_number":149,"context_line":"                (kwargs[\u0027rxtx_factor\u0027] \u003e SQL_SP_FLOAT_MAX):"},{"line_number":150,"context_line":"            raise ValueError()"},{"line_number":151,"context_line":"    except ValueError:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2BwsY%3D","line":148,"in_reply_to":"AAAAUH%2F%2FlYE%3D","updated":"2014-01-22 12:30:50.000000000","message":"Done","commit_id":"c1f39fc04d1db46f5356032588cfc4cd0a8de7ab"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f47836da4f96b82ce0f7e56926d4eefe95694b28","unresolved":false,"context_lines":[{"line_number":144,"context_line":"    try:"},{"line_number":145,"context_line":"        kwargs[\u0027rxtx_factor\u0027] \u003d float(kwargs[\u0027rxtx_factor\u0027])"},{"line_number":146,"context_line":"        if ((kwargs[\u0027rxtx_factor\u0027] \u003c\u003d 0) or"},{"line_number":147,"context_line":"            (kwargs[\u0027rxtx_factor\u0027] \u003e SQL_SP_FLOAT_MAX)):"},{"line_number":148,"context_line":"            raise ValueError()"},{"line_number":149,"context_line":"    except ValueError:"},{"line_number":150,"context_line":"        msg \u003d (_(\"\u0027rxtx_factor\u0027 argument must float \u003e 0 and \u003c\u003d %g\") %"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F9nP8%3D","line":147,"updated":"2014-02-05 17:01:54.000000000","message":"You don\u0027t need the parentheses around the individual comparisons.  Also, I\u0027d like the second line of the condition indented a little more deeply to visually differentiate it from the raise.  Application of these femtonits would change the code to look like:\n\n    if (kwargs[\u0027rxtx_factor\u0027] \u003c\u003d 0 or\n            kwargs[\u0027rxtx_factor\u0027] \u003e SQL_SP_FLOAT_MAX):\n        raise ValueError()","commit_id":"81e93676c6ea596e2acf8b27106b7f90780137e1"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"7dca8840a13cc47b43ef672195c05de5a3acb0db","unresolved":false,"context_lines":[{"line_number":144,"context_line":"    try:"},{"line_number":145,"context_line":"        kwargs[\u0027rxtx_factor\u0027] \u003d float(kwargs[\u0027rxtx_factor\u0027])"},{"line_number":146,"context_line":"        if ((kwargs[\u0027rxtx_factor\u0027] \u003c\u003d 0) or"},{"line_number":147,"context_line":"            (kwargs[\u0027rxtx_factor\u0027] \u003e SQL_SP_FLOAT_MAX)):"},{"line_number":148,"context_line":"            raise ValueError()"},{"line_number":149,"context_line":"    except ValueError:"},{"line_number":150,"context_line":"        msg \u003d (_(\"\u0027rxtx_factor\u0027 argument must float \u003e 0 and \u003c\u003d %g\") %"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F9e5Y%3D","line":147,"in_reply_to":"AAAAUH%2F9nP8%3D","updated":"2014-02-06 16:48:51.000000000","message":"Done","commit_id":"81e93676c6ea596e2acf8b27106b7f90780137e1"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f47836da4f96b82ce0f7e56926d4eefe95694b28","unresolved":false,"context_lines":[{"line_number":148,"context_line":"            raise ValueError()"},{"line_number":149,"context_line":"    except ValueError:"},{"line_number":150,"context_line":"        msg \u003d (_(\"\u0027rxtx_factor\u0027 argument must float \u003e 0 and \u003c\u003d %g\") %"},{"line_number":151,"context_line":"               SQL_SP_FLOAT_MAX)"},{"line_number":152,"context_line":"        raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    kwargs[\u0027name\u0027] \u003d name"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F9nPg%3D","line":151,"updated":"2014-02-05 17:01:54.000000000","message":"The message would be more understandable phrased as:\n\n    msg \u003d (_(\"\u0027rxtx_factor\u0027 argument must be a float between 0 and %g\") %\n           SQL_SP_FLOAT_MAX)","commit_id":"81e93676c6ea596e2acf8b27106b7f90780137e1"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"7dca8840a13cc47b43ef672195c05de5a3acb0db","unresolved":false,"context_lines":[{"line_number":148,"context_line":"            raise ValueError()"},{"line_number":149,"context_line":"    except ValueError:"},{"line_number":150,"context_line":"        msg \u003d (_(\"\u0027rxtx_factor\u0027 argument must float \u003e 0 and \u003c\u003d %g\") %"},{"line_number":151,"context_line":"               SQL_SP_FLOAT_MAX)"},{"line_number":152,"context_line":"        raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    kwargs[\u0027name\u0027] \u003d name"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F9e5Q%3D","line":151,"in_reply_to":"AAAAUH%2F9nPg%3D","updated":"2014-02-06 16:48:51.000000000","message":"Done","commit_id":"81e93676c6ea596e2acf8b27106b7f90780137e1"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"42214c353cc8e321502f9a00d2fee9dd6d0382bb","unresolved":false,"context_lines":[{"line_number":59,"context_line":"# ways to oversize values e.g. postgres will raise an exception while mysql"},{"line_number":60,"context_line":"# will round off the value. Nevertheless we may still want to know prior to"},{"line_number":61,"context_line":"# insert whether the value is oversize."},{"line_number":62,"context_line":"SQL_SP_FLOAT_MAX \u003d 3.40282e+38"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"# Validate extra specs key names."},{"line_number":65,"context_line":"VALID_EXTRASPEC_NAME_REGEX \u003d re.compile(r\"[\\w\\.\\- :]+$\", re.UNICODE)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2BiDc%3D","line":62,"updated":"2014-02-20 17:10:37.000000000","message":"So, conceivably we\u0027d never want a factor *remotely* close to this value, right? I mean, it\u0027s great to guard against obscene numbers being passed via the API, but on my Mac, max_float is roughly half that value:\n\nIn [3]: sys.float_info.max\nOut[3]: 1.7976931348623157e+308\n\nI understand not wanting to define the limit arbitrarily, but this particular value seems silly.\n\nI\u0027d almost rather there was a discussion of sane limits for various nova objects.","commit_id":"3c9ed4c6ed216d018076de9f1391dae36b28a883"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"b832ae02f5b05bc463a1facfdfe9a71068aa193b","unresolved":false,"context_lines":[{"line_number":59,"context_line":"# ways to oversize values e.g. postgres will raise an exception while mysql"},{"line_number":60,"context_line":"# will round off the value. Nevertheless we may still want to know prior to"},{"line_number":61,"context_line":"# insert whether the value is oversize."},{"line_number":62,"context_line":"SQL_SP_FLOAT_MAX \u003d 3.40282e+38"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"# Validate extra specs key names."},{"line_number":65,"context_line":"VALID_EXTRASPEC_NAME_REGEX \u003d re.compile(r\"[\\w\\.\\- :]+$\", re.UNICODE)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAU3%2F%2FmMQ%3D","line":62,"in_reply_to":"AAAAUX%2F%2BiDc%3D","updated":"2014-02-25 18:44:38.000000000","message":"+1.  Surely there\u0027s a sane limit that\u0027s much lower than any sort of system/db limit.","commit_id":"3c9ed4c6ed216d018076de9f1391dae36b28a883"}],"nova/tests/test_flavors.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e99fda216d4d8c415f7bf01e0fe019b397ae38ac","unresolved":false,"context_lines":[{"line_number":491,"context_line":"        self.assertInvalidInput(\u0027flavor1\u0027, 64, 1, 120,"},{"line_number":492,"context_line":"                                rxtx_factor\u003dover_rxtx_factor)"},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"        flavor \u003d flavors.create(\u0027flavor2\u0027, 64, 1, 120,"},{"line_number":495,"context_line":"                                rxtx_factor\u003dflavors.SQL_SP_FLOAT_MAX)"},{"line_number":496,"context_line":"        self.assertEqual(flavors.SQL_SP_FLOAT_MAX, flavor[\u0027rxtx_factor\u0027])"},{"line_number":497,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F%2BwmE%3D","line":494,"updated":"2014-01-22 12:46:40.000000000","message":"why does this not raise ValueError?","commit_id":"754349fd0d54db4193f4bab5990ab536092ddc8f"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"4de0ba8504a6c7984093310f0b2b4f416628040a","unresolved":false,"context_lines":[{"line_number":491,"context_line":"        self.assertInvalidInput(\u0027flavor1\u0027, 64, 1, 120,"},{"line_number":492,"context_line":"                                rxtx_factor\u003dover_rxtx_factor)"},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"        flavor \u003d flavors.create(\u0027flavor2\u0027, 64, 1, 120,"},{"line_number":495,"context_line":"                                rxtx_factor\u003dflavors.SQL_SP_FLOAT_MAX)"},{"line_number":496,"context_line":"        self.assertEqual(flavors.SQL_SP_FLOAT_MAX, flavor[\u0027rxtx_factor\u0027])"},{"line_number":497,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F%2Bjys%3D","line":494,"in_reply_to":"AAAAUH%2F%2BwmE%3D","updated":"2014-01-24 11:54:35.000000000","message":"Gary, SQL_SP_FLOAT_MAX is the max allowed so we don\u0027t expect an error.","commit_id":"754349fd0d54db4193f4bab5990ab536092ddc8f"}]}
