)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9b8b1449a098ea168552ec88aa79daa314b4eef7","unresolved":false,"context_lines":[{"line_number":9,"context_line":"SecurityGroupAPI.get_instance_security_groups() takes instance.uuid as"},{"line_number":10,"context_line":"parameter and use that to fetch instance security groups from the db."},{"line_number":11,"context_line":"Since all callers of this method has the instance to begin with we can"},{"line_number":12,"context_line":"use it to get security groups without the extra db call."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I87769999839871c1a8d29c9013789d2611b8bccf"},{"line_number":15,"context_line":"Closes-Bug: #1521675"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5aef4532_e65b4284","line":12,"range":{"start_line":12,"start_character":30,"end_line":12,"end_character":55},"updated":"2016-03-10 22:09:01.000000000","message":"Unless we have to lazy-load instance.security_groups, but I guess we\u0027re no worse off in that case...","commit_id":"db93f4de3c65a50890f678eef54baddb36cce397"}],"nova/api/metadata/base.py":[{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"588eecbf8620d447b22d56a70e2299c768c5eabf","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        self.availability_zone \u003d az.get_instance_availability_zone(ctxt,"},{"line_number":129,"context_line":"                                                                   instance)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        secgroup_api \u003d openstack_driver.get_openstack_security_group_driver()"},{"line_number":132,"context_line":"        self.security_groups \u003d secgroup_api.get_instance_security_groups("},{"line_number":133,"context_line":"            ctxt, instance)"},{"line_number":134,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_99308758","line":131,"updated":"2016-01-12 14:01:32.000000000","message":"Here sec group_api becomes an instance of either nova.compute.api.SecurityGroupAPI or nova.network.security_group.neutron_driver.SecurityGroupAPI based on CONF.security_group_api.","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"588eecbf8620d447b22d56a70e2299c768c5eabf","unresolved":false,"context_lines":[{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        secgroup_api \u003d openstack_driver.get_openstack_security_group_driver()"},{"line_number":132,"context_line":"        self.security_groups \u003d secgroup_api.get_instance_security_groups("},{"line_number":133,"context_line":"            ctxt, instance)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        self.mappings \u003d _format_instance_mapping(ctxt, instance)"},{"line_number":136,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_798fd323","line":133,"updated":"2016-01-12 14:01:32.000000000","message":"Here and in other places I change the caller to send the entire instance instead of just the uuid, to match this all implementations of this method must now be changed to handle that correctly.","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fed01569c623af10121dfbba0f34c8d4bc3ab752","unresolved":false,"context_lines":[{"line_number":547,"context_line":"    instance \u003d objects.Instance.get_by_uuid("},{"line_number":548,"context_line":"        ctxt, instance_id, expected_attrs\u003d[\u0027ec2_ids\u0027, \u0027flavor\u0027, \u0027info_cache\u0027,"},{"line_number":549,"context_line":"                                           \u0027metadata\u0027, \u0027system_metadata\u0027,"},{"line_number":550,"context_line":"                                           \u0027security_groups\u0027])"},{"line_number":551,"context_line":"    return InstanceMetadata(instance, address)"},{"line_number":552,"context_line":""},{"line_number":553,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3afc51ec_d59c8c5f","line":550,"updated":"2016-03-14 12:38:47.000000000","message":"I guess we only need security_groups for nova-network, but I guess I am OK with doing this all the time. Its simpler.","commit_id":"f8a01ccdffc13403df77148867ef3821100b5edb"}],"nova/compute/api.py":[{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"d43837ef175b94225696677dd8a559fba4ab85f6","unresolved":false,"context_lines":[{"line_number":3820,"context_line":"        return objects.KeyPair.get_by_name(context, user_id, key_name)"},{"line_number":3821,"context_line":""},{"line_number":3822,"context_line":""},{"line_number":3823,"context_line":"class SecurityGroupAPI(base.Base, security_group_base.SecurityGroupBase):"},{"line_number":3824,"context_line":"    \"\"\"Sub-set of the Compute API related to managing security groups"},{"line_number":3825,"context_line":"    and security group rules"},{"line_number":3826,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a7e1126_31c75165","line":3823,"range":{"start_line":3823,"start_character":6,"end_line":3823,"end_character":22},"updated":"2015-12-22 10:18:18.000000000","message":"Here","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"588eecbf8620d447b22d56a70e2299c768c5eabf","unresolved":false,"context_lines":[{"line_number":3820,"context_line":"        return objects.KeyPair.get_by_name(context, user_id, key_name)"},{"line_number":3821,"context_line":""},{"line_number":3822,"context_line":""},{"line_number":3823,"context_line":"class SecurityGroupAPI(base.Base, security_group_base.SecurityGroupBase):"},{"line_number":3824,"context_line":"    \"\"\"Sub-set of the Compute API related to managing security groups"},{"line_number":3825,"context_line":"    and security group rules"},{"line_number":3826,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_d9003fad","line":3823,"in_reply_to":"1a7b0d38_557dd21a","updated":"2016-01-12 14:01:32.000000000","message":"Ok, not driver, just API. I think this is just matter of bad naming/spread out placement.\n\nThe SecurityGroupAPI defined in nova.network.security_group.security_group_base.SecurityGroupBase has implementations in nova.network.security_group.neutron_driver.SecurityGroupAPI and nova.compute.api.SecurityGroupAPI. Although the name of the neutron API implies its a driver, its not.\n\nThis is exactly the same way the NetworkAPI works with a Base class and two implementations, one for nova-network and one for neutron.\n\nCallers of the SecurityGroupAPI expects identical method signatures whether the used api is Neutron or Nova so I really can\u0027t change one without the other or things will break. A call to get_instance_security_groups() must be valid for all APIs.","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"1ef7074ee69fb61ccbd2a3f3dc58d52ba1ec7458","unresolved":false,"context_lines":[{"line_number":3820,"context_line":"        return objects.KeyPair.get_by_name(context, user_id, key_name)"},{"line_number":3821,"context_line":""},{"line_number":3822,"context_line":""},{"line_number":3823,"context_line":"class SecurityGroupAPI(base.Base, security_group_base.SecurityGroupBase):"},{"line_number":3824,"context_line":"    \"\"\"Sub-set of the Compute API related to managing security groups"},{"line_number":3825,"context_line":"    and security group rules"},{"line_number":3826,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a7b0d38_557dd21a","line":3823,"in_reply_to":"1a7b0d38_9effee00","updated":"2015-12-24 10:48:30.000000000","message":"Hum, we have a driver interface and an API interface which are different from my point of view. Example, virt drivers and compute api do not share same interface. We have a specific driver interface and api interface and they are not sharing same base class even if some methods shared same name.","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"102d1b56924936270bf36e9ba16d313066afb2ad","unresolved":false,"context_lines":[{"line_number":3820,"context_line":"        return objects.KeyPair.get_by_name(context, user_id, key_name)"},{"line_number":3821,"context_line":""},{"line_number":3822,"context_line":""},{"line_number":3823,"context_line":"class SecurityGroupAPI(base.Base, security_group_base.SecurityGroupBase):"},{"line_number":3824,"context_line":"    \"\"\"Sub-set of the Compute API related to managing security groups"},{"line_number":3825,"context_line":"    and security group rules"},{"line_number":3826,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a7b0d38_c1604838","line":3823,"in_reply_to":"1a7b0d38_b781e3fd","updated":"2015-12-23 14:11:08.000000000","message":"Let see what other contributors think, from my point of view you are doing so \"many\" changes not related in one commit because a bad design. This class should not inherits from SecurityGroupBase.\n\nIf you remove that point you can just update SecurityGroupAPI.get_instance_security_groups() without update methods in network/security_groups classes. Then create an other commit to do that clean.","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"0f7255417ba42ce7c193f70dd9bd500e29cc361b","unresolved":false,"context_lines":[{"line_number":3820,"context_line":"        return objects.KeyPair.get_by_name(context, user_id, key_name)"},{"line_number":3821,"context_line":""},{"line_number":3822,"context_line":""},{"line_number":3823,"context_line":"class SecurityGroupAPI(base.Base, security_group_base.SecurityGroupBase):"},{"line_number":3824,"context_line":"    \"\"\"Sub-set of the Compute API related to managing security groups"},{"line_number":3825,"context_line":"    and security group rules"},{"line_number":3826,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a7b0d38_9effee00","line":3823,"in_reply_to":"1a7b0d38_c1604838","updated":"2015-12-23 18:39:32.000000000","message":"But they do in fact implement the same interface. Depending on if you run nova-network or neutron you set CONF.security_group_driver to \"nova\" or \"neutron\" and one of nova.compute.api.SecurityGroupAPI() and nova.network.security_group.neutron_driver.SecurityGroupAPI() is chosen as the security group driver. See nova/network/security_group/openstack_driver.py","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"f91022b9830babf5823bd76451e10fd5b353deca","unresolved":false,"context_lines":[{"line_number":3820,"context_line":"        return objects.KeyPair.get_by_name(context, user_id, key_name)"},{"line_number":3821,"context_line":""},{"line_number":3822,"context_line":""},{"line_number":3823,"context_line":"class SecurityGroupAPI(base.Base, security_group_base.SecurityGroupBase):"},{"line_number":3824,"context_line":"    \"\"\"Sub-set of the Compute API related to managing security groups"},{"line_number":3825,"context_line":"    and security group rules"},{"line_number":3826,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a7b0d38_b781e3fd","line":3823,"in_reply_to":"3a7e1126_05bc4fb9","updated":"2015-12-22 17:47:38.000000000","message":"Maybe, however that is out of scope for this change.","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"62b757336ec2968954d7b6344fffd9d3d28bf55e","unresolved":false,"context_lines":[{"line_number":3820,"context_line":"        return objects.KeyPair.get_by_name(context, user_id, key_name)"},{"line_number":3821,"context_line":""},{"line_number":3822,"context_line":""},{"line_number":3823,"context_line":"class SecurityGroupAPI(base.Base, security_group_base.SecurityGroupBase):"},{"line_number":3824,"context_line":"    \"\"\"Sub-set of the Compute API related to managing security groups"},{"line_number":3825,"context_line":"    and security group rules"},{"line_number":3826,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a7e1126_05bc4fb9","line":3823,"in_reply_to":"3a7e1126_31c75165","updated":"2015-12-22 11:44:25.000000000","message":"It\u0027s a horrible design, compute/SecurityGroupAPI is defining a totally different API than network/security_groups... This multiple inheritance should be removed.","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9b8b1449a098ea168552ec88aa79daa314b4eef7","unresolved":false,"context_lines":[{"line_number":4383,"context_line":""},{"line_number":4384,"context_line":"    def get_instance_security_groups(self, context, instance, detailed\u003dFalse):"},{"line_number":4385,"context_line":"        if detailed:"},{"line_number":4386,"context_line":"            return self.db.security_group_get_by_instance(context,"},{"line_number":4387,"context_line":"                                                          instance.uuid)"},{"line_number":4388,"context_line":"        return [{\u0027name\u0027: group.name} for group in instance.security_groups]"},{"line_number":4389,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"5aef4532_06e74eac","line":4386,"range":{"start_line":4386,"start_character":27,"end_line":4386,"end_character":57},"updated":"2016-03-10 22:09:01.000000000","message":"This could be for a later cleanup, but if \u0027security_groups\u0027 in instance, then we shouldn\u0027t have to go to the database, we could just return the list of primitive SecurityGroup objects.\n\nAlso, it\u0027s a bit unrelated, but apparently we don\u0027t have a unit test for the detailed\u003dTrue case.","commit_id":"db93f4de3c65a50890f678eef54baddb36cce397"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"4f5ef5c092820a8fe0d2c5786589839c17ece769","unresolved":false,"context_lines":[{"line_number":4383,"context_line":""},{"line_number":4384,"context_line":"    def get_instance_security_groups(self, context, instance, detailed\u003dFalse):"},{"line_number":4385,"context_line":"        if detailed:"},{"line_number":4386,"context_line":"            return self.db.security_group_get_by_instance(context,"},{"line_number":4387,"context_line":"                                                          instance.uuid)"},{"line_number":4388,"context_line":"        return [{\u0027name\u0027: group.name} for group in instance.security_groups]"},{"line_number":4389,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3afc51ec_9ab0a88d","line":4386,"range":{"start_line":4386,"start_character":27,"end_line":4386,"end_character":57},"in_reply_to":"5aef4532_06e74eac","updated":"2016-03-11 21:11:56.000000000","message":"This will need a bit more work since the SecurityGroup object currently have no rules attribute. The db call being used here return a list of secgroups with their rules.","commit_id":"db93f4de3c65a50890f678eef54baddb36cce397"}],"nova/network/security_group/neutron_driver.py":[{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"588eecbf8620d447b22d56a70e2299c768c5eabf","unresolved":false,"context_lines":[{"line_number":409,"context_line":""},{"line_number":410,"context_line":"        return instances_security_group_bindings"},{"line_number":411,"context_line":""},{"line_number":412,"context_line":"    def get_instance_security_groups(self, context, instance, detailed\u003dFalse):"},{"line_number":413,"context_line":"        \"\"\"Returns the security groups that are associated with an instance."},{"line_number":414,"context_line":"        If detailed is True then it also returns the full details of the"},{"line_number":415,"context_line":"        security groups associated with an instance."}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_34e8827c","line":412,"updated":"2016-01-12 14:01:32.000000000","message":"Since callers of this method now send a full instance object I have to handle it correctly also in cases where this API is configured to be used.","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fed01569c623af10121dfbba0f34c8d4bc3ab752","unresolved":false,"context_lines":[{"line_number":413,"context_line":"        security groups associated with an instance."},{"line_number":414,"context_line":"        \"\"\""},{"line_number":415,"context_line":"        servers \u003d [{\u0027id\u0027: instance.uuid}]"},{"line_number":416,"context_line":"        sg_bindings \u003d self.get_instances_security_groups_bindings("},{"line_number":417,"context_line":"                                  context, servers, detailed)"},{"line_number":418,"context_line":"        return sg_bindings.get(instance.uuid, [])"},{"line_number":419,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3afc51ec_b5a100ac","line":416,"updated":"2016-03-14 12:38:47.000000000","message":"feels like we should use the info_cache here sometimes, but thats a different conversation.","commit_id":"f8a01ccdffc13403df77148867ef3821100b5edb"}],"nova/network/security_group/security_group_base.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"6bc261371b8821f5711a428a268ad905c73be09f","unresolved":false,"context_lines":[{"line_number":207,"context_line":"    def get_rule(self, context, id):"},{"line_number":208,"context_line":"        raise NotImplementedError()"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def get_instance_security_groups(self, context, instance, detailed\u003dFalse):"},{"line_number":211,"context_line":"        raise NotImplementedError()"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def add_to_instance(self, context, instance, security_group_name):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a7e1126_6d59a034","line":210,"updated":"2015-12-21 16:57:06.000000000","message":"Even if that change seems to be reasonable You should to make it available in an other commit, like a clean.","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"c4fdb529bd3127b433735d32d2e86269b64387c4","unresolved":false,"context_lines":[{"line_number":207,"context_line":"    def get_rule(self, context, id):"},{"line_number":208,"context_line":"        raise NotImplementedError()"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def get_instance_security_groups(self, context, instance, detailed\u003dFalse):"},{"line_number":211,"context_line":"        raise NotImplementedError()"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def add_to_instance(self, context, instance, security_group_name):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a7e1126_c1bdfb02","line":210,"in_reply_to":"3a7e1126_6d59a034","updated":"2015-12-21 18:20:38.000000000","message":"This is the base class for the other changes so I think it need to change with the others, right?","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"67b54763cd527f69f58ddcd5348e0a98ed409897","unresolved":false,"context_lines":[{"line_number":207,"context_line":"    def get_rule(self, context, id):"},{"line_number":208,"context_line":"        raise NotImplementedError()"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def get_instance_security_groups(self, context, instance, detailed\u003dFalse):"},{"line_number":211,"context_line":"        raise NotImplementedError()"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def add_to_instance(self, context, instance, security_group_name):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a7e1126_b0526265","line":210,"in_reply_to":"3a7e1126_c1bdfb02","updated":"2015-12-22 08:23:38.000000000","message":"Hum not really, this is base class for network/security_group related but not for compute/API. So your changes here and in network_security_group/neutron_driver.py are not necessary.","commit_id":"533b10f1a71994de45df865d80c77d162d1bb4f0"}],"nova/tests/unit/network/security_group/test_neutron_driver.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9b8b1449a098ea168552ec88aa79daa314b4eef7","unresolved":false,"context_lines":[{"line_number":400,"context_line":"        self.mox.ReplayAll()"},{"line_number":401,"context_line":"        sg_api \u003d neutron_driver.SecurityGroupAPI()"},{"line_number":402,"context_line":"        result \u003d sg_api.get_instance_security_groups("},{"line_number":403,"context_line":"            self.context, objects.Instance(uuid\u003d\u00271\u0027))"},{"line_number":404,"context_line":"        self.assertEqual([], result)"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"5aef4532_31ad66e9","line":403,"range":{"start_line":403,"start_character":48,"end_line":403,"end_character":51},"updated":"2016-03-10 22:09:01.000000000","message":"We should use a real uuid for this, else we get a warning from oslo.versionedobjects. -1 for this.","commit_id":"db93f4de3c65a50890f678eef54baddb36cce397"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"4f5ef5c092820a8fe0d2c5786589839c17ece769","unresolved":false,"context_lines":[{"line_number":400,"context_line":"        self.mox.ReplayAll()"},{"line_number":401,"context_line":"        sg_api \u003d neutron_driver.SecurityGroupAPI()"},{"line_number":402,"context_line":"        result \u003d sg_api.get_instance_security_groups("},{"line_number":403,"context_line":"            self.context, objects.Instance(uuid\u003d\u00271\u0027))"},{"line_number":404,"context_line":"        self.assertEqual([], result)"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3afc51ec_5ae740e4","line":403,"range":{"start_line":403,"start_character":48,"end_line":403,"end_character":51},"in_reply_to":"5aef4532_31ad66e9","updated":"2016-03-11 21:11:56.000000000","message":"Done","commit_id":"db93f4de3c65a50890f678eef54baddb36cce397"}]}
