)]}'
{"nova/tests/test_libvirt_config.py":[{"author":{"_account_id":706,"name":"Brian Lamar","email":"brian.lamar@rackspace.com","username":"blamar"},"change_message_id":"8faeee977682c2c3201ca2b55a407e76eb6d9c5f","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        obj \u003d config.LibvirtConfigObject(rootname\u003d\"demo\")"},{"line_number":28,"context_line":"        xml \u003d obj.to_xml()"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"        self.assertEqual(xml, \"\u003cdemo/\u003e\\n\")"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def test_config_ns(self):"},{"line_number":33,"context_line":"        obj \u003d config.LibvirtConfigObject(rootname\u003d\"demo\", ns_prefix\u003d\"foo\","}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F7hw%3D","line":30,"updated":"2012-03-21 20:32:47.000000000","message":"It strikes me odd to have a trailing newline generated, why is that necessary?","commit_id":"14fc415e6d73ce6de7b15f57f6ec6436418e67de"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"51aa99e9ba91c6364306bfa3090e9f8895ce02cb","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        obj \u003d config.LibvirtConfigObject(rootname\u003d\"demo\")"},{"line_number":28,"context_line":"        xml \u003d obj.to_xml()"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"        self.assertEqual(xml, \"\u003cdemo/\u003e\\n\")"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def test_config_ns(self):"},{"line_number":33,"context_line":"        obj \u003d config.LibvirtConfigObject(rootname\u003d\"demo\", ns_prefix\u003d\"foo\","}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAFH%2F%2F%2F7U%3D","line":30,"in_reply_to":"AAAAE3%2F%2F7hw%3D","updated":"2012-03-23 11:38:17.000000000","message":"Fixed with your suggested change to compare objects, instead of strings","commit_id":"14fc415e6d73ce6de7b15f57f6ec6436418e67de"},{"author":{"_account_id":706,"name":"Brian Lamar","email":"brian.lamar@rackspace.com","username":"blamar"},"change_message_id":"8faeee977682c2c3201ca2b55a407e76eb6d9c5f","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        obj.target_bus \u003d \"ide\""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        xml \u003d obj.to_xml()"},{"line_number":59,"context_line":"        self.assertEqual(xml,"},{"line_number":60,"context_line":"\"\"\"\u003cdisk type\u003d\"file\" device\u003d\"disk\"\u003e"},{"line_number":61,"context_line":"  \u003csource file\u003d\"/tmp/hello\"/\u003e"},{"line_number":62,"context_line":"  \u003ctarget bus\u003d\"ide\" dev\u003d\"/dev/hda\"/\u003e"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F7hk%3D","line":59,"updated":"2012-03-21 20:32:47.000000000","message":"To prevent having to do this, maybe try something like this?\n\n    def assertXmlEquals(self, expected, actual):\n        expected \u003d etree.tostring(objectify.fromstring(expected))\n        actual \u003d etree.tostring(objectify.fromstring(xml))\n        self.assertEquals(expected, actual)\n\n(Source) http://stackoverflow.com/questions/321795/comparing-xml-in-a-unit-test-in-python\n\nI had that bookmarked because I always hate comparing XML! Spacing shouldn\u0027t really matter, right?","commit_id":"14fc415e6d73ce6de7b15f57f6ec6436418e67de"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"51aa99e9ba91c6364306bfa3090e9f8895ce02cb","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        obj.target_bus \u003d \"ide\""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        xml \u003d obj.to_xml()"},{"line_number":59,"context_line":"        self.assertEqual(xml,"},{"line_number":60,"context_line":"\"\"\"\u003cdisk type\u003d\"file\" device\u003d\"disk\"\u003e"},{"line_number":61,"context_line":"  \u003csource file\u003d\"/tmp/hello\"/\u003e"},{"line_number":62,"context_line":"  \u003ctarget bus\u003d\"ide\" dev\u003d\"/dev/hda\"/\u003e"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAFH%2F%2F%2F7Y%3D","line":59,"in_reply_to":"AAAAE3%2F%2F7hk%3D","updated":"2012-03-23 11:38:17.000000000","message":"That\u0027s a good idea, I\u0027ll do that. It\u0027ll let me do more natural indentation of the XML snippets too.","commit_id":"14fc415e6d73ce6de7b15f57f6ec6436418e67de"}],"nova/virt/libvirt/config.py":[{"author":{"_account_id":706,"name":"Brian Lamar","email":"brian.lamar@rackspace.com","username":"blamar"},"change_message_id":"8faeee977682c2c3201ca2b55a407e76eb6d9c5f","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from nova import log as logging"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"from lxml import etree"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F7m4%3D","line":27,"updated":"2012-03-21 20:32:47.000000000","message":"2 lines of separation here","commit_id":"14fc415e6d73ce6de7b15f57f6ec6436418e67de"},{"author":{"_account_id":706,"name":"Brian Lamar","email":"brian.lamar@rackspace.com","username":"blamar"},"change_message_id":"8faeee977682c2c3201ca2b55a407e76eb6d9c5f","unresolved":false,"context_lines":[{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class LibvirtConfigObject(object):"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def __init__(self, **kwargs):"},{"line_number":34,"context_line":"        super(LibvirtConfigObject, self).__init__()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F7ms%3D","line":31,"updated":"2012-03-21 20:32:47.000000000","message":"I\u0027m torn on the names of these classes. The school of thought I\u0027m used to is to look at the entire module name. In this case this class is nova.virt.libvirt.config:LibvirtConfigObject which seems a bit redundant (libvirt/config are both used twice). That being said, nova.virt.libvirt.config:Object might sound too generic if used in typical nova fashion:\n\n    from nova.virt.libvirt import config\n    my_object \u003d config.Object(...)\n\nHowever, a more explicit approach makes sense:\n\n    import nova.virt.libvirt.config\n    my_object \u003d nova.virt.libvirt.config.Object(...)\n\nMy vote would be for removing \"LibvirtConfig\" from the front of all of the class names, but it\u0027s not a deal breaker and I mostly wanted to throw this out there to get other thoughts.","commit_id":"14fc415e6d73ce6de7b15f57f6ec6436418e67de"},{"author":{"_account_id":1812,"name":"p-draigbrady","email":"P@draigBrady.com","username":"p-draigbrady"},"change_message_id":"f6927f1eb4815194915963c62399520d73904743","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        self.ns_uri \u003d None"},{"line_number":38,"context_line":"        self.ns_prefix \u003d None"},{"line_number":39,"context_line":"        if \u0027ns_prefix\u0027 in kwargs:"},{"line_number":40,"context_line":"            self.ns_prefix \u003d kwargs[\u0027ns_prefix\u0027]"},{"line_number":41,"context_line":"        if \u0027ns_uri\u0027 in kwargs:"},{"line_number":42,"context_line":"            self.ns_uri \u003d kwargs[\u0027ns_uri\u0027]"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F7uM%3D","line":40,"updated":"2012-03-21 15:29:06.000000000","message":"idiomatic python for the above 3 lines is:\n\n    self.ns_prefix \u003d kwargs.get(\u0027ns_prefix\u0027)","commit_id":"14fc415e6d73ce6de7b15f57f6ec6436418e67de"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"51aa99e9ba91c6364306bfa3090e9f8895ce02cb","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        self.ns_uri \u003d None"},{"line_number":38,"context_line":"        self.ns_prefix \u003d None"},{"line_number":39,"context_line":"        if \u0027ns_prefix\u0027 in kwargs:"},{"line_number":40,"context_line":"            self.ns_prefix \u003d kwargs[\u0027ns_prefix\u0027]"},{"line_number":41,"context_line":"        if \u0027ns_uri\u0027 in kwargs:"},{"line_number":42,"context_line":"            self.ns_uri \u003d kwargs[\u0027ns_uri\u0027]"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAFH%2F%2F%2F7Q%3D","line":40,"in_reply_to":"AAAAE3%2F%2F7mQ%3D","updated":"2012-03-23 11:38:17.000000000","message":"Done","commit_id":"14fc415e6d73ce6de7b15f57f6ec6436418e67de"},{"author":{"_account_id":706,"name":"Brian Lamar","email":"brian.lamar@rackspace.com","username":"blamar"},"change_message_id":"8faeee977682c2c3201ca2b55a407e76eb6d9c5f","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        self.ns_uri \u003d None"},{"line_number":38,"context_line":"        self.ns_prefix \u003d None"},{"line_number":39,"context_line":"        if \u0027ns_prefix\u0027 in kwargs:"},{"line_number":40,"context_line":"            self.ns_prefix \u003d kwargs[\u0027ns_prefix\u0027]"},{"line_number":41,"context_line":"        if \u0027ns_uri\u0027 in kwargs:"},{"line_number":42,"context_line":"            self.ns_uri \u003d kwargs[\u0027ns_uri\u0027]"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F7mQ%3D","line":40,"in_reply_to":"AAAAE3%2F%2F7uM%3D","updated":"2012-03-21 20:32:47.000000000","message":"Good feedback, to take it a tad further:\n\n    def __init__(self, root_name, **kwargs):\n        super(LibvirtConfigObject, self).__init__()\n    \n        self.root_name \u003d root_name\n        self.ns_uri \u003d kwargs.get(\u0027ns_uri\u0027)\n        self.ns_prefix \u003d kwargs.get(\u0027ns_prefix\u0027)\n\n        xml_str \u003d kwargs.get(\u0027xml_str\u0027)\n        if xml_str is not None:\n            self.parse_dom(xml_str)\n\nIn general I think names should be broken down, much like you\u0027ve done with ns_uri and ns_prefix. rootname seems like it should be root_name and xmlstr would become xml_str.","commit_id":"14fc415e6d73ce6de7b15f57f6ec6436418e67de"},{"author":{"_account_id":706,"name":"Brian Lamar","email":"brian.lamar@rackspace.com","username":"blamar"},"change_message_id":"8faeee977682c2c3201ca2b55a407e76eb6d9c5f","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        return child"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def format_dom(self):"},{"line_number":53,"context_line":"        if self.ns_prefix is None:"},{"line_number":54,"context_line":"            return etree.Element(self.rootname)"},{"line_number":55,"context_line":"        else:"},{"line_number":56,"context_line":"            return etree.Element(\"{\" + self.ns_uri + \"}\" + self.rootname,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F7iA%3D","line":53,"updated":"2012-03-21 20:32:47.000000000","message":"If ns_prefix is non-None and ns_uri is None will this work? Not sure how lxml treats that case.","commit_id":"14fc415e6d73ce6de7b15f57f6ec6436418e67de"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"51aa99e9ba91c6364306bfa3090e9f8895ce02cb","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        return child"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def format_dom(self):"},{"line_number":53,"context_line":"        if self.ns_prefix is None:"},{"line_number":54,"context_line":"            return etree.Element(self.rootname)"},{"line_number":55,"context_line":"        else:"},{"line_number":56,"context_line":"            return etree.Element(\"{\" + self.ns_uri + \"}\" + self.rootname,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAFH%2F%2F%2F7I%3D","line":53,"in_reply_to":"AAAAE3%2F%2F7iA%3D","updated":"2012-03-23 11:38:17.000000000","message":"This test is really the wrong way around - ns_prefix is allowed to be None, while ns_uri is not None, in order to set the default XML namespace.","commit_id":"14fc415e6d73ce6de7b15f57f6ec6436418e67de"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"68b2787aa7998e7395bbefecbce47a16f561237e","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    def __init__(self, **kwargs):"},{"line_number":35,"context_line":"        super(LibvirtConfigObject, self).__init__()"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"        self.root_name \u003d kwargs.get(\"root_name\")"},{"line_number":38,"context_line":"        self.ns_prefix \u003d kwargs.get(\u0027ns_prefix\u0027)"},{"line_number":39,"context_line":"        self.ns_uri \u003d kwargs.get(\u0027ns_uri\u0027)"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAFH%2F%2F%2F1Y%3D","line":37,"updated":"2012-03-23 15:31:26.000000000","message":"Why not make root_name a class attribute? It will save a lot of extra code in the __init__ methods.","commit_id":"f643388a86b0cd70ff311986d51244cf97e4e770"}]}
