)]}'
{"nova/tests/test_libvirt.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"3332bd1c94748739a54ce10e32e801e91f05d6d4","unresolved":false,"context_lines":[{"line_number":382,"context_line":"        xml2 \u003d conn.cpuinfo_xml"},{"line_number":383,"context_line":"        self.assertEquals(xml1, xml2)"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"        _, tmpfilename \u003d tempfile.mkstemp()"},{"line_number":386,"context_line":"        self.flags(cpuinfo_xml_template\u003dtmpfilename)"},{"line_number":387,"context_line":"        xml2 \u003d conn.cpuinfo_xml"},{"line_number":388,"context_line":"        self.assertNotEqual(xml1, xml2)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F9sk%3D","line":385,"updated":"2011-12-12 17:45:54.000000000","message":"I\u0027d probably prefer to stub out os.stat() vs creating temp files... but I guess this is fine.","commit_id":"c99b4dac48cd1b8d2c85723988c250ae3bfb38cc"}],"nova/virt/libvirt/connection.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"4aee8c8d99e8570032d401d6e949f1bef6129857","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        if FLAGS.debug_cpuinfo_xml_template:"},{"line_number":204,"context_line":"            self._cpuinfo_xml \u003d None"},{"line_number":205,"context_line":"        else:"},{"line_number":206,"context_line":"            self._cpuinfo_xml \u003d open(FLAGS.cpuinfo_xml_template).read()"},{"line_number":207,"context_line":"        self._host_state \u003d None"},{"line_number":208,"context_line":"        self._wrapped_conn \u003d None"},{"line_number":209,"context_line":"        self.read_only \u003d read_only"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAC3%2F%2F%2FN8%3D","line":206,"updated":"2011-12-05 19:50:53.000000000","message":"How much more work would it take to have these reloads only happen if the timestamp on the file has changed?","commit_id":"b706503b9ba38571179010db4b962705407a2a6e"},{"author":{"_account_id":1419,"name":"Mike Pittaro","email":"mikeyp@LaHondaResearch.org","username":"mikeyp-3"},"change_message_id":"b5cb75e3b9b0df773cc0905199c15349abfaf67f","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        if FLAGS.debug_cpuinfo_xml_template:"},{"line_number":204,"context_line":"            self._cpuinfo_xml \u003d None"},{"line_number":205,"context_line":"        else:"},{"line_number":206,"context_line":"            self._cpuinfo_xml \u003d open(FLAGS.cpuinfo_xml_template).read()"},{"line_number":207,"context_line":"        self._host_state \u003d None"},{"line_number":208,"context_line":"        self._wrapped_conn \u003d None"},{"line_number":209,"context_line":"        self.read_only \u003d read_only"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAC3%2F%2F%2FLA%3D","line":206,"updated":"2011-12-05 21:52:07.000000000","message":"I suggest converting libvirt_xml and cpuinfo_xml into properties.","commit_id":"b706503b9ba38571179010db4b962705407a2a6e"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"688da82da712518fb373efddce548eeb2ec2fc1d","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        if FLAGS.debug_cpuinfo_xml_template:"},{"line_number":204,"context_line":"            self._cpuinfo_xml \u003d None"},{"line_number":205,"context_line":"        else:"},{"line_number":206,"context_line":"            self._cpuinfo_xml \u003d open(FLAGS.cpuinfo_xml_template).read()"},{"line_number":207,"context_line":"        self._host_state \u003d None"},{"line_number":208,"context_line":"        self._wrapped_conn \u003d None"},{"line_number":209,"context_line":"        self.read_only \u003d read_only"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAC3%2F%2F%2FNk%3D","line":206,"in_reply_to":"AAAAC3%2F%2F%2FN8%3D","updated":"2011-12-05 19:57:37.000000000","message":"++ on Kevin\u0027s suggestion.\n\nWould it be possible to omit the FLAG entirely and just make the code smart enough to stat the file for `mtime` changes and then reload if it detects a change?","commit_id":"b706503b9ba38571179010db4b962705407a2a6e"},{"author":{"_account_id":67,"name":"Vish Ishaya","email":"vishvananda@gmail.com","username":"vishvananda"},"change_message_id":"ff891c56fb1faa1ff0aeae7f0eb69491dd8e4f22","unresolved":false,"context_lines":[{"line_number":30,"context_line":":libvirt_uri:  Override for the default libvirt URI (depends on libvirt_type)."},{"line_number":31,"context_line":":libvirt_xml_template:  Libvirt XML Template."},{"line_number":32,"context_line":":libvirt_debug_xml_template:  Reload the XML Template each time a new instance"},{"line_number":33,"context_line":"                              is spawned"},{"line_number":34,"context_line":":libvirt_disk_prefix:  Override the default disk prefix for the devices"},{"line_number":35,"context_line":"                       attached to a server."},{"line_number":36,"context_line":":rescue_image_id:  Rescue ami image (None \u003d original image)."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAC3%2F%2F%2BDI%3D","line":33,"updated":"2011-12-09 17:42:47.000000000","message":"looks like you can remove this.","commit_id":"cba35ec2dbee833a45157b8c784d658630742445"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"5b1c870e9318a8c9e4ac7a8bc3ffea909e2abf80","unresolved":false,"context_lines":[{"line_number":30,"context_line":":libvirt_uri:  Override for the default libvirt URI (depends on libvirt_type)."},{"line_number":31,"context_line":":libvirt_xml_template:  Libvirt XML Template."},{"line_number":32,"context_line":":libvirt_debug_xml_template:  Reload the XML Template each time a new instance"},{"line_number":33,"context_line":"                              is spawned"},{"line_number":34,"context_line":":libvirt_disk_prefix:  Override the default disk prefix for the devices"},{"line_number":35,"context_line":"                       attached to a server."},{"line_number":36,"context_line":":rescue_image_id:  Rescue ami image (None \u003d original image)."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAC3%2F%2F9vs%3D","line":33,"in_reply_to":"AAAAC3%2F%2F%2BDI%3D","updated":"2011-12-12 12:43:02.000000000","message":"Done","commit_id":"cba35ec2dbee833a45157b8c784d658630742445"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"6e0d390c7c762ec82e27d969bbb8c155509c75de","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        return self._cpuinfo_xml"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    cpuinfo_xml \u003d property(_get_cpuinfo_xml)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"    def _get_connection(self):"},{"line_number":246,"context_line":"        if not self._wrapped_conn or not self._test_connection():"},{"line_number":247,"context_line":"            LOG.debug(_(\u0027Connecting to libvirt: %s\u0027), self.libvirt_uri)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F9QI%3D","line":244,"updated":"2011-12-13 20:39:03.000000000","message":"The caching may be a bit of a premature optimization, so I\u0027d be fine with leaving it out, if that makes things easier. But, if we choose to leave it in, might be nice to extract the core functionality into nova/utils, so we can use it elsewhere, something like:\n\n# nova/utils.py\ndef cache_with_changes_detected(filename, cache_info):\n    \"\"\"Return the contents of a file. If the file hasn\u0027t changed since the\n    last invocation, a cached version will be returned.\n    \"\"\"\n    mfime \u003d os.path.getmtime(filename)\n    if cache_info and mtime \u003d\u003d cache_info[\u0027mtime\u0027]:\n        return cache_info[\u0027data\u0027]\n\n    data \u003d open(filename).read() \n    cache_info[\u0027data\u0027] \u003d  data\n    cache_info[\u0027mtime\u0027] \u003d mtime\n    return data\n\n\n@property\ndef libvirt_xml(self):\n    if not hasattr(self, \u0027_libvirt_xml_cache_info\u0027):\n        self._libvirt_xml_cache_info \u003d {}\n\n    return utils.cache_with_changes_detected(\n        FLAGS.libvirt_xml_template, self._libvirt_xml_cache_info)\n\n\n@property\ndef cpuinfo_xml(self):\n    if not hasattr(self, \u0027_cpuinfo_xml_cache_info\u0027):\n        self._cpuinfo_xml_cache_info \u003d {}\n\n    return utils.cache_with_changes_detected(\n        FLAGS.cpuinfo_xml_template, self._cpuinfo_xml_cache_info)","commit_id":"c99b4dac48cd1b8d2c85723988c250ae3bfb38cc"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"3332bd1c94748739a54ce10e32e801e91f05d6d4","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        return self._cpuinfo_xml"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    cpuinfo_xml \u003d property(_get_cpuinfo_xml)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"    def _get_connection(self):"},{"line_number":246,"context_line":"        if not self._wrapped_conn or not self._test_connection():"},{"line_number":247,"context_line":"            LOG.debug(_(\u0027Connecting to libvirt: %s\u0027), self.libvirt_uri)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F9so%3D","line":244,"updated":"2011-12-12 17:45:54.000000000","message":"Why not just:\n\n@property\ndef libvirt_xml():\n   ...","commit_id":"c99b4dac48cd1b8d2c85723988c250ae3bfb38cc"}]}
