)]}'
{"os_vif/objects/base.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"fd609557b8aafc45dbe14747a3875ebd2f56c754","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def __str__(self):"},{"line_number":29,"context_line":"        if callable(getattr(self, \u0027obj_to_primitive\u0027, None)):"},{"line_number":30,"context_line":"            return str(self.obj_to_primitive())"},{"line_number":31,"context_line":"        return self.__str__()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_e24d1cc4","line":30,"updated":"2017-08-31 09:49:57.000000000","message":"Should we not also call jsonutils.dump before str","commit_id":"08294e3a16985b02fab2b26a954ba8fec1076f88"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"0dcaf81a62c8cc161ab1290f7a2aaf2fd7fefdb5","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def __str__(self):"},{"line_number":29,"context_line":"        if callable(getattr(self, \u0027obj_to_primitive\u0027, None)):"},{"line_number":30,"context_line":"            return str(self.obj_to_primitive())"},{"line_number":31,"context_line":"        return self.__str__()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_ef9f444d","line":30,"in_reply_to":"7f287b81_e24d1cc4","updated":"2017-09-01 09:07:37.000000000","message":"obj_to_primitive() returns a dict and we need the str of this dict. There is no need for that here.","commit_id":"08294e3a16985b02fab2b26a954ba8fec1076f88"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"1bcb1e9547ae681d365d2faea6eba4fc6aaf4fac","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    def __str__(self):"},{"line_number":29,"context_line":"        if callable(getattr(self, \u0027obj_to_primitive\u0027, None)):"},{"line_number":30,"context_line":"            return str(self.obj_to_primitive())"},{"line_number":31,"context_line":"        return self.__str__()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_30ad92ea","line":31,"range":{"start_line":31,"start_character":8,"end_line":31,"end_character":29},"updated":"2017-09-01 10:55:40.000000000","message":"this is still doing a recursive call to itself which will make this explode the call stack if you ever mix it in to a non ovo derived class.\ncan you replace this with an explicit exception instead.\n\nalso we need a test for this case.","commit_id":"8d238e32bfbc570fd9f2f45f6c8a37314ecea11a"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"f6f7aed72421a644831fc8a88e05048d2337b95a","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    def __str__(self):"},{"line_number":29,"context_line":"        if callable(getattr(self, \u0027obj_to_primitive\u0027, None)):"},{"line_number":30,"context_line":"            return str(self.obj_to_primitive())"},{"line_number":31,"context_line":"        return self.__str__()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_cb8c5f81","line":31,"range":{"start_line":31,"start_character":8,"end_line":31,"end_character":29},"in_reply_to":"7f287b81_30ad92ea","updated":"2017-09-01 11:45:07.000000000","message":"Done","commit_id":"8d238e32bfbc570fd9f2f45f6c8a37314ecea11a"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"9248fb4beb41a41eed21eae411a07c4792c5cf26","unresolved":false,"context_lines":[{"line_number":18,"context_line":"    OBJ_PROJECT_NAMESPACE \u003d \u0027os_vif\u0027"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class VersionedObjectPrintable(object):"},{"line_number":22,"context_line":"    \"\"\"Mix-in to implement __str__ method for a versioned object"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    If a versioned object needs to be printable in a easy-reading format,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_892d15ff","line":21,"range":{"start_line":21,"start_character":6,"end_line":21,"end_character":30},"updated":"2017-09-04 14:10:53.000000000","message":"This is a bit misleading as names go. There\u0027s nothing about this that would deem it \"Versioned\", is there? Rather, this is strictly about printing. Perhaps you could call it something like \"PrintableObjectMixin\"? Alternatively, subclass \u0027VersionedObject\u0027 and then you can use this name","commit_id":"41563f8a90aec5d829a762dad66e96de22e1627e"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"b06a8da5a8b48da82afa8891113f631cbaa929b3","unresolved":false,"context_lines":[{"line_number":18,"context_line":"    OBJ_PROJECT_NAMESPACE \u003d \u0027os_vif\u0027"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class VersionedObjectPrintable(object):"},{"line_number":22,"context_line":"    \"\"\"Mix-in to implement __str__ method for a versioned object"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    If a versioned object needs to be printable in a easy-reading format,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_ecf2679a","line":21,"range":{"start_line":21,"start_character":6,"end_line":21,"end_character":30},"in_reply_to":"7f287b81_892d15ff","updated":"2017-09-04 14:46:53.000000000","message":"the call to obj_to_primitive is what requres a versioned object.\n\nthis is a mixin for oslo versioned objects to make the printable. mixin should proably be in the name though.","commit_id":"41563f8a90aec5d829a762dad66e96de22e1627e"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"25672183382176cb6c1e5a6c9283cd99ca60e330","unresolved":false,"context_lines":[{"line_number":18,"context_line":"    OBJ_PROJECT_NAMESPACE \u003d \u0027os_vif\u0027"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class VersionedObjectPrintable(object):"},{"line_number":22,"context_line":"    \"\"\"Mix-in to implement __str__ method for a versioned object"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    If a versioned object needs to be printable in a easy-reading format,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_1bda76e8","line":21,"range":{"start_line":21,"start_character":6,"end_line":21,"end_character":30},"in_reply_to":"7f287b81_ecf2679a","updated":"2017-09-05 14:11:23.000000000","message":"I\u0027ll keep VersionedObject in the name and I\u0027ll add Mixin.\n\nI took the same naming convention used in oslo_versionedobjects.base (there is no mixin suffix)","commit_id":"41563f8a90aec5d829a762dad66e96de22e1627e"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"e9d325b3607a00d68d4e57ba06d87f89d27091aa","unresolved":false,"context_lines":[{"line_number":18,"context_line":"    OBJ_PROJECT_NAMESPACE \u003d \u0027os_vif\u0027"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class VersionedObjectPrintableMixin(object):"},{"line_number":22,"context_line":"    \"\"\"Mix-in to implement __str__ method for a versioned object"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    If a versioned object needs to be printable in a easy-reading format,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f287b81_9ee89416","line":21,"range":{"start_line":21,"start_character":6,"end_line":21,"end_character":35},"updated":"2017-11-20 14:02:19.000000000","message":"In hindsight, we probably could have called this PrintableVersionedObject (like ComparableVersionedObject in o.vo), but I\u0027m not going to do that to you, heh","commit_id":"ba71b69109e6781f5faee794a34050d11ed47224"}],"os_vif/objects/host_info.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"e92db70a125c5258ef1906f2aca79cb16539228d","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                                   exception.NoSupportedPortProfileVersion)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def __str__(self):"},{"line_number":75,"context_line":"        return (\u0027%(name)s(profile_object_name: %(profile_object_name)s, \u0027"},{"line_number":76,"context_line":"                \u0027max_version: %(max_version)s, min_version: %(min_version)s)\u0027 %"},{"line_number":77,"context_line":"                {\u0027name\u0027: self.__class__.__name__,"},{"line_number":78,"context_line":"                 \u0027profile_object_name\u0027: self.profile_object_name,"},{"line_number":79,"context_line":"                 \u0027max_version\u0027: self.max_version,"},{"line_number":80,"context_line":"                 \u0027min_version\u0027: self.min_version})"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"@base.VersionedObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f436f4f_c390d6f0","line":80,"range":{"start_line":75,"start_character":7,"end_line":80,"end_character":50},"updated":"2017-08-17 15:00:27.000000000","message":"honestly rather then defining our own string serialization i think i would be more comfortable just using oslo serialization and calling jsonutils.dumps to handel this instead.","commit_id":"41f0842cb9465dd7c932f505ae21dc562479fafb"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"bcac032fc22965ee8d4b7444a51e68b8899ce65a","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                                   exception.NoSupportedPortProfileVersion)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def __str__(self):"},{"line_number":75,"context_line":"        return (\u0027%(name)s(profile_object_name: %(profile_object_name)s, \u0027"},{"line_number":76,"context_line":"                \u0027max_version: %(max_version)s, min_version: %(min_version)s)\u0027 %"},{"line_number":77,"context_line":"                {\u0027name\u0027: self.__class__.__name__,"},{"line_number":78,"context_line":"                 \u0027profile_object_name\u0027: self.profile_object_name,"},{"line_number":79,"context_line":"                 \u0027max_version\u0027: self.max_version,"},{"line_number":80,"context_line":"                 \u0027min_version\u0027: self.min_version})"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"@base.VersionedObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_09178c53","line":80,"range":{"start_line":75,"start_character":7,"end_line":80,"end_character":50},"in_reply_to":"9f436f4f_c390d6f0","updated":"2017-08-28 13:18:24.000000000","message":"But this is not for serialization, only for debugging.\n\nMy intention is to use it in Nova when the port information is created to be sent to Neutron, to print this information in the debug logs.\n\nThis function is not going to be used by oslo serialization. \t\nFurthermore, to transfer the and the host info inside the port information, first we need to convert the OVO to primitive; we can\u0027t jsonutils.dumps an OVO.","commit_id":"41f0842cb9465dd7c932f505ae21dc562479fafb"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"fd609557b8aafc45dbe14747a3875ebd2f56c754","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                                   exception.NoMatchingPortProfileClass,"},{"line_number":72,"context_line":"                                   exception.NoSupportedPortProfileVersion)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def __str__(self):"},{"line_number":75,"context_line":"        return (\u0027%(name)s(profile_object_name: %(profile_object_name)s, \u0027"},{"line_number":76,"context_line":"                \u0027max_version: %(max_version)s, min_version: %(min_version)s)\u0027 %"},{"line_number":77,"context_line":"                {\u0027name\u0027: self.__class__.__name__,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_e21f5cb4","line":74,"updated":"2017-08-31 09:49:57.000000000","message":"You should not need this with the mixin","commit_id":"08294e3a16985b02fab2b26a954ba8fec1076f88"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"0dcaf81a62c8cc161ab1290f7a2aaf2fd7fefdb5","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                                   exception.NoMatchingPortProfileClass,"},{"line_number":72,"context_line":"                                   exception.NoSupportedPortProfileVersion)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def __str__(self):"},{"line_number":75,"context_line":"        return (\u0027%(name)s(profile_object_name: %(profile_object_name)s, \u0027"},{"line_number":76,"context_line":"                \u0027max_version: %(max_version)s, min_version: %(min_version)s)\u0027 %"},{"line_number":77,"context_line":"                {\u0027name\u0027: self.__class__.__name__,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_cf9c886b","line":74,"in_reply_to":"7f287b81_e21f5cb4","updated":"2017-09-01 09:07:37.000000000","message":"Yes... I always forget something!","commit_id":"08294e3a16985b02fab2b26a954ba8fec1076f88"}],"os_vif/tests/unit/test_base.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"9248fb4beb41a41eed21eae411a07c4792c5cf26","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self.assertEqual(obj_orig_primitive, obj_new_primitive)"},{"line_number":68,"context_line":"        self.assertEqual(obj_orig, obj_new)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def test_import_non_ovo_class(self):"},{"line_number":71,"context_line":"        \"\"\"Test VersionedObjectPrintable could be inherited by non-OVO classes."},{"line_number":72,"context_line":"        \"\"\""},{"line_number":73,"context_line":"        class NonOVOClass(osv_base.VersionedObjectPrintable):"},{"line_number":74,"context_line":"            def __str__(self):"},{"line_number":75,"context_line":"                return \"NonOVOClass __str__ method\""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        self.assertEqual(\"NonOVOClass __str__ method\", str(NonOVOClass()))"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_c942fdab","line":77,"range":{"start_line":70,"start_character":0,"end_line":77,"end_character":74},"updated":"2017-09-04 14:10:53.000000000","message":"Hmm, why do we care about this? Is this something we plan to support?","commit_id":"41563f8a90aec5d829a762dad66e96de22e1627e"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"25672183382176cb6c1e5a6c9283cd99ca60e330","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self.assertEqual(obj_orig_primitive, obj_new_primitive)"},{"line_number":68,"context_line":"        self.assertEqual(obj_orig, obj_new)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def test_import_non_ovo_class(self):"},{"line_number":71,"context_line":"        \"\"\"Test VersionedObjectPrintable could be inherited by non-OVO classes."},{"line_number":72,"context_line":"        \"\"\""},{"line_number":73,"context_line":"        class NonOVOClass(osv_base.VersionedObjectPrintable):"},{"line_number":74,"context_line":"            def __str__(self):"},{"line_number":75,"context_line":"                return \"NonOVOClass __str__ method\""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        self.assertEqual(\"NonOVOClass __str__ method\", str(NonOVOClass()))"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_7b161aaa","line":77,"range":{"start_line":70,"start_character":0,"end_line":77,"end_character":74},"in_reply_to":"7f287b81_4ce97bb5","updated":"2017-09-05 14:11:23.000000000","message":"Although we have no plans to support it, you can still inherit this class from non-OVO. This test is just to check it, just in case.","commit_id":"41563f8a90aec5d829a762dad66e96de22e1627e"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"8f0e805f815ad31efe66ac6bf4e62886d0e11388","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self.assertEqual(obj_orig_primitive, obj_new_primitive)"},{"line_number":68,"context_line":"        self.assertEqual(obj_orig, obj_new)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def test_import_non_ovo_class(self):"},{"line_number":71,"context_line":"        \"\"\"Test VersionedObjectPrintable could be inherited by non-OVO classes."},{"line_number":72,"context_line":"        \"\"\""},{"line_number":73,"context_line":"        class NonOVOClass(osv_base.VersionedObjectPrintable):"},{"line_number":74,"context_line":"            def __str__(self):"},{"line_number":75,"context_line":"                return \"NonOVOClass __str__ method\""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        self.assertEqual(\"NonOVOClass __str__ method\", str(NonOVOClass()))"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_4ce97bb5","line":77,"range":{"start_line":70,"start_character":0,"end_line":77,"end_character":74},"in_reply_to":"7f287b81_c942fdab","updated":"2017-09-04 14:44:10.000000000","message":"no but the original implementation had an infinity loop to its self in this case which would have caused a stack over flow if you used this mixin in a non ovo based class.\n\nthis explicitly test that cause so it wont happen if someone introduces a recursive call to iteslf in the future.","commit_id":"41563f8a90aec5d829a762dad66e96de22e1627e"}],"os_vif/tests/unit/test_host_info.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"9dfe14979eea2b062424b9be6d2695ca57198e4a","unresolved":false,"context_lines":[{"line_number":186,"context_line":"    def test__str(self):"},{"line_number":187,"context_line":"        _str \u003d (\u0027HostInfo(plugin_info: [%(plugin_info)s])\u0027 %"},{"line_number":188,"context_line":"                {\u0027plugin_info\u0027:"},{"line_number":189,"context_line":"                 \u0027, \u0027.join(map(str, self.host_info.plugin_info))})"},{"line_number":190,"context_line":"        self.assertEqual(_str, str(self.host_info))"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    def test_serialize_object(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f436f4f_4f652d45","line":189,"range":{"start_line":189,"start_character":27,"end_line":189,"end_character":63},"updated":"2017-08-17 12:44:07.000000000","message":"why use map instead of just calling str(self.host_info.plugin_info)","commit_id":"41f0842cb9465dd7c932f505ae21dc562479fafb"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"0d22fb68679e7bc17c4c2a06f5546fb13dbe48ac","unresolved":false,"context_lines":[{"line_number":186,"context_line":"    def test__str(self):"},{"line_number":187,"context_line":"        _str \u003d (\u0027HostInfo(plugin_info: [%(plugin_info)s])\u0027 %"},{"line_number":188,"context_line":"                {\u0027plugin_info\u0027:"},{"line_number":189,"context_line":"                 \u0027, \u0027.join(map(str, self.host_info.plugin_info))})"},{"line_number":190,"context_line":"        self.assertEqual(_str, str(self.host_info))"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    def test_serialize_object(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f436f4f_78931502","line":189,"range":{"start_line":189,"start_character":27,"end_line":189,"end_character":63},"in_reply_to":"9f436f4f_4f652d45","updated":"2017-08-17 14:26:41.000000000","message":"I don\u0027t find any \"official\" document. Take a look at this: https://stackoverflow.com/questions/727761/python-str-and-lists\n\nBecause self.host_info.plugin_info is a list (a CoercedList), to represent the elements inside this list, the \"__repr__\" is called insted of \"__str__\". And the implemented \"__repr__\" method is in https://github.com/openstack/oslo.versionedobjects/blob/master/oslo_versionedobjects/base.py#L309\n\nThat\u0027s why I\u0027m executing str() for each list element.","commit_id":"41f0842cb9465dd7c932f505ae21dc562479fafb"}]}
