)]}'
{"oslo_utils/fileutils.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"8150aec7fe4a023d642280ac24af6b7fd0bf1de1","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from oslo_utils import excutils"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_FILE_CACHE \u003d {}"},{"line_number":28,"context_line":"DEFAULT_MODE \u003d stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_560db036","line":26,"updated":"2015-02-15 04:48:17.000000000","message":"Eck, do not like... (global state in a library that many projects use)...\n\nDoesn\u0027t the operating system already maintain a file cache? Maybe we should like just let that thing do its job and stop duplicating it?\n\nOr at least have the ``read_cached_file`` and such methods take a \u0027cache\u0027 keyword parameter (and default to using this module one if it is provided as none)...","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"5be8ece7b854a60b713db8898229fd9366fe1bc4","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from oslo_utils import excutils"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_FILE_CACHE \u003d {}"},{"line_number":28,"context_line":"DEFAULT_MODE \u003d stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_aa085e2e","line":26,"in_reply_to":"3afb71cf_a6b8e62a","updated":"2015-06-30 18:18:47.000000000","message":"Ya, doesn\u0027t seem so hard.\n\nhttps://github.com/openstack/taskflow/blob/master/taskflow/persistence/backends/impl_dir.py#L48\n\nThat also supports a cache with size limits...","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"e6fcee8c3d88bddf34de6ee09eb01a8811e4e7c5","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from oslo_utils import excutils"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_FILE_CACHE \u003d {}"},{"line_number":28,"context_line":"DEFAULT_MODE \u003d stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_cc1e0963","line":26,"in_reply_to":"ba3cc151_aa085e2e","updated":"2015-07-01 04:27:45.000000000","message":"Or:\n\nhttps://github.com/openstack/magnum/blob/master/magnum/common/utils.py#L295","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c289921e21e44b1ff5b937f5eae3b8839e3d6b41","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from oslo_utils import excutils"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_FILE_CACHE \u003d {}"},{"line_number":28,"context_line":"DEFAULT_MODE \u003d stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_a6b8e62a","line":26,"in_reply_to":"da86d52c_560db036","updated":"2015-06-10 21:44:50.000000000","message":"In this case, I\u0027m not sure that sharing it is bad. The contents of the cache are immutable, right? Asking the caller to provide a cache dictionary leaks the implementation details, so if we really don\u0027t want a shared cache we should create a class with read, delete, etc. methods and move the functions into that class.","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2a5f939c33db468b7d96f1fb05bc4810c7c4610f","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    if not cache_info or mtime \u003e cache_info.get(\u0027mtime\u0027, 0):"},{"line_number":64,"context_line":"        LOG.debug(\"Reloading cached file %s\" % filename)"},{"line_number":65,"context_line":"        with open(filename) as fap:"},{"line_number":66,"context_line":"            cache_info[\u0027data\u0027] \u003d fap.read()"},{"line_number":67,"context_line":"        cache_info[\u0027mtime\u0027] \u003d mtime"},{"line_number":68,"context_line":"        reloaded \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_f64b045d","line":65,"updated":"2015-02-15 04:52:26.000000000","message":"Why doesn\u0027t this use the `file_open` method itself?","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"768d37ede900d5c97d4ec779175e0287bade6824","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    if not cache_info or mtime \u003e cache_info.get(\u0027mtime\u0027, 0):"},{"line_number":64,"context_line":"        LOG.debug(\"Reloading cached file %s\" % filename)"},{"line_number":65,"context_line":"        with open(filename) as fap:"},{"line_number":66,"context_line":"            cache_info[\u0027data\u0027] \u003d fap.read()"},{"line_number":67,"context_line":"        cache_info[\u0027mtime\u0027] \u003d mtime"},{"line_number":68,"context_line":"        reloaded \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_8c4ec16d","line":65,"in_reply_to":"ba3cc151_2bc5548d","updated":"2015-07-01 04:28:48.000000000","message":"Ok, perhaps make it like whats in https://github.com/openstack/magnum/blob/stable/kilo/magnum/common/utils.py#L296 ? that one avoids yet another global thing...","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"feaa18d3e418fe32bdbb21d78de056d147ccfe10","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    if not cache_info or mtime \u003e cache_info.get(\u0027mtime\u0027, 0):"},{"line_number":64,"context_line":"        LOG.debug(\"Reloading cached file %s\" % filename)"},{"line_number":65,"context_line":"        with open(filename) as fap:"},{"line_number":66,"context_line":"            cache_info[\u0027data\u0027] \u003d fap.read()"},{"line_number":67,"context_line":"        cache_info[\u0027mtime\u0027] \u003d mtime"},{"line_number":68,"context_line":"        reloaded \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_ec9bcd70","line":65,"in_reply_to":"ba3cc151_8c4ec16d","updated":"2015-07-01 04:45:09.000000000","message":"that looks pretty good, i\u0027ll push that to oslo.policy","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"a6203b9cb8a9437277ff383ad67cfc24028da098","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    if not cache_info or mtime \u003e cache_info.get(\u0027mtime\u0027, 0):"},{"line_number":64,"context_line":"        LOG.debug(\"Reloading cached file %s\" % filename)"},{"line_number":65,"context_line":"        with open(filename) as fap:"},{"line_number":66,"context_line":"            cache_info[\u0027data\u0027] \u003d fap.read()"},{"line_number":67,"context_line":"        cache_info[\u0027mtime\u0027] \u003d mtime"},{"line_number":68,"context_line":"        reloaded \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_2bc5548d","line":65,"in_reply_to":"da86d52c_f64b045d","updated":"2015-06-30 06:00:17.000000000","message":"this should be moved to oslo.policy since thats the only spot that uses it","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"a6203b9cb8a9437277ff383ad67cfc24028da098","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    return (reloaded, cache_info[\u0027data\u0027])"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"def delete_cached_file(filename):"},{"line_number":73,"context_line":"    \"\"\"Delete cached file if present."},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    :param filename: filename to delete"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_0bbc1004","line":72,"updated":"2015-06-30 06:00:17.000000000","message":"this should be moved to oslo.policy since thats the only spot that uses it","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2a5f939c33db468b7d96f1fb05bc4810c7c4610f","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    Note: The reason this is kept in a separate module is to easily"},{"line_number":119,"context_line":"    be able to provide a stub module that doesn\u0027t alter system"},{"line_number":120,"context_line":"    state at all (for unit tests)"},{"line_number":121,"context_line":"    \"\"\""},{"line_number":122,"context_line":"    return open(*args, **kwargs)"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_b6326cf0","line":120,"updated":"2015-02-15 04:52:26.000000000","message":"I\u0027m pretty sure there exists the following so I\u0027m not sure this is useful anymore.\n\nhttps://docs.python.org/3/library/unittest.mock.html#mock-open","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"a6203b9cb8a9437277ff383ad67cfc24028da098","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    Note: The reason this is kept in a separate module is to easily"},{"line_number":119,"context_line":"    be able to provide a stub module that doesn\u0027t alter system"},{"line_number":120,"context_line":"    state at all (for unit tests)"},{"line_number":121,"context_line":"    \"\"\""},{"line_number":122,"context_line":"    return open(*args, **kwargs)"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_4bdbf87c","line":120,"in_reply_to":"3afb71cf_e6fc9eb9","updated":"2015-06-30 06:00:17.000000000","message":"suggest removing this function","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c289921e21e44b1ff5b937f5eae3b8839e3d6b41","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    Note: The reason this is kept in a separate module is to easily"},{"line_number":119,"context_line":"    be able to provide a stub module that doesn\u0027t alter system"},{"line_number":120,"context_line":"    state at all (for unit tests)"},{"line_number":121,"context_line":"    \"\"\""},{"line_number":122,"context_line":"    return open(*args, **kwargs)"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_e6fc9eb9","line":120,"in_reply_to":"da86d52c_b6326cf0","updated":"2015-06-10 21:44:50.000000000","message":"If we want to remove it, it will be easier to do before we release it into the library. However, we need a migration note in the docs explaining that mocks of this function should be updated.","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c289921e21e44b1ff5b937f5eae3b8839e3d6b41","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    return open(*args, **kwargs)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"def write_to_tempfile(content, path\u003dNone, suffix\u003d\u0027\u0027, prefix\u003d\u0027tmp\u0027):"},{"line_number":126,"context_line":"    \"\"\"Create temporary file or use existing file."},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    This util is needed for creating temporary file with"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_a6190624","line":125,"updated":"2015-06-10 21:44:50.000000000","message":"The only place I see this being used outside of a test is in openstack/keystone/keystone/contrib/federation/idp.py. We should see if we can replace that with the python stdlib module instead. Then if we update the tests similarly, we could drop this function.\n\nThat may mean, for the time being, keeping just this function in the incubator and deleting the rest of the module when it graduates. Or we could delay graduation until the cleanup work is done.","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"a6203b9cb8a9437277ff383ad67cfc24028da098","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    return open(*args, **kwargs)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"def write_to_tempfile(content, path\u003dNone, suffix\u003d\u0027\u0027, prefix\u003d\u0027tmp\u0027):"},{"line_number":126,"context_line":"    \"\"\"Create temporary file or use existing file."},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    This util is needed for creating temporary file with"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_6bf35c0b","line":125,"in_reply_to":"3afb71cf_a6190624","updated":"2015-06-30 06:00:17.000000000","message":"i\u0027m all up for deleting this function, i could put together a keystone patch","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"90715ee583a3c26323e596e979e8b37f7ea6998b","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        os.write(fd, content)"},{"line_number":147,"context_line":"    finally:"},{"line_number":148,"context_line":"        os.close(fd)"},{"line_number":149,"context_line":"    return path"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_766634f0","line":149,"updated":"2015-02-15 04:57:49.000000000","message":"Doesn\u0027t this now degrade back down to `tempfile.mktemp` (since you closed the file-handle and returned the path) which isn\u0027t recommended to use...","commit_id":"fb051c1fe9d24f68568c28bee3a8df34f126c01a"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"347e34ffc72d3e0797e7ed6f432b5e757b7e403b","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import contextlib"},{"line_number":17,"context_line":"import errno"},{"line_number":18,"context_line":"import logging"},{"line_number":19,"context_line":"import os"},{"line_number":20,"context_line":"import stat"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba3cc151_e0a66c52","line":18,"updated":"2015-07-01 07:18:33.000000000","message":"Is logging needed anymore? It doesn\u0027t appear used after all these changes.","commit_id":"6d4bf9a4e139d06482fd6cbb5627c67eb59f534f"}]}
