)]}'
{"nova/network/manager.py":[{"author":{"_account_id":385,"name":"Jason Kölker","email":"jason@koelker.net","username":"jason-koelker"},"change_message_id":"eab3bb6983d63d87634c63209c4d7e749b63eccc","unresolved":false,"context_lines":[{"line_number":471,"context_line":"            self.instance_dns_manager \u003d utils.import_object(FLAGS.instance_dns_manager)"},{"line_number":472,"context_line":"        else:"},{"line_number":473,"context_line":"            self.instance_dns_manager \u003d None"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"        self.network_api \u003d network_api.API()"},{"line_number":476,"context_line":"        self.compute_api \u003d compute_api.API()"},{"line_number":477,"context_line":"        super(NetworkManager, self).__init__(service_name\u003d\u0027network\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACn%2F%2F8RM%3D","line":474,"updated":"2011-11-28 20:54:47.000000000","message":"I think it would be better to define a InstanceDnsManagerDriver object that by default does nothing, but defines the interface. Then subclass that for the implementation. This would allow FLAGS.instance_dns_manager to have a default value that can always be imported/used and remove all the if statements below.","commit_id":"18875fde3964f612d12a6b11da5ecafed3728b32"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d175b7126677cdefaea89f70661071c53ba3acc2","unresolved":false,"context_lines":[{"line_number":827,"context_line":""},{"line_number":828,"context_line":"        instance_ref \u003d self.db.instance_get(context, instance_id)"},{"line_number":829,"context_line":"        name \u003d instance_ref[\u0027display_name\u0027]"},{"line_number":830,"context_line":"        self.instance_dns_manager.create_entry(name, address, \\"},{"line_number":831,"context_line":"                                               \"type\", FLAGS.instance_dns_zone)"},{"line_number":832,"context_line":""},{"line_number":833,"context_line":"        self._setup_network(context, network)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAC3%2F%2F%2Bns%3D","line":830,"updated":"2011-12-07 16:51:35.000000000","message":"There is no need for a \u0027\\\u0027 here.","commit_id":"79c0a226c11a2f7e4f5c019601a0d2413293639d"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"b7450e94144201a441b49aa75cd453963bcfd6db","unresolved":false,"context_lines":[{"line_number":824,"context_line":"                      \u0027virtual_interface_id\u0027: vif[\u0027id\u0027]}"},{"line_number":825,"context_line":"            self.db.fixed_ip_update(context, address, values)"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"        instance_ref \u003d self.db.instance_get(context, instance_id)"},{"line_number":828,"context_line":"        name \u003d instance_ref[\u0027display_name\u0027]"},{"line_number":829,"context_line":"        self.instance_dns_manager.create_entry(name, address,"},{"line_number":830,"context_line":"                                               \"type\", FLAGS.instance_dns_zone)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAC3%2F%2F%2BcY%3D","line":827,"updated":"2011-12-08 14:51:24.000000000","message":"I would love to keep this compute-specific db lookup out of the network manager. Maybe it\u0027s just a pipe dream, so I\u0027m going to approve with the understanding that it will be cleaned up later once the service boundaries are better defined.","commit_id":"88a0f06ac7f104220b2d92f66599089a9e1d4c92"}],"nova/network/minidns.py":[{"author":{"_account_id":385,"name":"Jason Kölker","email":"jason@koelker.net","username":"jason-koelker"},"change_message_id":"eab3bb6983d63d87634c63209c4d7e749b63eccc","unresolved":false,"context_lines":[{"line_number":1,"context_line":"import shutil"},{"line_number":2,"context_line":"import os"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"class minidns(object):"},{"line_number":5,"context_line":"    \"\"\" Trivial DNS driver. This will read/write to a local, flat file"},{"line_number":6,"context_line":"        and have no effect on your actual DNS system. This class is "},{"line_number":7,"context_line":"        strictly for testing purposes, and should keep you out of dependency hell.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACn%2F%2F8RI%3D","line":4,"updated":"2011-11-28 20:54:47.000000000","message":"Class names should be CamelCase","commit_id":"18875fde3964f612d12a6b11da5ecafed3728b32"},{"author":{"_account_id":385,"name":"Jason Kölker","email":"jason@koelker.net","username":"jason-koelker"},"change_message_id":"eab3bb6983d63d87634c63209c4d7e749b63eccc","unresolved":false,"context_lines":[{"line_number":7,"context_line":"        strictly for testing purposes, and should keep you out of dependency hell.\"\"\""},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"    def __init__(self):"},{"line_number":10,"context_line":"        if FLAGS.logdir:"},{"line_number":11,"context_line":"            self.filename \u003d os.path.join(FLAGS.logdir,\"dnstest.txt\")"},{"line_number":12,"context_line":"            self.outfilename \u003d os.path.join(FLAGS.logdir,\"dnstestprime.txt\")"},{"line_number":13,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACn%2F%2F8Ro%3D","line":10,"updated":"2011-11-28 20:54:47.000000000","message":"FLAGS is not defined. You\u0027ll need to do \n\n    from nova import flags\n\n    FLAGS \u003d flags.FLAGS","commit_id":"18875fde3964f612d12a6b11da5ecafed3728b32"},{"author":{"_account_id":385,"name":"Jason Kölker","email":"jason@koelker.net","username":"jason-koelker"},"change_message_id":"eab3bb6983d63d87634c63209c4d7e749b63eccc","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        for line in infile:"},{"line_number":42,"context_line":"            vals \u003d line.split()"},{"line_number":43,"context_line":"            line_address \u003d vals[0]"},{"line_number":44,"context_line":"            line_name \u003d vals[1]"},{"line_number":45,"context_line":"            if line_name.lower() \u003d\u003d self.qualify(name,dnszone).lower():"},{"line_number":46,"context_line":"                next"},{"line_number":47,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACn%2F%2F8Rg%3D","line":44,"updated":"2011-11-28 20:54:47.000000000","message":"line_address isn\u0027t used here, any reason to assign it?","commit_id":"18875fde3964f612d12a6b11da5ecafed3728b32"},{"author":{"_account_id":385,"name":"Jason Kölker","email":"jason@koelker.net","username":"jason-koelker"},"change_message_id":"eab3bb6983d63d87634c63209c4d7e749b63eccc","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        for line in infile:"},{"line_number":57,"context_line":"            vals \u003d line.split()"},{"line_number":58,"context_line":"            line_address \u003d vals[0]"},{"line_number":59,"context_line":"            line_name \u003d vals[1]"},{"line_number":60,"context_line":"            type \u003d vals[2]"},{"line_number":61,"context_line":"            if line_address.lower() \u003d\u003d address.lower():"},{"line_number":62,"context_line":"                outfile.write(\"%s   %s   %s\\n\" % (address, self.qualify(name,dnszone), type))"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACn%2F%2F8Rc%3D","line":59,"updated":"2011-11-28 20:54:47.000000000","message":"Same as above but for line_name.","commit_id":"18875fde3964f612d12a6b11da5ecafed3728b32"},{"author":{"_account_id":385,"name":"Jason Kölker","email":"jason@koelker.net","username":"jason-koelker"},"change_message_id":"eab3bb6983d63d87634c63209c4d7e749b63eccc","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        outfile \u003d open(self.outfilename, \u0027w\u0027)"},{"line_number":72,"context_line":"        for line in infile:"},{"line_number":73,"context_line":"            vals \u003d line.split()"},{"line_number":74,"context_line":"            line_address \u003d vals[0]"},{"line_number":75,"context_line":"            line_name \u003d vals[1]"},{"line_number":76,"context_line":"            type \u003d vals[2]"},{"line_number":77,"context_line":"            if line_name.lower() \u003d\u003d self.qualify(name, dnszone).lower():"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACn%2F%2F8RU%3D","line":74,"updated":"2011-11-28 20:54:47.000000000","message":"Same as above. Perhaps this could be generalized in a function to return a dict.","commit_id":"18875fde3964f612d12a6b11da5ecafed3728b32"},{"author":{"_account_id":385,"name":"Jason Kölker","email":"jason@koelker.net","username":"jason-koelker"},"change_message_id":"eab3bb6983d63d87634c63209c4d7e749b63eccc","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    testobj.modify_address(\"hostfour\",\"10.0.0.1\",\"foozone\")"},{"line_number":118,"context_line":"    print testobj.get_entries_by_address(\"10.0.0.1\",\"foozone\")"},{"line_number":119,"context_line":"    print testobj.get_entries_by_name(\"hostone\",\"foozone\")"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACn%2F%2F8Rs%3D","line":120,"updated":"2011-11-28 20:54:47.000000000","message":"This should go in the test suite.","commit_id":"18875fde3964f612d12a6b11da5ecafed3728b32"},{"author":{"_account_id":706,"name":"Brian Lamar","email":"brian.lamar@rackspace.com","username":"blamar"},"change_message_id":"3938baaab1f19bd706a5160c8d16fe9c32028135","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import shutil"},{"line_number":16,"context_line":"import os"},{"line_number":17,"context_line":"from nova import flags"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class MiniDNS(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F%2B4c%3D","line":17,"updated":"2011-12-06 17:49:43.000000000","message":"Please alphabetize and separate the imports:\n\n    import os\n    import shutil\n\n    from nova import flags","commit_id":"9755224c4637c15559c5122c244c3268da4883d9"},{"author":{"_account_id":1998,"name":"andrewbogott","username":"andrewbogott","inactive":true},"change_message_id":"b470395271aa4c938c5feb8be5349bcbe19a25ab","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import shutil"},{"line_number":16,"context_line":"import os"},{"line_number":17,"context_line":"from nova import flags"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class MiniDNS(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F%2B1M%3D","line":17,"in_reply_to":"AAAAC3%2F%2F%2B4c%3D","updated":"2011-12-06 19:49:12.000000000","message":"Done","commit_id":"9755224c4637c15559c5122c244c3268da4883d9"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"edbfc7bfa7abc225e16385bca1e2a108acb56b85","unresolved":false,"context_lines":[{"line_number":33,"context_line":"            self.outfilename \u003d os.path.join(flags.FLAGS.logdir, \"dnstest1.txt\")"},{"line_number":34,"context_line":"        else:"},{"line_number":35,"context_line":"            self.filename \u003d \"dnstest.txt\""},{"line_number":36,"context_line":"            self.outfilename \u003d \"dnstest1.txt\""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        if not os.path.exists(self.filename):"},{"line_number":39,"context_line":"            f \u003d open(self.filename, \"w+\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F%2FLM%3D","line":36,"updated":"2011-12-05 21:42:03.000000000","message":"Is there a reason we\u0027re using `dnstest1.txt` and not creating a tempfile using the `tempfile` library?","commit_id":"9755224c4637c15559c5122c244c3268da4883d9"},{"author":{"_account_id":1998,"name":"andrewbogott","username":"andrewbogott","inactive":true},"change_message_id":"b470395271aa4c938c5feb8be5349bcbe19a25ab","unresolved":false,"context_lines":[{"line_number":33,"context_line":"            self.outfilename \u003d os.path.join(flags.FLAGS.logdir, \"dnstest1.txt\")"},{"line_number":34,"context_line":"        else:"},{"line_number":35,"context_line":"            self.filename \u003d \"dnstest.txt\""},{"line_number":36,"context_line":"            self.outfilename \u003d \"dnstest1.txt\""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        if not os.path.exists(self.filename):"},{"line_number":39,"context_line":"            f \u003d open(self.filename, \"w+\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F%2B0s%3D","line":36,"in_reply_to":"AAAAC3%2F%2F%2FLM%3D","updated":"2011-12-06 19:49:12.000000000","message":"Done","commit_id":"9755224c4637c15559c5122c244c3268da4883d9"},{"author":{"_account_id":1998,"name":"andrewbogott","username":"andrewbogott","inactive":true},"change_message_id":"507cec66a22d16cfb8edb038b45143d0a2e1cd01","unresolved":false,"context_lines":[{"line_number":33,"context_line":"            self.outfilename \u003d os.path.join(flags.FLAGS.logdir, \"dnstest1.txt\")"},{"line_number":34,"context_line":"        else:"},{"line_number":35,"context_line":"            self.filename \u003d \"dnstest.txt\""},{"line_number":36,"context_line":"            self.outfilename \u003d \"dnstest1.txt\""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        if not os.path.exists(self.filename):"},{"line_number":39,"context_line":"            f \u003d open(self.filename, \"w+\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F%2FKE%3D","line":36,"in_reply_to":"AAAAC3%2F%2F%2FLM%3D","updated":"2011-12-06 17:49:04.000000000","message":"No serious reason; just wrote this driver to be more-or-less disposable.","commit_id":"9755224c4637c15559c5122c244c3268da4883d9"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"edbfc7bfa7abc225e16385bca1e2a108acb56b85","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        pass"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def qualify(self, name, zone):"},{"line_number":47,"context_line":"        if zone !\u003d \"\":"},{"line_number":48,"context_line":"            qualified \u003d \"%s.%s\" % (name, zone)"},{"line_number":49,"context_line":"        else:"},{"line_number":50,"context_line":"            qualified \u003d name"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F%2FL0%3D","line":47,"updated":"2011-12-05 21:42:03.000000000","message":"MIght be easier to read (and avoid the double-negative) if written as:\n\nif zone:\n # zone not empty string\nelse:\n# zone empty","commit_id":"9755224c4637c15559c5122c244c3268da4883d9"},{"author":{"_account_id":1998,"name":"andrewbogott","username":"andrewbogott","inactive":true},"change_message_id":"507cec66a22d16cfb8edb038b45143d0a2e1cd01","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        pass"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def qualify(self, name, zone):"},{"line_number":47,"context_line":"        if zone !\u003d \"\":"},{"line_number":48,"context_line":"            qualified \u003d \"%s.%s\" % (name, zone)"},{"line_number":49,"context_line":"        else:"},{"line_number":50,"context_line":"            qualified \u003d name"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F%2FKA%3D","line":47,"in_reply_to":"AAAAC3%2F%2F%2FL0%3D","updated":"2011-12-06 17:49:04.000000000","message":"Ah, my C-coding nature is showing!  Is an empty string really False in Python?","commit_id":"9755224c4637c15559c5122c244c3268da4883d9"},{"author":{"_account_id":1998,"name":"andrewbogott","username":"andrewbogott","inactive":true},"change_message_id":"b470395271aa4c938c5feb8be5349bcbe19a25ab","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        pass"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def qualify(self, name, zone):"},{"line_number":47,"context_line":"        if zone !\u003d \"\":"},{"line_number":48,"context_line":"            qualified \u003d \"%s.%s\" % (name, zone)"},{"line_number":49,"context_line":"        else:"},{"line_number":50,"context_line":"            qualified \u003d name"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F%2B1A%3D","line":47,"in_reply_to":"AAAAC3%2F%2F%2FL0%3D","updated":"2011-12-06 19:49:12.000000000","message":"Done","commit_id":"9755224c4637c15559c5122c244c3268da4883d9"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"edbfc7bfa7abc225e16385bca1e2a108acb56b85","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def create_entry(self, name, address, type, dnszone):"},{"line_number":55,"context_line":"        outfile \u003d open(self.filename, \u0027a+\u0027)"},{"line_number":56,"context_line":"        outfile.write(\"%s   %s   %s\\n\" % \\"},{"line_number":57,"context_line":"            (address, self.qualify(name, dnszone), type))"},{"line_number":58,"context_line":"        outfile.close()"},{"line_number":59,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F%2FLQ%3D","line":56,"updated":"2011-12-05 21:42:03.000000000","message":"The `\\` isn\u0027t needed since the write() call wraps the expression in parens.","commit_id":"9755224c4637c15559c5122c244c3268da4883d9"},{"author":{"_account_id":1998,"name":"andrewbogott","username":"andrewbogott","inactive":true},"change_message_id":"b470395271aa4c938c5feb8be5349bcbe19a25ab","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def create_entry(self, name, address, type, dnszone):"},{"line_number":55,"context_line":"        outfile \u003d open(self.filename, \u0027a+\u0027)"},{"line_number":56,"context_line":"        outfile.write(\"%s   %s   %s\\n\" % \\"},{"line_number":57,"context_line":"            (address, self.qualify(name, dnszone), type))"},{"line_number":58,"context_line":"        outfile.close()"},{"line_number":59,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F%2B0o%3D","line":56,"in_reply_to":"AAAAC3%2F%2F%2FLQ%3D","updated":"2011-12-06 19:49:12.000000000","message":"Done","commit_id":"9755224c4637c15559c5122c244c3268da4883d9"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"edbfc7bfa7abc225e16385bca1e2a108acb56b85","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            return entry"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    def delete_entry(self, name, dnszone\u003d\"\"):"},{"line_number":72,"context_line":"        infile \u003d open(self.filename, \u0027r\u0027)"},{"line_number":73,"context_line":"        outfile \u003d open(self.outfilename, \u0027w\u0027)"},{"line_number":74,"context_line":"        for line in infile:"},{"line_number":75,"context_line":"            entry \u003d self.parse_line(line)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F%2FK4%3D","line":72,"updated":"2011-12-05 21:42:03.000000000","message":"I\u0027m wondering if it would be worth it to extract this \u0027modify-file\u0027 code into a util since it could be generally useful.\n\nSomething like:\n\n# in nova/utils.py\n@contextlib.contextmanager\ndef modify_file(filename):\n    \"\"\"Modify a file on the filesystem.\n    Yields the the original file opened for reading and the temp-file (which will be atomically moved into place when closed).\n    \"\"\"\n    temp_filename \u003d None\n    with open(filename, \u0027r\u0027) as orig_file:\n        with tempfile.NamedTemporaryFile(\u0027w\u0027, delete\u003dFalse) as new_file:\n            temp_filename \u003d new_file.name\n            yield orig_file, new_file\n\n    if temp_filename:\n        shutil.move(temp_filename, filename)\n\nThen use as:\n\nwith utils.modify_file(self.filename) as (orig_file, new_file):\n    for line in orig_file:\n        entry \u003d self.parse_line(line)\n        if (not entry) or (entry[\u0027name\u0027] !\u003d \\\n           self.qualify(name, dnszone).lower()):\n            new_file.write(line)","commit_id":"9755224c4637c15559c5122c244c3268da4883d9"},{"author":{"_account_id":1998,"name":"andrewbogott","username":"andrewbogott","inactive":true},"change_message_id":"507cec66a22d16cfb8edb038b45143d0a2e1cd01","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            return entry"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    def delete_entry(self, name, dnszone\u003d\"\"):"},{"line_number":72,"context_line":"        infile \u003d open(self.filename, \u0027r\u0027)"},{"line_number":73,"context_line":"        outfile \u003d open(self.outfilename, \u0027w\u0027)"},{"line_number":74,"context_line":"        for line in infile:"},{"line_number":75,"context_line":"            entry \u003d self.parse_line(line)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAC3%2F%2F%2FJs%3D","line":72,"in_reply_to":"AAAAC3%2F%2F%2FK4%3D","updated":"2011-12-06 17:49:04.000000000","message":"I\u0027m imagining that any \u0027real\u0027 DNS drivers will involve database access rather than flat-files.  If I wind up implementing a real-world flat file implementation then this is a good idea.","commit_id":"9755224c4637c15559c5122c244c3268da4883d9"}]}
