)]}'
{"nova/db/sqlalchemy/trait_cache.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2c5b0d96ffddf1a27441cd290853d247776ba17a","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        self.ctx \u003d ctx"},{"line_number":76,"context_line":"        self.id_cache \u003d {}"},{"line_number":77,"context_line":"        self.str_cache \u003d {}"},{"line_number":78,"context_line":"        _sync_standard_traits(self.ctx)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def clear(self):"},{"line_number":81,"context_line":"        with lockutils.lock(_LOCKNAME):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_c872b27b","line":78,"updated":"2017-05-11 03:20:38.000000000","message":"ok, we only can trigger the sync by restart the service.","commit_id":"51571c9594a6abba6f995ff43208cd2c62c4e84a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2c5b0d96ffddf1a27441cd290853d247776ba17a","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        :param trait_str: The string representation of the trait to look up a"},{"line_number":90,"context_line":"                          numeric identifier for."},{"line_number":91,"context_line":"        :returns integer identifier for the trait, or None, if no such trait"},{"line_number":92,"context_line":"                 was found."},{"line_number":93,"context_line":"        :raises `exception.TraitNotFound` if trait_str cannot be found."},{"line_number":94,"context_line":"        \"\"\""},{"line_number":95,"context_line":"        with lockutils.lock(_LOCKNAME):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_0812da09","line":92,"range":{"start_line":91,"start_character":54,"end_line":92,"end_character":27},"updated":"2017-05-11 03:20:38.000000000","message":"This isn\u0027t the truth","commit_id":"51571c9594a6abba6f995ff43208cd2c62c4e84a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2c5b0d96ffddf1a27441cd290853d247776ba17a","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        :param trait_id: The numeric representation of the trait to look up a"},{"line_number":110,"context_line":"                         string identifier for."},{"line_number":111,"context_line":"        :returns: string identifier for the trait, or None, if no such trait"},{"line_number":112,"context_line":"                  was found."},{"line_number":113,"context_line":"        :raises `exception.TraitNotFound` if trait_id cannot be found."},{"line_number":114,"context_line":"        \"\"\""},{"line_number":115,"context_line":"        with lockutils.lock(_LOCKNAME):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_c8f752d3","line":112,"range":{"start_line":111,"start_character":54,"end_line":112,"end_character":28},"updated":"2017-05-11 03:20:38.000000000","message":"ditto","commit_id":"51571c9594a6abba6f995ff43208cd2c62c4e84a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"da94405f68eb99cadec9ce7ea411994be2cc1615","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            if trait_str in self.id_cache:"},{"line_number":97,"context_line":"                return self.id_cache[trait_str]"},{"line_number":98,"context_line":"            # Otherwise, check the database table"},{"line_number":99,"context_line":"            _refresh_from_db(self.ctx, self)"},{"line_number":100,"context_line":"            if trait_str in self.id_cache:"},{"line_number":101,"context_line":"                return self.id_cache[trait_str]"},{"line_number":102,"context_line":"            raise exception.TraitNotFound(name\u003dtrait_str)"}],"source_content_type":"text/x-python","patch_set":6,"id":"df140735_4c4cc89d","line":99,"updated":"2017-05-30 17:54:24.000000000","message":"So worst case: a new os-traits library is released containing a new standard trait FOO. Code tries to access the FOO trait, so it fails above, and the cache is refreshed from the DB. It still won\u0027t have FOO, right? Not until the cache is recreated and _sync_standard_traits() is called.","commit_id":"44523e9040dbf47fc05a7f3d13ef4b4d15fc6c56"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1d3e38bb88c8548ecfff94c6f4fbddd039892da3","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            if trait_str in self.id_cache:"},{"line_number":97,"context_line":"                return self.id_cache[trait_str]"},{"line_number":98,"context_line":"            # Otherwise, check the database table"},{"line_number":99,"context_line":"            _refresh_from_db(self.ctx, self)"},{"line_number":100,"context_line":"            if trait_str in self.id_cache:"},{"line_number":101,"context_line":"                return self.id_cache[trait_str]"},{"line_number":102,"context_line":"            raise exception.TraitNotFound(name\u003dtrait_str)"}],"source_content_type":"text/x-python","patch_set":6,"id":"df140735_62a8b51e","line":99,"in_reply_to":"df140735_4c4cc89d","updated":"2017-05-30 18:58:08.000000000","message":"_sync_standard_traits() is called in the constructor. If a new os-traits library is released, in order to take advantage of it, the code running this module would necessarily need to be reloaded, which would cause _sync_standard_traits() to run, which would write the new FOO entry into the traits table in the DB. The first time someone requested *any* trait at all, _refresh_from_db() would be called which would bring in all traits, including the newly-created FOO trait.","commit_id":"44523e9040dbf47fc05a7f3d13ef4b4d15fc6c56"}]}
