)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":29393,"name":"Dariusz Król","email":"dkrol3@gmail.com","username":"d.krol"},"change_message_id":"7fc13a53380776688c8c2d0a2791635ef59ea55e","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Lingxian Kong \u003canlin.kong@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2019-02-15 15:38:32 +1300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Granular security group support"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"All the logic changes in this patch only takes effect when"},{"line_number":10,"context_line":"`default_neutron_networks` is configured. If the option is configured,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"9fdfeff1_9f1c5f14","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":31},"updated":"2019-02-19 22:39:15.000000000","message":"I\u0027m a little bit lost here. As a non-network expert I would like to have a more informative description.\nAfter reading this commit msg I would rather emphasize \"Add default security groups for control plane ports\".\nWhat seems the most important part (and please correct if I\u0027m wrong) is that you added support for security groups that will be automatically added to all ports which connect Trove instance NICs to Trove management network. If so then it is not related to granularity. I would also change the order : unordered list should be first and information when this patch works should be at the end.","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"}],"trove/common/cfg.py":[{"author":{"_account_id":29393,"name":"Dariusz Król","email":"dkrol3@gmail.com","username":"d.krol"},"change_message_id":"7fc13a53380776688c8c2d0a2791635ef59ea55e","unresolved":false,"context_lines":[{"line_number":417,"context_line":"                help\u003d\u0027List of IDs for management networks which should be \u0027"},{"line_number":418,"context_line":"                     \u0027attached to the instance regardless of what NICs \u0027"},{"line_number":419,"context_line":"                     \u0027are specified in the create API call.\u0027),"},{"line_number":420,"context_line":"    cfg.ListOpt(\u0027default_security_groups\u0027, default\u003d[],"},{"line_number":421,"context_line":"                help\u003d\u0027List of IDs for security groups which should be \u0027"},{"line_number":422,"context_line":"                     \u0027applied to the instance management NICs defined in \u0027"},{"line_number":423,"context_line":"                     \u0027default_neutron_networks option.\u0027),"}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_9fe1bfff","line":420,"range":{"start_line":420,"start_character":17,"end_line":420,"end_character":40},"updated":"2019-02-19 22:39:15.000000000","message":"Name of this parameter is a little bit misleading. Maybe \"default_mgmt_security_groups\" or something similar will be better ?","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"a0b46a513de5630392d91457dabecfa665354135","unresolved":false,"context_lines":[{"line_number":417,"context_line":"                help\u003d\u0027List of IDs for management networks which should be \u0027"},{"line_number":418,"context_line":"                     \u0027attached to the instance regardless of what NICs \u0027"},{"line_number":419,"context_line":"                     \u0027are specified in the create API call.\u0027),"},{"line_number":420,"context_line":"    cfg.ListOpt(\u0027default_security_groups\u0027, default\u003d[],"},{"line_number":421,"context_line":"                help\u003d\u0027List of IDs for security groups which should be \u0027"},{"line_number":422,"context_line":"                     \u0027applied to the instance management NICs defined in \u0027"},{"line_number":423,"context_line":"                     \u0027default_neutron_networks option.\u0027),"}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_85d892f0","line":420,"range":{"start_line":420,"start_character":17,"end_line":420,"end_character":40},"in_reply_to":"9fdfeff1_9fe1bfff","updated":"2019-02-20 01:58:05.000000000","message":"Agree, I was using the name similar to `default_neutron_networks`, but I don\u0027t think it\u0027s a good example.","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"5025c14d03bf0b2b318d868adcabce1863301e8a","unresolved":false,"context_lines":[{"line_number":413,"context_line":"    cfg.ListOpt(\u0027expected_filetype_suffixes\u0027, default\u003d[\u0027json\u0027],"},{"line_number":414,"context_line":"                help\u003d\u0027Filetype endings not to be reattached to an ID \u0027"},{"line_number":415,"context_line":"                     \u0027by the utils method correct_id_with_req.\u0027),"},{"line_number":416,"context_line":"    cfg.ListOpt(\u0027default_neutron_networks\u0027, default\u003d[],"},{"line_number":417,"context_line":"                help\u003d\u0027List of IDs for management networks which should be \u0027"},{"line_number":418,"context_line":"                     \u0027attached to the instance regardless of what NICs \u0027"},{"line_number":419,"context_line":"                     \u0027are specified in the create API call.\u0027),"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_d7d5deb8","line":416,"range":{"start_line":416,"start_character":17,"end_line":416,"end_character":41},"updated":"2019-02-22 15:01:26.000000000","message":"We should rename it to \"default_mgmt_networks\" in the future. Just a note.","commit_id":"67b67b7c020bfda9afa0712d6b14940377b3a588"}],"trove/db/sqlalchemy/migrate_repo/versions/043_add_ports_table.py":[{"author":{"_account_id":29393,"name":"Dariusz Król","email":"dkrol3@gmail.com","username":"d.krol"},"change_message_id":"7fc13a53380776688c8c2d0a2791635ef59ea55e","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    Column(\u0027security_group_id\u0027, String(length\u003d64), nullable\u003dTrue),"},{"line_number":35,"context_line":"    Column(\u0027created\u0027, DateTime(), nullable\u003dFalse),"},{"line_number":36,"context_line":"    Column(\u0027updated\u0027, DateTime(), nullable\u003dFalse),"},{"line_number":37,"context_line":"    Column(\u0027deleted\u0027, Boolean(), default\u003d0, nullable\u003dFalse),"},{"line_number":38,"context_line":"    Column(\u0027deleted_at\u0027, DateTime()),"},{"line_number":39,"context_line":")"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_7fcdfb84","line":38,"range":{"start_line":37,"start_character":0,"end_line":38,"end_character":37},"updated":"2019-02-19 22:39:15.000000000","message":"Why to we need these information ? Shouldn\u0027t we just delete the row ?","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"a0b46a513de5630392d91457dabecfa665354135","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    Column(\u0027security_group_id\u0027, String(length\u003d64), nullable\u003dTrue),"},{"line_number":35,"context_line":"    Column(\u0027created\u0027, DateTime(), nullable\u003dFalse),"},{"line_number":36,"context_line":"    Column(\u0027updated\u0027, DateTime(), nullable\u003dFalse),"},{"line_number":37,"context_line":"    Column(\u0027deleted\u0027, Boolean(), default\u003d0, nullable\u003dFalse),"},{"line_number":38,"context_line":"    Column(\u0027deleted_at\u0027, DateTime()),"},{"line_number":39,"context_line":")"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_65f80e49","line":38,"range":{"start_line":37,"start_character":0,"end_line":38,"end_character":37},"in_reply_to":"9fdfeff1_7fcdfb84","updated":"2019-02-20 01:58:05.000000000","message":"1. I see most of the other trove db resources have those fields.\n2. Keeping deleted items in the database would be helpful for debuging, auditing, etc.","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"5025c14d03bf0b2b318d868adcabce1863301e8a","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    \u0027ports\u0027,"},{"line_number":29,"context_line":"    meta,"},{"line_number":30,"context_line":"    Column(\u0027id\u0027, String(length\u003d64), primary_key\u003dTrue, nullable\u003dFalse),"},{"line_number":31,"context_line":"    Column(\u0027instance_id\u0027, String(length\u003d64),"},{"line_number":32,"context_line":"           ForeignKey(\u0027instances.id\u0027, ondelete\u003d\"CASCADE\"), nullable\u003dFalse),"},{"line_number":33,"context_line":"    Column(\u0027port_id\u0027, String(length\u003d64), nullable\u003dFalse),"},{"line_number":34,"context_line":"    Column(\u0027security_group_id\u0027, String(length\u003d64), nullable\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_978ba866","line":31,"updated":"2019-02-22 15:01:26.000000000","message":"Since a single instance may have multiple ports and each port may have multiple security groups assigned, the proposed table structure does not comply with database normalization principles [1] and causes data redundancy.\n\nWe should consider normalizing the table. For example, we could introduce the following structure:\n\nTable \"ports\" for storing references to remote Neutron ports:\n\n id: remote Neutron port ID\n\nTable \"security_group_port_associations\" for storing associations between ports and security groups:\n\n id: internal UUID\n security_group_id: foreign key from table \"security_groups\" \n port_id: foreign key from table \"ports\"\n\nTable \"port_instance_associations\" for storing associations between ports and Trove instances:\n\n id: internal UUID\n port_id: foreign key from table \"ports\"\n instance_id: ID of Trove instance\n\nAlso, in that case, we should consider dropping the table \"security_group_instance_associations\" since we implement the intermediate layer of abstraction - ports. Having security groups associated with ports we no longer need to associate security groups with instances.\n\nI know that it seems to be much work, therefore I am opened to discussion and finding the pragmatic solution to the problem.\n\n[1] https://en.wikipedia.org/wiki/Database_normalization#Satisfying_4NF","commit_id":"67b67b7c020bfda9afa0712d6b14940377b3a588"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"5025c14d03bf0b2b318d868adcabce1863301e8a","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    Column(\u0027id\u0027, String(length\u003d64), primary_key\u003dTrue, nullable\u003dFalse),"},{"line_number":31,"context_line":"    Column(\u0027instance_id\u0027, String(length\u003d64),"},{"line_number":32,"context_line":"           ForeignKey(\u0027instances.id\u0027, ondelete\u003d\"CASCADE\"), nullable\u003dFalse),"},{"line_number":33,"context_line":"    Column(\u0027port_id\u0027, String(length\u003d64), nullable\u003dFalse),"},{"line_number":34,"context_line":"    Column(\u0027security_group_id\u0027, String(length\u003d64), nullable\u003dTrue),"},{"line_number":35,"context_line":"    Column(\u0027created\u0027, DateTime(), nullable\u003dFalse),"},{"line_number":36,"context_line":"    Column(\u0027updated\u0027, DateTime(), nullable\u003dFalse),"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_2c195387","line":33,"updated":"2019-02-22 15:01:26.000000000","message":"Following the approach adopted in the implementation of security groups extension [1], remote Neutron port ID should be treated as primary table ID.\n\n[1] https://github.com/openstack/trove/blob/master/trove/extensions/security_group/models.py#L63","commit_id":"67b67b7c020bfda9afa0712d6b14940377b3a588"}],"trove/extensions/port/models.py":[{"author":{"_account_id":29393,"name":"Dariusz Król","email":"dkrol3@gmail.com","username":"d.krol"},"change_message_id":"7fc13a53380776688c8c2d0a2791635ef59ea55e","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            raise exception.TroveError(\"Failed to delete ports\")"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @classmethod"},{"line_number":80,"context_line":"    def add_port_security_group(cls, instance_id, context, region_name,"},{"line_number":81,"context_line":"                                port_id, security_groups):"},{"line_number":82,"context_line":"        driver \u003d cls.get_driver(context, region_name)"},{"line_number":83,"context_line":"        driver.add_port_security_group(port_id, security_groups)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_5fc4b75f","line":80,"range":{"start_line":80,"start_character":8,"end_line":80,"end_character":31},"updated":"2019-02-19 22:39:15.000000000","message":"There is something wrong with method name (_security_group), parameter name (security_groups) and implementation (security_groups[0]).\nI would either pass 1 security group or handle a whole list and then change the method name.","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"a0b46a513de5630392d91457dabecfa665354135","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            raise exception.TroveError(\"Failed to delete ports\")"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @classmethod"},{"line_number":80,"context_line":"    def add_port_security_group(cls, instance_id, context, region_name,"},{"line_number":81,"context_line":"                                port_id, security_groups):"},{"line_number":82,"context_line":"        driver \u003d cls.get_driver(context, region_name)"},{"line_number":83,"context_line":"        driver.add_port_security_group(port_id, security_groups)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_65a6ce56","line":80,"range":{"start_line":80,"start_character":8,"end_line":80,"end_character":31},"in_reply_to":"9fdfeff1_5fc4b75f","updated":"2019-02-20 01:58:05.000000000","message":"Agree.","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"5025c14d03bf0b2b318d868adcabce1863301e8a","unresolved":false,"context_lines":[{"line_number":38,"context_line":"                                  ip_address\u003dip_address,"},{"line_number":39,"context_line":"                                  security_groups\u003dsecurity_groups)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        # security_group_id is not needed for newly created port."},{"line_number":42,"context_line":"        return cls.create("},{"line_number":43,"context_line":"            port_id\u003dport[\u0027id\u0027],"},{"line_number":44,"context_line":"            instance_id\u003dinstance_id,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_37dc3c17","line":41,"updated":"2019-02-22 15:01:26.000000000","message":"Skipping this line and leaving the NULL value in the database (since it is nullable) would be more elegant.","commit_id":"67b67b7c020bfda9afa0712d6b14940377b3a588"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"5025c14d03bf0b2b318d868adcabce1863301e8a","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        port \u003d cls.create_port(instance_id, name, description, context,"},{"line_number":55,"context_line":"                               region_name, network,"},{"line_number":56,"context_line":"                               ip_address\u003dip_address,"},{"line_number":57,"context_line":"                               security_groups\u003dsecurity_groups)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        return port"},{"line_number":60,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_77d96420","line":57,"range":{"start_line":57,"start_character":31,"end_line":57,"end_character":62},"updated":"2019-02-22 15:01:26.000000000","message":"In \"create_port\" method you do not pass security_groups to Neutron and always set the \"security_group_id\" to an empty string. Is it correct?","commit_id":"67b67b7c020bfda9afa0712d6b14940377b3a588"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"5025c14d03bf0b2b318d868adcabce1863301e8a","unresolved":false,"context_lines":[{"line_number":70,"context_line":"                        port.port_id,"},{"line_number":71,"context_line":"                        [port.security_group_id]"},{"line_number":72,"context_line":"                    )"},{"line_number":73,"context_line":"                else:"},{"line_number":74,"context_line":"                    driver.client.delete_port(port.port_id)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"                port.delete()"},{"line_number":77,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_6c9d1b65","line":74,"range":{"start_line":73,"start_character":16,"end_line":74,"end_character":59},"updated":"2019-02-22 15:01:26.000000000","message":"Does it mean that we leave port if it has associated security group? Shouldn\u0027t we delete the port in Neutron after removing the associated security group? What if port has multiple security groups assigned?","commit_id":"67b67b7c020bfda9afa0712d6b14940377b3a588"}],"trove/instance/models.py":[{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"5025c14d03bf0b2b318d868adcabce1863301e8a","unresolved":false,"context_lines":[{"line_number":668,"context_line":"        self.set_servicestatus_deleted()"},{"line_number":669,"context_line":"        self.set_instance_fault_deleted()"},{"line_number":670,"context_line":""},{"line_number":671,"context_line":"        Port.delete_for_instance(self.db_info.id, self.context,"},{"line_number":672,"context_line":"                                 self.db_info.region_id)"},{"line_number":673,"context_line":""},{"line_number":674,"context_line":"        # Delete associated security group"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_52ec9c28","line":671,"updated":"2019-02-22 15:01:26.000000000","message":"Why do we need to delete ports manually? Doesn\u0027t Nova take care for deleting ports on server delete?","commit_id":"67b67b7c020bfda9afa0712d6b14940377b3a588"}],"trove/network/base.py":[{"author":{"_account_id":29393,"name":"Dariusz Król","email":"dkrol3@gmail.com","username":"d.krol"},"change_message_id":"7fc13a53380776688c8c2d0a2791635ef59ea55e","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    @abc.abstractmethod"},{"line_number":58,"context_line":"    def add_port_security_group(self, port_id, security_groups):"},{"line_number":59,"context_line":"        \"\"\"Ensures the given security groups are attached to the port.\"\"\""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @abc.abstractmethod"},{"line_number":62,"context_line":"    def remove_port_security_group(self, port_id, security_groups):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_1f92af4c","line":59,"range":{"start_line":59,"start_character":19,"end_line":59,"end_character":44},"updated":"2019-02-19 22:39:15.000000000","message":"the method says about only one \"security_group\"","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"a0b46a513de5630392d91457dabecfa665354135","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    @abc.abstractmethod"},{"line_number":58,"context_line":"    def add_port_security_group(self, port_id, security_groups):"},{"line_number":59,"context_line":"        \"\"\"Ensures the given security groups are attached to the port.\"\"\""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @abc.abstractmethod"},{"line_number":62,"context_line":"    def remove_port_security_group(self, port_id, security_groups):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_05610212","line":59,"range":{"start_line":59,"start_character":19,"end_line":59,"end_character":44},"in_reply_to":"9fdfeff1_1f92af4c","updated":"2019-02-20 01:58:05.000000000","message":"Done","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":29393,"name":"Dariusz Król","email":"dkrol3@gmail.com","username":"d.krol"},"change_message_id":"7fc13a53380776688c8c2d0a2791635ef59ea55e","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        \"\"\"Ensures the given security groups are attached to the port.\"\"\""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @abc.abstractmethod"},{"line_number":62,"context_line":"    def remove_port_security_group(self, port_id, security_groups):"},{"line_number":63,"context_line":"        \"\"\"Ensures the given security groups are removed from the port.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_7fa09b92","line":62,"range":{"start_line":62,"start_character":20,"end_line":62,"end_character":34},"updated":"2019-02-19 22:39:15.000000000","message":"The same as above","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"a0b46a513de5630392d91457dabecfa665354135","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        \"\"\"Ensures the given security groups are attached to the port.\"\"\""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @abc.abstractmethod"},{"line_number":62,"context_line":"    def remove_port_security_group(self, port_id, security_groups):"},{"line_number":63,"context_line":"        \"\"\"Ensures the given security groups are removed from the port.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_2566862b","line":62,"range":{"start_line":62,"start_character":20,"end_line":62,"end_character":34},"in_reply_to":"9fdfeff1_7fa09b92","updated":"2019-02-20 01:58:05.000000000","message":"Done","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"}],"trove/network/neutron.py":[{"author":{"_account_id":29393,"name":"Dariusz Król","email":"dkrol3@gmail.com","username":"d.krol"},"change_message_id":"7fc13a53380776688c8c2d0a2791635ef59ea55e","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            return"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            port \u003d self.client.show_port(port_id)"},{"line_number":177,"context_line":"            existing_sgs \u003d port[\u0027port\u0027][\u0027security_groups\u0027] or []"},{"line_number":178,"context_line":"            existing_sgs.extend(security_groups)"},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_7fce5b5c","line":176,"range":{"start_line":176,"start_character":12,"end_line":176,"end_character":49},"updated":"2019-02-19 22:39:15.000000000","message":"Given the next line I would rather:\nport \u003d self.client.show_port(port_id).get(\u0027port\u0027, dict())","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"a0b46a513de5630392d91457dabecfa665354135","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            return"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            port \u003d self.client.show_port(port_id)"},{"line_number":177,"context_line":"            existing_sgs \u003d port[\u0027port\u0027][\u0027security_groups\u0027] or []"},{"line_number":178,"context_line":"            existing_sgs.extend(security_groups)"},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_254f6693","line":176,"range":{"start_line":176,"start_character":12,"end_line":176,"end_character":49},"in_reply_to":"9fdfeff1_7fce5b5c","updated":"2019-02-20 01:58:05.000000000","message":"Done","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":29393,"name":"Dariusz Król","email":"dkrol3@gmail.com","username":"d.krol"},"change_message_id":"7fc13a53380776688c8c2d0a2791635ef59ea55e","unresolved":false,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            port \u003d self.client.show_port(port_id)"},{"line_number":177,"context_line":"            existing_sgs \u003d port[\u0027port\u0027][\u0027security_groups\u0027] or []"},{"line_number":178,"context_line":"            existing_sgs.extend(security_groups)"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"            body \u003d {"}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_dfb427d4","line":177,"range":{"start_line":177,"start_character":27,"end_line":177,"end_character":64},"updated":"2019-02-19 22:39:15.000000000","message":"port[\u0027port\u0027].get(\u0027security_groups\u0027, list()) seems more pythonic :)","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"a0b46a513de5630392d91457dabecfa665354135","unresolved":false,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            port \u003d self.client.show_port(port_id)"},{"line_number":177,"context_line":"            existing_sgs \u003d port[\u0027port\u0027][\u0027security_groups\u0027] or []"},{"line_number":178,"context_line":"            existing_sgs.extend(security_groups)"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"            body \u003d {"}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_c543fa6b","line":177,"range":{"start_line":177,"start_character":27,"end_line":177,"end_character":64},"in_reply_to":"9fdfeff1_dfb427d4","updated":"2019-02-20 01:58:05.000000000","message":"Done","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"}],"trove/taskmanager/models.py":[{"author":{"_account_id":29393,"name":"Dariusz Król","email":"dkrol3@gmail.com","username":"d.krol"},"change_message_id":"7fc13a53380776688c8c2d0a2791635ef59ea55e","unresolved":false,"context_lines":[{"line_number":463,"context_line":"        \"\"\"Prepares networks for the instance."},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"        Assume nova-network is being used if default_neutron_networks is not"},{"line_number":466,"context_line":"        cwoonfigured, return nics without change. Otherwise, creates ports in"},{"line_number":467,"context_line":"        both the managment networks and user-given networks, stores all the"},{"line_number":468,"context_line":"        created ports information in the database. Applies different security"},{"line_number":469,"context_line":"        group rules to the management interfaces and user-faced interfaces."}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_bffda36f","line":466,"range":{"start_line":466,"start_character":8,"end_line":466,"end_character":20},"updated":"2019-02-19 22:39:15.000000000","message":"typo - configured","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"a0b46a513de5630392d91457dabecfa665354135","unresolved":false,"context_lines":[{"line_number":463,"context_line":"        \"\"\"Prepares networks for the instance."},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"        Assume nova-network is being used if default_neutron_networks is not"},{"line_number":466,"context_line":"        cwoonfigured, return nics without change. Otherwise, creates ports in"},{"line_number":467,"context_line":"        both the managment networks and user-given networks, stores all the"},{"line_number":468,"context_line":"        created ports information in the database. Applies different security"},{"line_number":469,"context_line":"        group rules to the management interfaces and user-faced interfaces."}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_a55a764d","line":466,"range":{"start_line":466,"start_character":8,"end_line":466,"end_character":20},"in_reply_to":"9fdfeff1_bffda36f","updated":"2019-02-20 01:58:05.000000000","message":"Done","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":29393,"name":"Dariusz Król","email":"dkrol3@gmail.com","username":"d.krol"},"change_message_id":"7fc13a53380776688c8c2d0a2791635ef59ea55e","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        created ports information in the database. Applies different security"},{"line_number":469,"context_line":"        group rules to the management interfaces and user-faced interfaces."},{"line_number":470,"context_line":"        \"\"\""},{"line_number":471,"context_line":"        if len(CONF.default_neutron_networks) \u003d\u003d 0:"},{"line_number":472,"context_line":"            return nics"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"        ret \u003d []"},{"line_number":475,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_df02e76f","line":472,"range":{"start_line":471,"start_character":8,"end_line":472,"end_character":23},"updated":"2019-02-19 22:39:15.000000000","message":"if CONF.default_neutron_networks:\n...","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"a0b46a513de5630392d91457dabecfa665354135","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        created ports information in the database. Applies different security"},{"line_number":469,"context_line":"        group rules to the management interfaces and user-faced interfaces."},{"line_number":470,"context_line":"        \"\"\""},{"line_number":471,"context_line":"        if len(CONF.default_neutron_networks) \u003d\u003d 0:"},{"line_number":472,"context_line":"            return nics"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"        ret \u003d []"},{"line_number":475,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9fdfeff1_e5487e88","line":472,"range":{"start_line":471,"start_character":8,"end_line":472,"end_character":23},"in_reply_to":"9fdfeff1_df02e76f","updated":"2019-02-20 01:58:05.000000000","message":"Done","commit_id":"90ac480d347f3f9c5142ab0c356f9094b82e2930"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"5025c14d03bf0b2b318d868adcabce1863301e8a","unresolved":false,"context_lines":[{"line_number":459,"context_line":"                    self.id, error_message, error_details,"},{"line_number":460,"context_line":"                    skip_delta\u003dCONF.usage_sleep_time + 1)"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"    def _prepare_networks(self, nics, security_groups):"},{"line_number":463,"context_line":"        \"\"\"Prepares networks for the instance."},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"        Assume nova-network is being used if default_neutron_networks is not"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_97ee76b2","line":462,"range":{"start_line":462,"start_character":8,"end_line":462,"end_character":25},"updated":"2019-02-22 15:01:26.000000000","message":"It\u0027s more about preparing ports than networks. Consider: _prepare_network_ports.","commit_id":"67b67b7c020bfda9afa0712d6b14940377b3a588"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"5025c14d03bf0b2b318d868adcabce1863301e8a","unresolved":false,"context_lines":[{"line_number":509,"context_line":"        return ret"},{"line_number":510,"context_line":""},{"line_number":511,"context_line":"    def _prepare_security_groups(self, datastore_manager):"},{"line_number":512,"context_line":"        \"\"\"Prepares security groups for user defined nics.\"\"\""},{"line_number":513,"context_line":"        security_groups \u003d []"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"        if not CONF.trove_security_groups_support:"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_37db0a22","line":512,"range":{"start_line":512,"start_character":11,"end_line":512,"end_character":57},"updated":"2019-02-22 15:01:26.000000000","message":"What about: \"Prepares security group based on datastore-specific ports defined in configuration\"?\n\n1. Trove creates only ONE security group per instance.\n2. Security group is datastore-specific and generated based on corresponding datastore section defined in configuration.","commit_id":"67b67b7c020bfda9afa0712d6b14940377b3a588"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"5025c14d03bf0b2b318d868adcabce1863301e8a","unresolved":false,"context_lines":[{"line_number":539,"context_line":""},{"line_number":540,"context_line":"        LOG.info(\"Creating instance %s.\", self.id)"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":"        security_groups \u003d self._prepare_security_groups(datastore_manager)"},{"line_number":543,"context_line":""},{"line_number":544,"context_line":"        nics \u003d self._prepare_networks(nics, security_groups)"},{"line_number":545,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_1787e611","line":542,"range":{"start_line":542,"start_character":31,"end_line":542,"end_character":55},"updated":"2019-02-22 15:01:26.000000000","message":"Let\u0027s indicate that the method creates security groups specifically for datastores. Otherwise, security groups created at this point can be easily confused with the security groups defined for mgmt ports.\n\nConsider renaming to e.g. _prepare_datastore_security_groups or _prepare_ds_security_groups, and document the method respectively.","commit_id":"67b67b7c020bfda9afa0712d6b14940377b3a588"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"5025c14d03bf0b2b318d868adcabce1863301e8a","unresolved":false,"context_lines":[{"line_number":541,"context_line":""},{"line_number":542,"context_line":"        security_groups \u003d self._prepare_security_groups(datastore_manager)"},{"line_number":543,"context_line":""},{"line_number":544,"context_line":"        nics \u003d self._prepare_networks(nics, security_groups)"},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"        files \u003d self.get_injected_files(datastore_manager)"},{"line_number":547,"context_line":"        cinder_volume_type \u003d volume_type or CONF.cinder_volume_type"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_b7a05a93","line":544,"range":{"start_line":544,"start_character":44,"end_line":544,"end_character":59},"updated":"2019-02-22 15:01:26.000000000","message":"Rename to: ds_security_groups.","commit_id":"67b67b7c020bfda9afa0712d6b14940377b3a588"}]}
