)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"0693e39002714644d5c72699f2e54076286f4c87","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Coerces string values to a boolean only when the prop is given a"},{"line_number":10,"context_line":"type\u003dbool. Only accepts string words, no shortened values, synonyms"},{"line_number":11,"context_line":"or integer values. When no acceptable value is found a TypeError"},{"line_number":12,"context_line":"is raised."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I382426325522227a83ec5234c5116da97e71cfa2"},{"line_number":15,"context_line":"Closes-Bug: #1365724"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"baa201ad_0e13f5b8","line":12,"updated":"2014-10-01 20:27:59.000000000","message":"Validate this, there are instances where we would raise ValueError now as well.  \n\nAlso, mention fail-fast behavior on set for completeness as it allso applies to validation during constructor.","commit_id":"f82c1fbdea4a603ef3fa204ba5e27252b1839c92"}],"openstack/format.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"042c9f8b286585097b0204c81812ab7b0faad20d","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        Transforms the given value as a json string."},{"line_number":40,"context_line":"        \"\"\""},{"line_number":41,"context_line":"        return str(given)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baa201ad_5d64df21","line":41,"updated":"2014-10-01 13:19:53.000000000","message":"If you\u0027re not using `cls` just use the @staticmethod decorator and declare it as:\n\n\n@staticmethod\ndef to_json(given):\n    \"...\"\n\nSame goes for BoolStr.parse","commit_id":"f82c1fbdea4a603ef3fa204ba5e27252b1839c92"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"0693e39002714644d5c72699f2e54076286f4c87","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        Transforms the given value as a json string."},{"line_number":40,"context_line":"        \"\"\""},{"line_number":41,"context_line":"        return str(given)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baa201ad_4eac1da1","line":41,"in_reply_to":"baa201ad_5d64df21","updated":"2014-10-01 20:27:59.000000000","message":"Done","commit_id":"f82c1fbdea4a603ef3fa204ba5e27252b1839c92"},{"author":{"_account_id":8257,"name":"Brian Curtin","email":"brian@python.org","username":"briancurtin"},"change_message_id":"9cd9e4186bf612d7581f9d793402be0c08543ef2","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    __nonzero__ \u003d __bool__"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def to_json(self):"},{"line_number":40,"context_line":"        \"\"\"A boolean-to-string transformer."},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        Transforms the given value as a json string."}],"source_content_type":"text/x-python","patch_set":5,"id":"baa201ad_19632bb2","line":39,"updated":"2014-10-02 15:10:26.000000000","message":"I think this should just be the __str__ method. I get what it\u0027s doing, but it\u0027s not *really* converting this to JSON.","commit_id":"33f288fce994c295d952c27f65e0f22723c32276"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"2f325bd27f2d2941c8e2fa90fceed8423f711b21","unresolved":false,"context_lines":[{"line_number":22,"context_line":"        Interprets the given value as a boolean, ignoring whitespace and case."},{"line_number":23,"context_line":"        A TypeError is raised when interpreted as neither True nor False."},{"line_number":24,"context_line":"        \"\"\""},{"line_number":25,"context_line":"        expr \u003d str(given).lower()"},{"line_number":26,"context_line":"        if \u0027true\u0027 \u003d\u003d expr:"},{"line_number":27,"context_line":"            self.parsed \u003d True"},{"line_number":28,"context_line":"        elif \u0027false\u0027 \u003d\u003d expr:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_a9582c33","line":25,"updated":"2014-10-21 19:33:16.000000000","message":"Might given ever have a unicode value that can\u0027t be encoded to ASCII, causing str(given) to fail?","commit_id":"049a2a09d545fd0c82055f64335564cf67415988"}],"openstack/resource.py":[{"author":{"_account_id":8736,"name":"Terry Howe","email":"terrylhowe@gmail.com","username":"terrylhowe"},"change_message_id":"a8ab96048910ba0079b8d75384413e4ff54086b9","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        if self.type and not isinstance(value, self.type):"},{"line_number":75,"context_line":"            if self.type is bool:"},{"line_number":76,"context_line":"                try:"},{"line_number":77,"context_line":"                    value \u003d utils.as_bool(value)"},{"line_number":78,"context_line":"                except TypeError:"},{"line_number":79,"context_line":"                    raise TypeError(\u0027Invalid type for attr %s\u0027 % self.name)"},{"line_number":80,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9df570_daccf08b","line":77,"updated":"2014-09-26 15:09:10.000000000","message":"While this works for what you have here, I\u0027m not sure how it will work with an API that expects to get \u0027True\u0027 or \u0027False\u0027 instead of true of false.  I think we\u0027ll need a whole different class BoolStr or something that we use for a type.","commit_id":"2dcb84b1c533b375e60a43565b1c83f7c4862297"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"042c9f8b286585097b0204c81812ab7b0faad20d","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        if self.type and not isinstance(value, self.type):"},{"line_number":74,"context_line":"            do_parse \u003d getattr(self.type, \u0027parse\u0027, None)"},{"line_number":75,"context_line":"            if callable(do_parse):"},{"line_number":76,"context_line":"                return do_parse(value)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        return value"}],"source_content_type":"text/x-python","patch_set":4,"id":"baa201ad_dd5e0f45","line":75,"updated":"2014-10-01 13:19:53.000000000","message":"If we\u0027re writing this with an eye towards Python 3 compatibility you have to import collections and check like so\n\nif isintance(do_parse, collections.Callable):\n    return do_parse(value)","commit_id":"f82c1fbdea4a603ef3fa204ba5e27252b1839c92"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"7b5ba072e792d67183856f46fed65cc55f133922","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        if self.type and not isinstance(value, self.type):"},{"line_number":74,"context_line":"            do_parse \u003d getattr(self.type, \u0027parse\u0027, None)"},{"line_number":75,"context_line":"            if callable(do_parse):"},{"line_number":76,"context_line":"                return do_parse(value)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        return value"}],"source_content_type":"text/x-python","patch_set":4,"id":"baa201ad_ae3589dc","line":75,"in_reply_to":"baa201ad_dd5e0f45","updated":"2014-10-01 20:13:22.000000000","message":"Ignore that. I was thinking of something else.","commit_id":"f82c1fbdea4a603ef3fa204ba5e27252b1839c92"},{"author":{"_account_id":8257,"name":"Brian Curtin","email":"brian@python.org","username":"briancurtin"},"change_message_id":"9cd9e4186bf612d7581f9d793402be0c08543ef2","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        if self.type and not isinstance(value, self.type):"},{"line_number":74,"context_line":"            value \u003d self.type(value)"},{"line_number":75,"context_line":"            if hasattr(value, \u0027parsed\u0027):"},{"line_number":76,"context_line":"                value \u003d value.parsed"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        return value"}],"source_content_type":"text/x-python","patch_set":5,"id":"baa201ad_4b3b1ad1","line":75,"updated":"2014-10-02 15:10:26.000000000","message":"Although what you have here works for BoolStr, I\u0027d rather future-proof this and go with the more common idiom of using `getattr(value, \u0027parsed\u0027, False)`.\n\nReference: https://mail.python.org/pipermail/python-dev/2010-August/103178.html (also a few hasattr vs getattr posts around)","commit_id":"33f288fce994c295d952c27f65e0f22723c32276"},{"author":{"_account_id":8257,"name":"Brian Curtin","email":"brian@python.org","username":"briancurtin"},"change_message_id":"9cd9e4186bf612d7581f9d793402be0c08543ef2","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    def __set__(self, instance, value):"},{"line_number":81,"context_line":"        if self.type and not isinstance(value, self.type):"},{"line_number":82,"context_line":"            try:"},{"line_number":83,"context_line":"                value \u003d self.type(value).to_json()  # validate to fail fast"},{"line_number":84,"context_line":"            except AttributeError:"},{"line_number":85,"context_line":"                raise TypeError(\u0027Invalid type for attr: %s\u0027 % self.name)"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"baa201ad_0ba7520d","line":83,"updated":"2014-10-02 15:10:26.000000000","message":"I think this is where should just `str` it since we\u0027re not technically producing JSON here, but a value to be submitted in a JSON body.","commit_id":"33f288fce994c295d952c27f65e0f22723c32276"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"726cabd62094ef947fd83f42a35722c0ab515377","unresolved":false,"context_lines":[{"line_number":75,"context_line":"            try:"},{"line_number":76,"context_line":"                value \u003d getattr(value, \u0027parsed\u0027)"},{"line_number":77,"context_line":"            except AttributeError:"},{"line_number":78,"context_line":"                pass"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        return value"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_a736aee5","line":78,"updated":"2014-10-10 23:48:36.000000000","message":"for some reason I couldn\u0027t work out, using the default value of False caused an if to always fail, so I structured this as a try/except instead.","commit_id":"ac67b4da8b23c6d8aa3a9d68ca969218e908e1f7"},{"author":{"_account_id":8257,"name":"Brian Curtin","email":"brian@python.org","username":"briancurtin"},"change_message_id":"e9e10e4f8b3f3023cb0ff83a223010bf4d752871","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        if self.type and not isinstance(value, self.type):"},{"line_number":74,"context_line":"            value \u003d self.type(value)"},{"line_number":75,"context_line":"            if getattr(value, \u0027parsed\u0027, None) is not None:"},{"line_number":76,"context_line":"                value \u003d getattr(value, \u0027parsed\u0027)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        return value"}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_c91f27b6","line":75,"updated":"2014-10-13 17:14:14.000000000","message":"Now that we\u0027ve switched to getattr, this should actually be something more like:\n\n    attr \u003d getattr(value, \"parsed\", None)\n    if attr is not None:\n        value \u003d attr","commit_id":"65786d8a505f4e85811785a1e5ebf9756fb8103e"}],"openstack/tests/network/v2/test_port.py":[{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"0693e39002714644d5c72699f2e54076286f4c87","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    \u0027device_id\u0027: \u00278\u0027,"},{"line_number":27,"context_line":"    \u0027device_owner\u0027: \u00279\u0027,"},{"line_number":28,"context_line":"    \u0027extra_dhcp_opts\u0027: {\u002710\u0027: 10},"},{"line_number":29,"context_line":"    \u0027fixed_ips\u0027: {\u002711\u0027: \u002712\u0027},"},{"line_number":30,"context_line":"    \u0027id\u0027: IDENTIFIER,"},{"line_number":31,"context_line":"    \u0027mac_address\u0027: \u002713\u0027,"},{"line_number":32,"context_line":"    \u0027name\u0027: \u002714\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"baa201ad_6eb801e6","line":29,"updated":"2014-10-01 20:27:59.000000000","message":"Side effect (possibly undesired) of this change is that props labeled as type\u003ddict have that enforced by the constructor now.\n\nThese changes were due to that.","commit_id":"f82c1fbdea4a603ef3fa204ba5e27252b1839c92"}],"openstack/tests/network/v2/test_router.py":[{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"0693e39002714644d5c72699f2e54076286f4c87","unresolved":false,"context_lines":[{"line_number":18,"context_line":"IDENTIFIER \u003d \u0027IDENTIFIER\u0027"},{"line_number":19,"context_line":"EXAMPLE \u003d {"},{"line_number":20,"context_line":"    \u0027admin_state_up\u0027: True,"},{"line_number":21,"context_line":"    \u0027external_gateway_info\u0027: {\u00272\u0027: \u00273\u0027},"},{"line_number":22,"context_line":"    \u0027id\u0027: IDENTIFIER,"},{"line_number":23,"context_line":"    \u0027name\u0027: \u00274\u0027,"},{"line_number":24,"context_line":"    \u0027tenant_id\u0027: \u00275\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"baa201ad_4e597dfd","line":21,"updated":"2014-10-01 20:27:59.000000000","message":"Side effect (possibly undesired) of this change is that props labeled as type\u003ddict have that enforced by the constructor now.\n\nThis change was due to that.","commit_id":"f82c1fbdea4a603ef3fa204ba5e27252b1839c92"}],"openstack/tests/test_format.py":[{"author":{"_account_id":8257,"name":"Brian Curtin","email":"brian@python.org","username":"briancurtin"},"change_message_id":"9cd9e4186bf612d7581f9d793402be0c08543ef2","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class TestFormat(testtools.TestCase):"},{"line_number":18,"context_line":"    def test_parse_true(self):"},{"line_number":19,"context_line":"        self.assertEqual(True, format.BoolStr(True).parsed)"},{"line_number":20,"context_line":"        self.assertEqual(True, format.BoolStr(\u0027True\u0027).parsed)"},{"line_number":21,"context_line":"        self.assertEqual(True, format.BoolStr(\u0027TRUE\u0027).parsed)"},{"line_number":22,"context_line":"        self.assertEqual(True, format.BoolStr(\u0027true\u0027).parsed)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baa201ad_2bcfb6b1","line":19,"updated":"2014-10-02 15:10:26.000000000","message":"Not a big deal, but you could do...\n\n    self.assertTrue(format.BoolStr(True).parsed)\n    self.assertFalse(format.BoolStr(False).parsed)","commit_id":"33f288fce994c295d952c27f65e0f22723c32276"}],"openstack/tests/test_resource.py":[{"author":{"_account_id":8736,"name":"Terry Howe","email":"terrylhowe@gmail.com","username":"terrylhowe"},"change_message_id":"a8ab96048910ba0079b8d75384413e4ff54086b9","unresolved":false,"context_lines":[{"line_number":335,"context_line":""},{"line_number":336,"context_line":"    def test_bool_prop(self):"},{"line_number":337,"context_line":"        faker \u003d FakeResource(fake_data)"},{"line_number":338,"context_line":"        self.assertTrue(faker.enabled)"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"        faker.enabled \u003d \u0027True\u0027"},{"line_number":341,"context_line":"        self.assertTrue(faker.enabled)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9df570_ba21ec4e","line":338,"updated":"2014-09-26 15:09:10.000000000","message":"assertTrue is bool(expr) is True which is a little different than assertEqual(faker.enabled, True)","commit_id":"2dcb84b1c533b375e60a43565b1c83f7c4862297"},{"author":{"_account_id":8736,"name":"Terry Howe","email":"terrylhowe@gmail.com","username":"terrylhowe"},"change_message_id":"a8ab96048910ba0079b8d75384413e4ff54086b9","unresolved":false,"context_lines":[{"line_number":344,"context_line":"        self.assertTrue(faker.enabled)"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"        faker.enabled \u003d \u0027true\u0027"},{"line_number":347,"context_line":"        self.assertTrue(faker.enabled)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9df570_7adb044f","line":347,"updated":"2014-09-26 15:09:10.000000000","message":"No test cases for False which could be dangerous since if \u0027False\u0027: is True","commit_id":"2dcb84b1c533b375e60a43565b1c83f7c4862297"}]}
