)]}'
{"nova/api/ec2/cloud.py":[{"author":{"_account_id":1247,"name":"Mark McLoughlin","email":"markmc@redhat.com","username":"markmc"},"change_message_id":"3054e9dc92b268f9870f5e275800cd1e40d2e6be","unresolved":false,"context_lines":[{"line_number":1735,"context_line":"                r[\u0027toPort\u0027] \u003d rule[\u0027to_port\u0027]"},{"line_number":1736,"context_line":"                r[\u0027ipRanges\u0027] +\u003d [{\u0027cidrIp\u0027: rule[\u0027cidr\u0027]}]"},{"line_number":1737,"context_line":"                g[\u0027ipPermissions\u0027] +\u003d [r]"},{"line_number":1738,"context_line":"        return g"},{"line_number":1739,"context_line":""},{"line_number":1740,"context_line":""},{"line_number":1741,"context_line":"def get_cloud_security_group_api():"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2Bo%2FM%3D","line":1738,"updated":"2013-02-23 16:26:12.000000000","message":"Whatever it takes, you\u0027ve got to re-factor this so there isn\u0027t so much gratuitous copy and pasting","commit_id":"ff5ec929a30962a2733d680fc499b25900c4b8ca"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"78372c62fc80c6150e31336a9d59a9c7a4b20fd1","unresolved":false,"context_lines":[{"line_number":1735,"context_line":"                r[\u0027toPort\u0027] \u003d rule[\u0027to_port\u0027]"},{"line_number":1736,"context_line":"                r[\u0027ipRanges\u0027] +\u003d [{\u0027cidrIp\u0027: rule[\u0027cidr\u0027]}]"},{"line_number":1737,"context_line":"                g[\u0027ipPermissions\u0027] +\u003d [r]"},{"line_number":1738,"context_line":"        return g"},{"line_number":1739,"context_line":""},{"line_number":1740,"context_line":""},{"line_number":1741,"context_line":"def get_cloud_security_group_api():"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2Bm%2Bc%3D","line":1738,"in_reply_to":"AAAAM3%2F%2Bo%2FM%3D","updated":"2013-02-25 22:52:56.000000000","message":"Done","commit_id":"ff5ec929a30962a2733d680fc499b25900c4b8ca"},{"author":{"_account_id":67,"name":"Vish Ishaya","email":"vishvananda@gmail.com","username":"vishvananda"},"change_message_id":"f687a9d89b0528e447b43a5a6388eaf71d6ecd0f","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            r[\u0027groups\u0027] \u003d []"},{"line_number":505,"context_line":"            r[\u0027ipRanges\u0027] \u003d []"},{"line_number":506,"context_line":"            if rule[\u0027group_id\u0027]:"},{"line_number":507,"context_line":"                if openstack_driver.is_quantum_security_groups():"},{"line_number":508,"context_line":"                    source_group \u003d self.security_group_api.get("},{"line_number":509,"context_line":"                        context, id\u003drule[\u0027group_id\u0027])"},{"line_number":510,"context_line":"                    r[\u0027groups\u0027] +\u003d [{\u0027groupName\u0027: source_group.get(\u0027name\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Bi6I%3D","line":507,"updated":"2013-02-27 21:26:31.000000000","message":"I dislike this check. Why can\u0027t we just use something like\n  if rule.get(\u0027grantee_group\u0027):","commit_id":"10014dfbd4793888fee7a1050260e9d5a97dd111"},{"author":{"_account_id":67,"name":"Vish Ishaya","email":"vishvananda@gmail.com","username":"vishvananda"},"change_message_id":"f588ca98749cc54c48374175956281e85062f73f","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            r[\u0027groups\u0027] \u003d []"},{"line_number":505,"context_line":"            r[\u0027ipRanges\u0027] \u003d []"},{"line_number":506,"context_line":"            if rule[\u0027group_id\u0027]:"},{"line_number":507,"context_line":"                if openstack_driver.is_quantum_security_groups():"},{"line_number":508,"context_line":"                    source_group \u003d self.security_group_api.get("},{"line_number":509,"context_line":"                        context, id\u003drule[\u0027group_id\u0027])"},{"line_number":510,"context_line":"                    r[\u0027groups\u0027] +\u003d [{\u0027groupName\u0027: source_group.get(\u0027name\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BixI%3D","line":507,"in_reply_to":"AAAAM3%2F%2Bi2I%3D","updated":"2013-02-27 22:23:12.000000000","message":"If grantee_group is none then the if rule[\u0027group_id\u0027] above will fail.\n\nI just dislike having to keep track of what driver we\u0027re using way up here in the api.","commit_id":"10014dfbd4793888fee7a1050260e9d5a97dd111"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"20c550033423f30df1669f7cae5caeefe0fc6744","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            r[\u0027groups\u0027] \u003d []"},{"line_number":505,"context_line":"            r[\u0027ipRanges\u0027] \u003d []"},{"line_number":506,"context_line":"            if rule[\u0027group_id\u0027]:"},{"line_number":507,"context_line":"                if openstack_driver.is_quantum_security_groups():"},{"line_number":508,"context_line":"                    source_group \u003d self.security_group_api.get("},{"line_number":509,"context_line":"                        context, id\u003drule[\u0027group_id\u0027])"},{"line_number":510,"context_line":"                    r[\u0027groups\u0027] +\u003d [{\u0027groupName\u0027: source_group.get(\u0027name\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Bi2I%3D","line":507,"in_reply_to":"AAAAM3%2F%2Bi6I%3D","updated":"2013-02-27 21:56:31.000000000","message":"This would work as well though I think it\u0027s probably safer to check if running quantum_security_groups() and than call .get() otherwise it could be possible you are running nova security groups and that rule[\u0027grantee_group\u0027] \u003d\u003d None and you end up calling get() for no reason.","commit_id":"10014dfbd4793888fee7a1050260e9d5a97dd111"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"08f32d66213bee7d32dbd9159499ba882295b4a2","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            r[\u0027groups\u0027] \u003d []"},{"line_number":505,"context_line":"            r[\u0027ipRanges\u0027] \u003d []"},{"line_number":506,"context_line":"            if rule[\u0027group_id\u0027]:"},{"line_number":507,"context_line":"                if openstack_driver.is_quantum_security_groups():"},{"line_number":508,"context_line":"                    source_group \u003d self.security_group_api.get("},{"line_number":509,"context_line":"                        context, id\u003drule[\u0027group_id\u0027])"},{"line_number":510,"context_line":"                    r[\u0027groups\u0027] +\u003d [{\u0027groupName\u0027: source_group.get(\u0027name\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAANH%2F%2F%2F%2Fw%3D","line":507,"in_reply_to":"AAAAM3%2F%2BixI%3D","updated":"2013-02-27 22:40:12.000000000","message":"I do see your point about not wanting to having the driver logic in the api. Your comment about if grantee_group is none then if rule[\u0027group_id\u0027] above will fail is not true if running the quantum driver. The reason for this is the grantee_group is only passed in via the db layer on as a join. I think having if openstack_driver.is_quantum_security_groups() is more clear what\u0027s going on and easier to understand why this is done:\n\nMy initial patch actually moved  _format_security_group() to within CloudSecurityGroupNovaAPI() and CloudSecurityGroupQuantumAPI() which is also another option though markmc complained on the duplicated code. \n\nI\u0027m fine with making this change though. \n\nif rule[\u0027group_id\u0027]:\n   if rule.get(\u0027grantee_group\u0027): \n      // get info from security_group_api.get()\n   else:\n     // info is already in db.","commit_id":"10014dfbd4793888fee7a1050260e9d5a97dd111"},{"author":{"_account_id":67,"name":"Vish Ishaya","email":"vishvananda@gmail.com","username":"vishvananda"},"change_message_id":"0732705d94efeca8d9a9ff920e33de214feac0fd","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            r[\u0027groups\u0027] \u003d []"},{"line_number":505,"context_line":"            r[\u0027ipRanges\u0027] \u003d []"},{"line_number":506,"context_line":"            if rule[\u0027group_id\u0027]:"},{"line_number":507,"context_line":"                if openstack_driver.is_quantum_security_groups():"},{"line_number":508,"context_line":"                    source_group \u003d self.security_group_api.get("},{"line_number":509,"context_line":"                        context, id\u003drule[\u0027group_id\u0027])"},{"line_number":510,"context_line":"                    r[\u0027groups\u0027] +\u003d [{\u0027groupName\u0027: source_group.get(\u0027name\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAANH%2F%2F%2F%2BE%3D","line":507,"in_reply_to":"AAAANH%2F%2F%2F%2Fw%3D","updated":"2013-02-27 22:50:49.000000000","message":"Yes i prefer this version. The fallback makes sense for nova too in case we ever remove the join. Perhaps with a comment saying the rule isn\u0027t always joined in for example in the quantum driver.","commit_id":"10014dfbd4793888fee7a1050260e9d5a97dd111"}],"nova/tests/api/ec2/test_cloud.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2654042ef7dec075db72c7e43046f7774a33f6ed","unresolved":false,"context_lines":[{"line_number":46,"context_line":"from nova.openstack.common import rpc"},{"line_number":47,"context_line":"from nova import test"},{"line_number":48,"context_line":"from nova.tests.api.openstack.compute.contrib import ("},{"line_number":49,"context_line":"    test_quantum_security_groups as test_quantum)"},{"line_number":50,"context_line":"from nova.tests import fake_network"},{"line_number":51,"context_line":"from nova.tests.image import fake"},{"line_number":52,"context_line":"from nova.tests import matchers"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BjfM%3D","line":49,"updated":"2013-02-27 16:19:49.000000000","message":"Ugh.  I understand why you have to do this, but…ugh.","commit_id":"10014dfbd4793888fee7a1050260e9d5a97dd111"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"bc09cccdf267742b9e13f3a473efa5a774bb085b","unresolved":false,"context_lines":[{"line_number":46,"context_line":"from nova.openstack.common import rpc"},{"line_number":47,"context_line":"from nova import test"},{"line_number":48,"context_line":"from nova.tests.api.openstack.compute.contrib import ("},{"line_number":49,"context_line":"    test_quantum_security_groups as test_quantum)"},{"line_number":50,"context_line":"from nova.tests import fake_network"},{"line_number":51,"context_line":"from nova.tests.image import fake"},{"line_number":52,"context_line":"from nova.tests import matchers"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BjR0%3D","line":49,"in_reply_to":"AAAAM3%2F%2BjSw%3D","updated":"2013-02-27 18:01:38.000000000","message":"Yea i agree. Are we waiting on something before approving this since i see two cores already +2\u0027ed?","commit_id":"10014dfbd4793888fee7a1050260e9d5a97dd111"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"1fb15c253eb4b8e640686822456df644f2bb2b56","unresolved":false,"context_lines":[{"line_number":46,"context_line":"from nova.openstack.common import rpc"},{"line_number":47,"context_line":"from nova import test"},{"line_number":48,"context_line":"from nova.tests.api.openstack.compute.contrib import ("},{"line_number":49,"context_line":"    test_quantum_security_groups as test_quantum)"},{"line_number":50,"context_line":"from nova.tests import fake_network"},{"line_number":51,"context_line":"from nova.tests.image import fake"},{"line_number":52,"context_line":"from nova.tests import matchers"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BjSw%3D","line":49,"in_reply_to":"AAAAM3%2F%2BjTI%3D","updated":"2013-02-27 17:56:51.000000000","message":"The \"ugh\" is just because the line looks ugly.  Like I say, I understand why you\u0027re doing it—it is a long line—and I don\u0027t object; I just wish there was a prettier way of doing this :)","commit_id":"10014dfbd4793888fee7a1050260e9d5a97dd111"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"cd57f56cbbeaaada0c51d20fb070e990e503449b","unresolved":false,"context_lines":[{"line_number":46,"context_line":"from nova.openstack.common import rpc"},{"line_number":47,"context_line":"from nova import test"},{"line_number":48,"context_line":"from nova.tests.api.openstack.compute.contrib import ("},{"line_number":49,"context_line":"    test_quantum_security_groups as test_quantum)"},{"line_number":50,"context_line":"from nova.tests import fake_network"},{"line_number":51,"context_line":"from nova.tests.image import fake"},{"line_number":52,"context_line":"from nova.tests import matchers"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BjTI%3D","line":49,"in_reply_to":"AAAAM3%2F%2BjfM%3D","updated":"2013-02-27 17:52:27.000000000","message":"the ugh is because i\u0027m importing from another tests or that the line line is so long?","commit_id":"10014dfbd4793888fee7a1050260e9d5a97dd111"}]}
