)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f8c58d39702fca7d280eb6e1d57eca18192593f0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"9da58545_5aa41c70","updated":"2025-11-10 16:43:22.000000000","message":"recheck pep8 fix merged","commit_id":"1a53d2b5de0eb26e05d7ac4dd9aa997ecf3c6558"}],"ovsdbapp/utils.py":[{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3eb16f090b93240b4174ee0625c547d1e9fa326","unresolved":true,"context_lines":[{"line_number":83,"context_line":"        return False"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"def get_uuid(reg_uuid_or_cmd):"},{"line_number":87,"context_line":"    \"\"\"Return the UUID of a UUID itself or a BaseCommand|RowView|Row\"\"\""},{"line_number":88,"context_line":"    if isinstance(reg_uuid_or_cmd, api.Command):"},{"line_number":89,"context_line":"        reg_uuid \u003d reg_uuid_or_cmd.result"}],"source_content_type":"text/x-python","patch_set":1,"id":"d5878bf6_898fc5cc","line":86,"updated":"2025-11-11 17:01:26.000000000","message":"It occurs to me that this function existing in top-level ovsdbapp.utils is a little problematic since it requires a specific backend (granted there is only one now)--not that that was introduced in this particular patch.\n\nLooks like the only place ovsdbapp uses it is in error string generation, but neutron uses it. I wonder if we can remove the dependency by just doing \"better-to-ask-forgiveness\"-style w/ exceptions, e.g.\n\n    def get_uuid(obj):\n        try:\n            obj \u003d obj.result\n        except AttributeError:\n            pass\n        try:\n            return obj.uuid\n        except AttributeError:\n            return obj\n\nThe method currently doesn\u0027t look like it has any testing, setting up some fake stuff like\n\n```\nclass Row:\n    def __init__(self, uuid_\u003dNone):\n        self.uuid \u003d uuid_ or uuid.uuid4()\n\n\nclass Command:\n    def __init__(self, result\u003dNone):\n        self.result \u003d result or Row(uuid.uuid4())\n\n\nu \u003d uuid.uuid4()\ncases \u003d [u, Row(u), Command(Row(u)), Command(u)]\n\nfor case in cases:\n    res \u003d get_uuid(case)\n    assert(res is u)\n    print(res)\n```\n\nlooked like the try/except style above worked though.","commit_id":"1a53d2b5de0eb26e05d7ac4dd9aa997ecf3c6558"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"1bf75b86f12170f7f0cfd30142f8b083cca44c1b","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        return False"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"def get_uuid(reg_uuid_or_cmd):"},{"line_number":87,"context_line":"    \"\"\"Return the UUID of a UUID itself or a BaseCommand|RowView|Row\"\"\""},{"line_number":88,"context_line":"    if isinstance(reg_uuid_or_cmd, api.Command):"},{"line_number":89,"context_line":"        reg_uuid \u003d reg_uuid_or_cmd.result"}],"source_content_type":"text/x-python","patch_set":1,"id":"99842ee0_9dce5656","line":86,"in_reply_to":"6dea9f40_0311aabc","updated":"2025-11-13 09:54:57.000000000","message":"This last one is perfect and works with the tests (that I need to implement). Thanks!","commit_id":"1a53d2b5de0eb26e05d7ac4dd9aa997ecf3c6558"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"b29009820cf216844532be27b0465cdd82a040a4","unresolved":true,"context_lines":[{"line_number":83,"context_line":"        return False"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"def get_uuid(reg_uuid_or_cmd):"},{"line_number":87,"context_line":"    \"\"\"Return the UUID of a UUID itself or a BaseCommand|RowView|Row\"\"\""},{"line_number":88,"context_line":"    if isinstance(reg_uuid_or_cmd, api.Command):"},{"line_number":89,"context_line":"        reg_uuid \u003d reg_uuid_or_cmd.result"}],"source_content_type":"text/x-python","patch_set":1,"id":"6dea9f40_0311aabc","line":86,"in_reply_to":"d5878bf6_898fc5cc","updated":"2025-11-12 18:56:12.000000000","message":"or\n```\ndef get_uuid(obj):\n    obj \u003d getattr(obj, \u0027result\u0027, obj)\n    try:\n        return obj.uuid\n    except AttributeError:\n        return obj \n```\nto simplify even more.","commit_id":"1a53d2b5de0eb26e05d7ac4dd9aa997ecf3c6558"}]}
