)]}'
{"oslo_versionedobjects/fields.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4f762bc27d02c4413f9c4931c8f9b7171774fced","unresolved":false,"context_lines":[{"line_number":347,"context_line":"    def coerce(obj, attr, value):"},{"line_number":348,"context_line":"        # FIXME(danms): We should actually verify the UUIDness here"},{"line_number":349,"context_line":"        with warnings.catch_warnings():"},{"line_number":350,"context_line":"            # Change the warning action only if no other filter exists"},{"line_number":351,"context_line":"            # for this warning to allow the client to define other action"},{"line_number":352,"context_line":"            # like \u0027error\u0027 for this warning."},{"line_number":353,"context_line":"            warnings.filterwarnings(action\u003d\"once\", append\u003dTrue)"},{"line_number":354,"context_line":"            try:"},{"line_number":355,"context_line":"                uuid.UUID(str(value))"},{"line_number":356,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa0c359_94122ab1","line":353,"range":{"start_line":350,"start_character":0,"end_line":353,"end_character":63},"updated":"2018-02-05 13:57:34.000000000","message":"It wasn\u0027t clear to me initially, but this works because of the \u0027append\u0027 argument. From the warning docs [1]:\n\n  The entry is inserted at the front by default; if append is \n  true, it is inserted at the end.\n\nand\n\n  Entries closer to the front of the list override entries\n  later in the list, if both match a particular warning.\n\nso this makes sense.\n\nAs an aside, the logic for this should really live in whatever application is using this library. However, this would be a big ask so I understand why this is not done this way.\n\n[1] https://docs.python.org/2/library/warnings.html#warnings.filterwarnings","commit_id":"0e3526710f67b3b4ebab60864ea060fa9caf9537"}]}
