)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"1a5f01fcc9dfe9dab34f68d5bd67d794661feea6","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     wangyongben \u003cwangyongben@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-04-12 20:01:41 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fixed the pep8 errors and change code after test"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I8ebebc40248374a424a14b93f186283a707b5a50"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a18252c_48680bf6","line":7,"range":{"start_line":7,"start_character":1,"end_line":7,"end_character":48},"updated":"2016-04-12 14:38:09.000000000","message":"You still have pep8 but the commit message should describe the code not the patch please look at \nhttps://wiki.openstack.org/wiki/GitCommitMessages#Examples_of_good_practice","commit_id":"04c8e1b742e6e0bc572142a33b0dce16646deef9"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"a3d3d44a9d0747d35b43e074bcdb3ba4c9a64f73","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2016-04-21 17:03:59 +0800"},{"line_number":4,"context_line":"Commit:     wangyongben \u003cwangyongben@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-04-21 17:20:44 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add db lock for dragonflow database to avoid the problems caused by"},{"line_number":8,"context_line":"concurrent accessiong."},{"line_number":9,"context_line":"Changed files:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"1a122d0e_635b692f","line":6,"updated":"2016-04-22 06:52:16.000000000","message":"Please add a title for your review.\n\nSupport ML2 plugin\n(blank line)\n\nFollowing your description.","commit_id":"70775132c49302a1c2becfc6d2e0aecbb2f1ab70"},{"author":{"_account_id":9044,"name":"Will","email":"wangjian.ika@bytedance.com","username":"Will"},"change_message_id":"185da0b05d3a943131cb1fa9b6e6d3317d67f7b7","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Support ML2 Plugin"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Fix pep8"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I8ebebc40248374a424a14b93f186283a707b5a50"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":38,"id":"7aa08908_6e1b391c","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":8},"updated":"2016-06-07 00:40:49.000000000","message":"It should be messages describe the patch","commit_id":"8b091022106391ea42e85af6c15f399cffc614f3"}],"devstack/plugin.sh":[{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"d001cc5a657acc0e9c281ad43ab0bd6e6fe81128","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        # plugin and don\u0027t need L3 service plugin. However, you can optionally"},{"line_number":95,"context_line":"        # edit local.conf file to configure alternative core plugin and service"},{"line_number":96,"context_line":"        # plugin such as CORE_PLUGIN\u003d\"ml2\" and SERVICE_PLUGIN\u003d\"router\"."},{"line_number":97,"context_line":"        if [[ \"$CORE_PLUGIN\" \u003d\u003d \"\" ]]; then"},{"line_number":98,"context_line":"            CORE_PLUGIN\u003d\"dragonflow.neutron.plugin.DFPlugin\""},{"line_number":99,"context_line":"        fi"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        NEUTRON_CONF\u003d/etc/neutron/neutron.conf"},{"line_number":102,"context_line":"        iniset $NEUTRON_CONF df remote_db_ip \"$REMOTE_DB_IP\""}],"source_content_type":"text/x-sh","patch_set":35,"id":"9abb7d3a_836cce9d","line":99,"range":{"start_line":97,"start_character":7,"end_line":99,"end_character":10},"updated":"2016-05-27 07:36:39.000000000","message":"do it just like definitions in Line 11-22","commit_id":"8d80771d9a7bfb25072587bdfef8e1eb9fb1ca8d"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"dfba757a43da463ab7a0dd64d4b6b5fbe476a849","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        # plugin and don\u0027t need L3 service plugin. However, you can optionally"},{"line_number":95,"context_line":"        # edit local.conf file to configure alternative core plugin and service"},{"line_number":96,"context_line":"        # plugin such as CORE_PLUGIN\u003d\"ml2\" and SERVICE_PLUGIN\u003d\"router\"."},{"line_number":97,"context_line":"        if [[ \"$CORE_PLUGIN\" \u003d\u003d \"\" ]]; then"},{"line_number":98,"context_line":"            CORE_PLUGIN\u003d\"dragonflow.neutron.plugin.DFPlugin\""},{"line_number":99,"context_line":"        fi"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        NEUTRON_CONF\u003d/etc/neutron/neutron.conf"},{"line_number":102,"context_line":"        iniset $NEUTRON_CONF df remote_db_ip \"$REMOTE_DB_IP\""}],"source_content_type":"text/x-sh","patch_set":35,"id":"9abb7d3a_de86a912","line":99,"range":{"start_line":97,"start_character":7,"end_line":99,"end_character":10},"in_reply_to":"9abb7d3a_836cce9d","updated":"2016-05-27 08:10:17.000000000","message":"Thank you. I will modify it like this: DEFAULT_CORE_PLUGIN\u003d....\nCORE_PLUGIN\u003d${CORE_PLUGIN:-$DEFAULT_CORE_PLUGIN}","commit_id":"8d80771d9a7bfb25072587bdfef8e1eb9fb1ca8d"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"d001cc5a657acc0e9c281ad43ab0bd6e6fe81128","unresolved":false,"context_lines":[{"line_number":154,"context_line":"            ML2_CONF\u003d/etc/neutron/plugins/ml2/ml2_conf.ini"},{"line_number":155,"context_line":"            iniset $ML2_CONF ml2 mechanism_drivers \"$DF_MECH_DRIVER\""},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"            ENTRY_POINTS\u003d/opt/stack/neutron/neutron.egg-info/entry_points.txt"},{"line_number":158,"context_line":"            iniset $ENTRY_POINTS neutron.ml2.mechanism_drivers \"$DF_MECH_DRIVER\" \"$DF_MECH_DRIVER_ENTRY_POINT\""},{"line_number":159,"context_line":"        fi"},{"line_number":160,"context_line":"    else"},{"line_number":161,"context_line":"        _create_neutron_conf_dir"}],"source_content_type":"text/x-sh","patch_set":35,"id":"9abb7d3a_231d2210","line":158,"range":{"start_line":157,"start_character":12,"end_line":158,"end_character":110},"updated":"2016-05-27 07:36:39.000000000","message":"i don\u0027t think it is necessary to modify this file. you can just add it in setup.cfg.","commit_id":"8d80771d9a7bfb25072587bdfef8e1eb9fb1ca8d"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"dfba757a43da463ab7a0dd64d4b6b5fbe476a849","unresolved":false,"context_lines":[{"line_number":154,"context_line":"            ML2_CONF\u003d/etc/neutron/plugins/ml2/ml2_conf.ini"},{"line_number":155,"context_line":"            iniset $ML2_CONF ml2 mechanism_drivers \"$DF_MECH_DRIVER\""},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"            ENTRY_POINTS\u003d/opt/stack/neutron/neutron.egg-info/entry_points.txt"},{"line_number":158,"context_line":"            iniset $ENTRY_POINTS neutron.ml2.mechanism_drivers \"$DF_MECH_DRIVER\" \"$DF_MECH_DRIVER_ENTRY_POINT\""},{"line_number":159,"context_line":"        fi"},{"line_number":160,"context_line":"    else"},{"line_number":161,"context_line":"        _create_neutron_conf_dir"}],"source_content_type":"text/x-sh","patch_set":35,"id":"9abb7d3a_5eee39ed","line":158,"range":{"start_line":157,"start_character":12,"end_line":158,"end_character":110},"in_reply_to":"9abb7d3a_231d2210","updated":"2016-05-27 08:10:17.000000000","message":"Thank you, but I don\u0027t know how to change it, would you please give me an example?","commit_id":"8d80771d9a7bfb25072587bdfef8e1eb9fb1ca8d"}],"dragonflow/neutron/ml2/mech_driver.py":[{"author":{"_account_id":20405,"name":"liuhaixia","email":"liuhaixia315@huawei.com","username":"liuhaixia"},"change_message_id":"2a2a75e2e3eaa25466867e81475beeae71eeedfe","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        # When set to True, Nova plugs the VIF directly into the ovs bridge"},{"line_number":49,"context_line":"        # instead of using the hybrid mode."},{"line_number":50,"context_line":"        self.vif_details \u003d {portbindings.CAP_PORT_FILTER: True}"},{"line_number":51,"context_line":"        registry.subscribe(self.post_fork_initialize, resources.PROCESS,"},{"line_number":52,"context_line":"                           events.AFTER_CREATE)"},{"line_number":53,"context_line":"        registry.subscribe(create_security_group,"},{"line_number":54,"context_line":"                           resources.SECURITY_GROUP,"},{"line_number":55,"context_line":"                           events.AFTER_CREATE)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba0121b8_280abe21","line":52,"range":{"start_line":51,"start_character":0,"end_line":52,"end_character":47},"updated":"2016-03-30 07:16:04.000000000","message":"If registry works in fanout pattern, each neutron server will receive these message. Is there a unicast pattern?","commit_id":"83eca50fde2c4fd1447170c229c29cbe6a0871e5"},{"author":{"_account_id":20405,"name":"liuhaixia","email":"liuhaixia315@huawei.com","username":"liuhaixia"},"change_message_id":"2a2a75e2e3eaa25466867e81475beeae71eeedfe","unresolved":false,"context_lines":[{"line_number":127,"context_line":"    def create_network_postcommit(self, context):"},{"line_number":128,"context_line":"        network \u003d context.current"},{"line_number":129,"context_line":"        external_ids \u003d {df_const.DF_NETWORK_NAME_EXT_ID_KEY: network[\u0027name\u0027]}"},{"line_number":130,"context_line":"        self.nb_api.create_lswitch(name\u003dnetwork[\u0027id\u0027],"},{"line_number":131,"context_line":"                                   topic\u003dnetwork[\u0027tenant_id\u0027],"},{"line_number":132,"context_line":"                                   external_ids\u003dexternal_ids,"},{"line_number":133,"context_line":"                                   subnets\u003d[])"},{"line_number":134,"context_line":"        LOG.info(_LI(\"DFMechDriver: create network %s\" % network[\u0027id\u0027]))"},{"line_number":135,"context_line":"        return network"},{"line_number":136,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba0121b8_0c59d5fe","line":133,"range":{"start_line":130,"start_character":1,"end_line":133,"end_character":46},"updated":"2016-03-30 07:16:04.000000000","message":"For Dragonflow needs to support vlan and flat network, so please consider this in future.","commit_id":"83eca50fde2c4fd1447170c229c29cbe6a0871e5"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"450f5cd10f462d20a974b0cdc8bf6a75757cf5ce","unresolved":false,"context_lines":[{"line_number":127,"context_line":"    def create_network_postcommit(self, context):"},{"line_number":128,"context_line":"        network \u003d context.current"},{"line_number":129,"context_line":"        external_ids \u003d {df_const.DF_NETWORK_NAME_EXT_ID_KEY: network[\u0027name\u0027]}"},{"line_number":130,"context_line":"        self.nb_api.create_lswitch(name\u003dnetwork[\u0027id\u0027],"},{"line_number":131,"context_line":"                                   topic\u003dnetwork[\u0027tenant_id\u0027],"},{"line_number":132,"context_line":"                                   external_ids\u003dexternal_ids,"},{"line_number":133,"context_line":"                                   subnets\u003d[])"},{"line_number":134,"context_line":"        LOG.info(_LI(\"DFMechDriver: create network %s\" % network[\u0027id\u0027]))"},{"line_number":135,"context_line":"        return network"},{"line_number":136,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_38836fce","line":133,"range":{"start_line":130,"start_character":1,"end_line":133,"end_character":46},"in_reply_to":"ba0121b8_0c59d5fe","updated":"2016-04-12 11:15:17.000000000","message":"The nb_api don\u0027t support the network type, I will discuss this problem with the owner of nb_api.","commit_id":"83eca50fde2c4fd1447170c229c29cbe6a0871e5"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"489cafe0100ef1187f6699af7b6aaa2e0eb65c0f","unresolved":false,"context_lines":[{"line_number":132,"context_line":"    def create_network_postcommit(self, context):"},{"line_number":133,"context_line":"        network \u003d context.current"},{"line_number":134,"context_line":"        external_ids \u003d {df_const.DF_NETWORK_NAME_EXT_ID_KEY: network[\u0027name\u0027]}"},{"line_number":135,"context_line":"        self.nb_api.create_lswitch(name\u003dnetwork[\u0027id\u0027],"},{"line_number":136,"context_line":"                                   topic\u003dnetwork[\u0027tenant_id\u0027],"},{"line_number":137,"context_line":"                                   external_ids\u003dexternal_ids,"},{"line_number":138,"context_line":"                                   subnets\u003d[])"},{"line_number":139,"context_line":"        LOG.info(_LI(\"DFMechDriver: create network %s\"), network[\u0027id\u0027])"},{"line_number":140,"context_line":"        return network"},{"line_number":141,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1a122d0e_a773374d","line":138,"range":{"start_line":135,"start_character":35,"end_line":138,"end_character":46},"updated":"2016-04-28 02:17:15.000000000","message":"consider add router:external, provider:network_type and such fields to make network complete","commit_id":"6db7b1aeff7dfb72745e5f2b243a0d92ec077f74"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"49bf19094b60994c3c1b7ceebb3374cd2927862d","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        network_id \u003d network[\u0027id\u0027]"},{"line_number":146,"context_line":"        tenant_id \u003d network[\u0027tenant_id\u0027]"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        for port in self.nb_api.get_all_logical_ports():"},{"line_number":149,"context_line":"            if port.get_lswitch_id() \u003d\u003d network_id:"},{"line_number":150,"context_line":"                try:"},{"line_number":151,"context_line":"                    self.nb_api.delete_lport(name\u003dport.get_id(),"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a122d0e_e820b6b2","line":148,"range":{"start_line":148,"start_character":32,"end_line":148,"end_character":53},"updated":"2016-04-26 02:09:15.000000000","message":"set the topic para here, it will be more efficient.","commit_id":"6db7b1aeff7dfb72745e5f2b243a0d92ec077f74"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"49bf19094b60994c3c1b7ceebb3374cd2927862d","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        tenant_id \u003d network[\u0027tenant_id\u0027]"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        for port in self.nb_api.get_all_logical_ports():"},{"line_number":149,"context_line":"            if port.get_lswitch_id() \u003d\u003d network_id:"},{"line_number":150,"context_line":"                try:"},{"line_number":151,"context_line":"                    self.nb_api.delete_lport(name\u003dport.get_id(),"},{"line_number":152,"context_line":"                                             topic\u003dtenant_id)"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a122d0e_88182286","line":149,"range":{"start_line":149,"start_character":20,"end_line":149,"end_character":34},"updated":"2016-04-26 02:09:15.000000000","message":"It\u0027s not a normal case that there are still some ports when we delete a network. So we\u0027d better log some information about these ports.","commit_id":"6db7b1aeff7dfb72745e5f2b243a0d92ec077f74"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"49bf19094b60994c3c1b7ceebb3374cd2927862d","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"        LOG.info(_LI(\"DFMechDriver: delete network %s\"), network_id)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def _get_ports_by_subnet_and_owner(self, context, subnet_id):"},{"line_number":166,"context_line":"        \"\"\"Used to get all port in a subnet by the device owner\"\"\""},{"line_number":167,"context_line":"        LOG.debug(\"Dragonflow : subnet_id: %s\", subnet_id)"},{"line_number":168,"context_line":"        filters \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet_id]},"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a122d0e_89e5ad0a","line":165,"range":{"start_line":165,"start_character":8,"end_line":165,"end_character":38},"updated":"2016-04-26 02:09:15.000000000","message":"Because owner is not a para, you may call this function _get_dhcp_ports_by_subnet","commit_id":"6db7b1aeff7dfb72745e5f2b243a0d92ec077f74"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"49bf19094b60994c3c1b7ceebb3374cd2927862d","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                   \u0027device_owner\u0027: [n_const.DEVICE_OWNER_DHCP]}"},{"line_number":170,"context_line":"        return context._plugin.get_ports(context, filters\u003dfilters)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def _get_dhcp_port_for_subnet(self, context, subnet_id):"},{"line_number":173,"context_line":"        ports \u003d self._get_ports_by_subnet_and_owner("},{"line_number":174,"context_line":"                context,"},{"line_number":175,"context_line":"                subnet_id)"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a122d0e_29bbb9e6","line":172,"range":{"start_line":172,"start_character":8,"end_line":172,"end_character":33},"updated":"2016-04-26 02:09:15.000000000","message":"can merge this function with the previous one.","commit_id":"6db7b1aeff7dfb72745e5f2b243a0d92ec077f74"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"49bf19094b60994c3c1b7ceebb3374cd2927862d","unresolved":false,"context_lines":[{"line_number":199,"context_line":"            dhcp_port \u003d self._get_dhcp_port_for_subnet(context, subnet[\u0027id\u0027])"},{"line_number":200,"context_line":"            dhcp_address \u003d self._get_ip_from_port(dhcp_port)"},{"line_number":201,"context_line":"            return dhcp_address"},{"line_number":202,"context_line":"        except Exception:"},{"line_number":203,"context_line":"            return None"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    @lock_db.wrap_db_lock(lock_db.RESOURCE_ML2_CORE)"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a122d0e_c9c20553","line":202,"range":{"start_line":202,"start_character":15,"end_line":202,"end_character":24},"updated":"2016-04-26 02:09:15.000000000","message":"log the exception here.","commit_id":"6db7b1aeff7dfb72745e5f2b243a0d92ec077f74"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"49bf19094b60994c3c1b7ceebb3374cd2927862d","unresolved":false,"context_lines":[{"line_number":340,"context_line":"            topic\u003dport[\u0027tenant_id\u0027],"},{"line_number":341,"context_line":"            macs\u003d[port[\u0027mac_address\u0027]], ips\u003dips,"},{"line_number":342,"context_line":"            external_ids\u003dexternal_ids,"},{"line_number":343,"context_line":"            parent_name\u003dparent_name, tag\u003dtag,"},{"line_number":344,"context_line":"            enabled\u003dport.get(\u0027admin_state_up\u0027, None),"},{"line_number":345,"context_line":"            chassis\u003dchassis, tunnel_key\u003dtunnel_key,"},{"line_number":346,"context_line":"            port_security\u003dallowed_macs,"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a122d0e_a9d229fe","line":343,"range":{"start_line":343,"start_character":12,"end_line":343,"end_character":23},"updated":"2016-04-26 02:09:15.000000000","message":"this para is not a neturon api parameter, seems only used in OVN. So we can remove it.","commit_id":"6db7b1aeff7dfb72745e5f2b243a0d92ec077f74"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"49bf19094b60994c3c1b7ceebb3374cd2927862d","unresolved":false,"context_lines":[{"line_number":343,"context_line":"            parent_name\u003dparent_name, tag\u003dtag,"},{"line_number":344,"context_line":"            enabled\u003dport.get(\u0027admin_state_up\u0027, None),"},{"line_number":345,"context_line":"            chassis\u003dchassis, tunnel_key\u003dtunnel_key,"},{"line_number":346,"context_line":"            port_security\u003dallowed_macs,"},{"line_number":347,"context_line":"            device_owner\u003dport.get(\u0027device_owner\u0027, None),"},{"line_number":348,"context_line":"            sgids\u003dsgids)"},{"line_number":349,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1a122d0e_29b739d9","line":346,"range":{"start_line":346,"start_character":26,"end_line":346,"end_character":38},"updated":"2016-04-26 02:09:15.000000000","message":"port security is not only for mac, it may be ip and/or mac pairs.","commit_id":"6db7b1aeff7dfb72745e5f2b243a0d92ec077f74"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"ae0717012ba76ad87a6a00a4b4651ab655f314fb","unresolved":false,"context_lines":[{"line_number":356,"context_line":"                                                               port)"},{"line_number":357,"context_line":"        plugin_context \u003d context._plugin_context"},{"line_number":358,"context_line":"        port[\u0027port\u0027] \u003d port"},{"line_number":359,"context_line":"        sgids \u003d context._plugin._get_security_groups_on_port(plugin_context,"},{"line_number":360,"context_line":"                                                             port)"},{"line_number":361,"context_line":"        self.create_port_in_nb_api(port, parent_name, tag, sgids)"},{"line_number":362,"context_line":"        LOG.info(_LI(\"DFMechDriver: create port %s\"), port[\u0027id\u0027])"},{"line_number":363,"context_line":"        return port"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_9579e0ca","line":360,"range":{"start_line":359,"start_character":8,"end_line":360,"end_character":66},"updated":"2016-04-29 02:52:16.000000000","message":"I think the port object has contained the sgid fields, you do not need to fetch the data from Neutron DB again","commit_id":"7e1a0a5cabb6d91751aec0cb6ecd8713a925026b"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"80bf31d9362269aebe36de749497b24c4554896a","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    def post_fork_initialize(self, resource, event, trigger, **kwargs):"},{"line_number":117,"context_line":"        self._set_base_port_binding()"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def _set_base_port_binding(self):"},{"line_number":120,"context_line":"        self.base_binding_dict \u003d {"},{"line_number":121,"context_line":"            portbindings.VIF_TYPE: portbindings.VIF_TYPE_OVS,"},{"line_number":122,"context_line":"            portbindings.VIF_DETAILS: {"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a122d0e_d4b848ca","line":119,"updated":"2016-05-02 06:31:07.000000000","message":"Shouldn\u0027t the info here and in initialize be the same?","commit_id":"c29021ccd370f0462755df06e6c0cb37d1f1e4d4"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"80bf31d9362269aebe36de749497b24c4554896a","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        if not port:"},{"line_number":179,"context_line":"            return None"},{"line_number":180,"context_line":"        for fixed_ip in port[\u0027fixed_ips\u0027]:"},{"line_number":181,"context_line":"            if \"ip_address\" in fixed_ip:"},{"line_number":182,"context_line":"                return fixed_ip[\u0027ip_address\u0027]"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _get_subnet_dhcp_port_address(self, context, subnet):"},{"line_number":185,"context_line":"        \"\"\"Create the dhcp configration for the subnet"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a122d0e_74f69491","line":182,"range":{"start_line":181,"start_character":0,"end_line":182,"end_character":45},"updated":"2016-05-02 06:31:07.000000000","message":"Consider changing to:\nip \u003d fixed_ip.get(\u0027ip_address\u0027, None)\nif ip:\n    return ip\n\nThis reduces the number of lookups to 1.","commit_id":"c29021ccd370f0462755df06e6c0cb37d1f1e4d4"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"80bf31d9362269aebe36de749497b24c4554896a","unresolved":false,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _get_subnet_dhcp_port_address(self, context, subnet):"},{"line_number":185,"context_line":"        \"\"\"Create the dhcp configration for the subnet"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"        Returns the dhcp server ip address if configured"},{"line_number":188,"context_line":"        \"\"\""},{"line_number":189,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a122d0e_94bff0a9","line":186,"updated":"2016-05-02 06:31:07.000000000","message":"This line is redundant.","commit_id":"c29021ccd370f0462755df06e6c0cb37d1f1e4d4"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"80bf31d9362269aebe36de749497b24c4554896a","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        # The port name *must* be port[\u0027id\u0027].  It must match the iface-id set"},{"line_number":270,"context_line":"        # in the Interfaces table of the Open_vSwitch database, which nova sets"},{"line_number":271,"context_line":"        # to be the port ID."},{"line_number":272,"context_line":"        external_ids \u003d {df_const.DF_PORT_NAME_EXT_ID_KEY: port[\u0027name\u0027]}"},{"line_number":273,"context_line":"        allowed_macs \u003d self._get_allowed_mac_addresses_from_port(port)"},{"line_number":274,"context_line":"        ips \u003d []"},{"line_number":275,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"1a122d0e_d4c96827","line":272,"updated":"2016-05-02 06:31:07.000000000","message":"In this case, why not take port[\u0027id\u0027]?","commit_id":"c29021ccd370f0462755df06e6c0cb37d1f1e4d4"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"80bf31d9362269aebe36de749497b24c4554896a","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        ips \u003d []"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"        if \u0027fixed_ips\u0027 in port:"},{"line_number":277,"context_line":"            ips \u003d [ip[\u0027ip_address\u0027] for ip in port[\u0027fixed_ips\u0027]]"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        chassis \u003d None"},{"line_number":280,"context_line":"        if \u0027binding:host_id\u0027 in port:"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a122d0e_54d6f8c3","line":277,"updated":"2016-05-02 06:31:07.000000000","message":"You can rewrite the loop as:\n    ips \u003d [ip[\u0027ip_address\u0027] for ip in port.get(\u0027fixed_ips\u0027, [])].\n\nThis reduces the number of lookups, and then you can forgo the condition and initialisation of ips.","commit_id":"c29021ccd370f0462755df06e6c0cb37d1f1e4d4"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"80bf31d9362269aebe36de749497b24c4554896a","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        if \u0027fixed_ips\u0027 in port:"},{"line_number":277,"context_line":"            ips \u003d [ip[\u0027ip_address\u0027] for ip in port[\u0027fixed_ips\u0027]]"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        chassis \u003d None"},{"line_number":280,"context_line":"        if \u0027binding:host_id\u0027 in port:"},{"line_number":281,"context_line":"            chassis \u003d port[\u0027binding:host_id\u0027]"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        tunnel_key \u003d self.nb_api.allocate_tunnel_key()"},{"line_number":284,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"1a122d0e_94e09098","line":281,"range":{"start_line":279,"start_character":0,"end_line":281,"end_character":45},"updated":"2016-05-02 06:31:07.000000000","message":"Same here with:\nchassis \u003d port.get(\u0027binding:host_id\u0027, None)","commit_id":"c29021ccd370f0462755df06e6c0cb37d1f1e4d4"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"80bf31d9362269aebe36de749497b24c4554896a","unresolved":false,"context_lines":[{"line_number":285,"context_line":"        # Router GW ports are not needed by dragonflow controller and"},{"line_number":286,"context_line":"        # they currently cause error as they couldnt be mapped to"},{"line_number":287,"context_line":"        # a valid ofport (or location)"},{"line_number":288,"context_line":"        if port.get(\u0027device_owner\u0027) \u003d\u003d n_const.DEVICE_OWNER_ROUTER_GW:"},{"line_number":289,"context_line":"            chassis \u003d None"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        self.nb_api.create_lport("}],"source_content_type":"text/x-python","patch_set":16,"id":"1a122d0e_d4f04869","line":288,"updated":"2016-05-02 06:31:07.000000000","message":"Consider using this condition in the chassis lookup - if the condition is true, no lookup is necessary.","commit_id":"c29021ccd370f0462755df06e6c0cb37d1f1e4d4"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"80bf31d9362269aebe36de749497b24c4554896a","unresolved":false,"context_lines":[{"line_number":307,"context_line":"        port \u003d context.current"},{"line_number":308,"context_line":"        plugin_context \u003d context._plugin_context"},{"line_number":309,"context_line":"        port[\u0027port\u0027] \u003d port"},{"line_number":310,"context_line":"        sgids \u003d super(DFMechDriver, self)._get_security_groups_on_port("},{"line_number":311,"context_line":"            plugin_context, port)"},{"line_number":312,"context_line":"        self.create_port_in_nb_api(port, sgids)"},{"line_number":313,"context_line":"        LOG.info(_LI(\"DFMechDriver: create port %s\"), port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a122d0e_34cffc2a","line":310,"updated":"2016-05-02 06:31:07.000000000","message":"Why call the super explicitly?","commit_id":"c29021ccd370f0462755df06e6c0cb37d1f1e4d4"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"80bf31d9362269aebe36de749497b24c4554896a","unresolved":false,"context_lines":[{"line_number":320,"context_line":"            df_const.DF_PORT_NAME_EXT_ID_KEY: updated_port[\u0027name\u0027]}"},{"line_number":321,"context_line":"        allowed_macs \u003d self._get_allowed_mac_addresses_from_port("},{"line_number":322,"context_line":"            updated_port)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        ips \u003d []"},{"line_number":325,"context_line":"        if \u0027fixed_ips\u0027 in updated_port:"},{"line_number":326,"context_line":"            ips \u003d [ip[\u0027ip_address\u0027] for ip in updated_port[\u0027fixed_ips\u0027]]"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a122d0e_b4faec41","line":323,"updated":"2016-05-02 06:31:07.000000000","message":"Same 3 comments from create_port_postcommit also apply here.","commit_id":"c29021ccd370f0462755df06e6c0cb37d1f1e4d4"},{"author":{"_account_id":21007,"name":"yuan wei","email":"wei.yuan@huawei.com","username":"yuanwei"},"change_message_id":"9fd47001d122be3692ef387c4d324c25889d4e06","unresolved":false,"context_lines":[{"line_number":290,"context_line":"            chassis\u003dchassis, tunnel_key\u003dtunnel_key,"},{"line_number":291,"context_line":"            port_security\u003dallowed_macs,"},{"line_number":292,"context_line":"            device_owner\u003dport.get(\u0027device_owner\u0027, None),"},{"line_number":293,"context_line":"            sgids\u003dsgids)"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        return port"},{"line_number":296,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"dab17558_ac952de5","line":293,"updated":"2016-05-09 09:53:52.000000000","message":"shouldn\u0027t use sgids here, please change it to \"security_groups\", use sgids may cause a lport has two fields.","commit_id":"79ee5b36c4fc9e382a927df92e7a674f38be9391"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"33104776dbdd83a9abf80184b79767bdcd45b803","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            sg_version \u003d version_db._create_db_version_row(context.session,"},{"line_number":101,"context_line":"                                                           sg[\u0027id\u0027])"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        self.nb_api.create_security_group(name\u003dsg_name, topic\u003dtenant_id,"},{"line_number":104,"context_line":"                                          rules\u003drules, version\u003dsg_version)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        LOG.info(_LI(\"DFMechDriver: create security group %s\") % sg_name)"}],"source_content_type":"text/x-python","patch_set":27,"id":"bab6814e_667baf2a","line":103,"range":{"start_line":103,"start_character":42,"end_line":103,"end_character":46},"updated":"2016-05-24 02:23:03.000000000","message":"please check the newest master branch, all the object\u0027s unique identify changed to \"id\" instead of \"name\"","commit_id":"dbb78769a39dbfce5b59d706ca0c33b3f4b140e2"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"33104776dbdd83a9abf80184b79767bdcd45b803","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                plugin_context.session, network[\u0027id\u0027])"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"        self.nb_api.create_lswitch("},{"line_number":166,"context_line":"            name\u003dnetwork[\u0027id\u0027],"},{"line_number":167,"context_line":"            topic\u003dnetwork[\u0027tenant_id\u0027],"},{"line_number":168,"context_line":"            network_type\u003dnetwork[\u0027provider:network_type\u0027],"},{"line_number":169,"context_line":"            segmentation_id\u003dnetwork[\u0027provider:segmentation_id\u0027],"}],"source_content_type":"text/x-python","patch_set":27,"id":"bab6814e_66a28f9c","line":166,"range":{"start_line":166,"start_character":12,"end_line":166,"end_character":16},"updated":"2016-05-24 02:23:03.000000000","message":"id","commit_id":"dbb78769a39dbfce5b59d706ca0c33b3f4b140e2"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"33104776dbdd83a9abf80184b79767bdcd45b803","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            topic\u003dnetwork[\u0027tenant_id\u0027],"},{"line_number":168,"context_line":"            network_type\u003dnetwork[\u0027provider:network_type\u0027],"},{"line_number":169,"context_line":"            segmentation_id\u003dnetwork[\u0027provider:segmentation_id\u0027],"},{"line_number":170,"context_line":"            external_ids\u003dexternal_ids,"},{"line_number":171,"context_line":"            version\u003dnw_version,"},{"line_number":172,"context_line":"            subnets\u003d[])"},{"line_number":173,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"bab6814e_469f8b50","line":170,"range":{"start_line":170,"start_character":12,"end_line":170,"end_character":38},"updated":"2016-05-24 02:23:03.000000000","message":"no external_ids anymore, just the \"name\" field","commit_id":"dbb78769a39dbfce5b59d706ca0c33b3f4b140e2"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"33104776dbdd83a9abf80184b79767bdcd45b803","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        for port in self.nb_api.get_all_logical_ports(topic\u003dtenant_id):"},{"line_number":189,"context_line":"            if port.get_lswitch_id() \u003d\u003d network_id:"},{"line_number":190,"context_line":"                try:"},{"line_number":191,"context_line":"                    self.nb_api.delete_lport(name\u003dport.get_id(),"},{"line_number":192,"context_line":"                                             topic\u003dtenant_id)"},{"line_number":193,"context_line":"                    LOG.info(_LI(\"DFMechDriver: delete port %(port)s when \""},{"line_number":194,"context_line":"                                 \"delete network %(network)s\"),"}],"source_content_type":"text/x-python","patch_set":27,"id":"bab6814e_a6ac778d","line":191,"range":{"start_line":191,"start_character":45,"end_line":191,"end_character":49},"updated":"2016-05-24 02:23:03.000000000","message":"id","commit_id":"dbb78769a39dbfce5b59d706ca0c33b3f4b140e2"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"33104776dbdd83a9abf80184b79767bdcd45b803","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                              \"been deleted concurrently\" % port.get_id())"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        try:"},{"line_number":201,"context_line":"            self.nb_api.delete_lswitch(name\u003dnetwork_id,"},{"line_number":202,"context_line":"                                       topic\u003dtenant_id)"},{"line_number":203,"context_line":"        except df_exceptions.DBKeyNotFound:"},{"line_number":204,"context_line":"            LOG.debug(\"lswitch %s is not found in DF DB, might have \""}],"source_content_type":"text/x-python","patch_set":27,"id":"bab6814e_c6b9bbcd","line":201,"range":{"start_line":201,"start_character":39,"end_line":201,"end_character":43},"updated":"2016-05-24 02:23:03.000000000","message":"id","commit_id":"dbb78769a39dbfce5b59d706ca0c33b3f4b140e2"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"33104776dbdd83a9abf80184b79767bdcd45b803","unresolved":false,"context_lines":[{"line_number":485,"context_line":"            chassis \u003d port.get(\u0027binding:host_id\u0027, None)"},{"line_number":486,"context_line":""},{"line_number":487,"context_line":"        self.nb_api.create_lport("},{"line_number":488,"context_line":"            name\u003dport[\u0027id\u0027],"},{"line_number":489,"context_line":"            lswitch_name\u003dport[\u0027network_id\u0027],"},{"line_number":490,"context_line":"            topic\u003dport[\u0027tenant_id\u0027],"},{"line_number":491,"context_line":"            macs\u003d[port[\u0027mac_address\u0027]], ips\u003dips,"}],"source_content_type":"text/x-python","patch_set":27,"id":"bab6814e_46c66b4a","line":488,"range":{"start_line":488,"start_character":12,"end_line":488,"end_character":16},"updated":"2016-05-24 02:23:03.000000000","message":"id","commit_id":"dbb78769a39dbfce5b59d706ca0c33b3f4b140e2"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"33104776dbdd83a9abf80184b79767bdcd45b803","unresolved":false,"context_lines":[{"line_number":489,"context_line":"            lswitch_name\u003dport[\u0027network_id\u0027],"},{"line_number":490,"context_line":"            topic\u003dport[\u0027tenant_id\u0027],"},{"line_number":491,"context_line":"            macs\u003d[port[\u0027mac_address\u0027]], ips\u003dips,"},{"line_number":492,"context_line":"            external_ids\u003dexternal_ids,"},{"line_number":493,"context_line":"            enabled\u003dport.get(\u0027admin_state_up\u0027, None),"},{"line_number":494,"context_line":"            chassis\u003dchassis, tunnel_key\u003dtunnel_key,"},{"line_number":495,"context_line":"            version\u003dport_version,"}],"source_content_type":"text/x-python","patch_set":27,"id":"bab6814e_86c0532c","line":492,"range":{"start_line":492,"start_character":12,"end_line":492,"end_character":38},"updated":"2016-05-24 02:23:03.000000000","message":"name","commit_id":"dbb78769a39dbfce5b59d706ca0c33b3f4b140e2"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"33104776dbdd83a9abf80184b79767bdcd45b803","unresolved":false,"context_lines":[{"line_number":572,"context_line":"        ips \u003d [ip[\u0027ip_address\u0027] for ip in updated_port.get(\u0027fixed_ips\u0027, [])]"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"        self.nb_api.update_lport("},{"line_number":575,"context_line":"            name\u003dupdated_port[\u0027id\u0027],"},{"line_number":576,"context_line":"            topic\u003dupdated_port[\u0027tenant_id\u0027],"},{"line_number":577,"context_line":"            macs\u003d[updated_port[\u0027mac_address\u0027]], ips\u003dips,"},{"line_number":578,"context_line":"            external_ids\u003dexternal_ids,"}],"source_content_type":"text/x-python","patch_set":27,"id":"bab6814e_e6db1f20","line":575,"range":{"start_line":575,"start_character":12,"end_line":575,"end_character":16},"updated":"2016-05-24 02:23:03.000000000","message":"id","commit_id":"dbb78769a39dbfce5b59d706ca0c33b3f4b140e2"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"33104776dbdd83a9abf80184b79767bdcd45b803","unresolved":false,"context_lines":[{"line_number":575,"context_line":"            name\u003dupdated_port[\u0027id\u0027],"},{"line_number":576,"context_line":"            topic\u003dupdated_port[\u0027tenant_id\u0027],"},{"line_number":577,"context_line":"            macs\u003d[updated_port[\u0027mac_address\u0027]], ips\u003dips,"},{"line_number":578,"context_line":"            external_ids\u003dexternal_ids,"},{"line_number":579,"context_line":"            enabled\u003dupdated_port[\u0027admin_state_up\u0027],"},{"line_number":580,"context_line":"            port_security\u003dallowed_macs,"},{"line_number":581,"context_line":"            chassis\u003dchassis,"}],"source_content_type":"text/x-python","patch_set":27,"id":"bab6814e_c6e09bcf","line":578,"range":{"start_line":578,"start_character":12,"end_line":578,"end_character":38},"updated":"2016-05-24 02:23:03.000000000","message":"name","commit_id":"dbb78769a39dbfce5b59d706ca0c33b3f4b140e2"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"33104776dbdd83a9abf80184b79767bdcd45b803","unresolved":false,"context_lines":[{"line_number":597,"context_line":""},{"line_number":598,"context_line":"        try:"},{"line_number":599,"context_line":"            topic \u003d port[\u0027tenant_id\u0027]"},{"line_number":600,"context_line":"            self.nb_api.delete_lport(name\u003dport_id, topic\u003dtopic)"},{"line_number":601,"context_line":"        except df_exceptions.DBKeyNotFound:"},{"line_number":602,"context_line":"            LOG.debug(\"port %s is not found in DF DB, might have \""},{"line_number":603,"context_line":"                      \"been deleted concurrently\" % port_id)"}],"source_content_type":"text/x-python","patch_set":27,"id":"bab6814e_26e6c7e8","line":600,"range":{"start_line":600,"start_character":37,"end_line":600,"end_character":41},"updated":"2016-05-24 02:23:03.000000000","message":"id","commit_id":"dbb78769a39dbfce5b59d706ca0c33b3f4b140e2"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"0f502f138a9b220fcfb60b8279150658058cdbd7","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                   db_base_plugin_v2.NeutronDbPluginV2,"},{"line_number":49,"context_line":"                   securitygroups_db.SecurityGroupDbMixin,"},{"line_number":50,"context_line":"                   portbindings_db.PortBindingMixin,"},{"line_number":51,"context_line":"                   extradhcpopt_db.ExtraDhcpOptMixin):"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    \"\"\"Dragonflow ML2 MechanismDriver for Neutron."},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"bab6814e_5ebe04d5","line":51,"updated":"2016-05-24 17:39:33.000000000","message":"it\u0027s very unusual to have these mixins for a mech driver.\nis it really necessary?\n\ni guess it\u0027s better to use core_plugin\u0027s methods.","commit_id":"dfc93ed331acefb60f2c8370a714f6733997e33c"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"3de7a8e56b7eb70d4c8571f66df4b1e23eafd62d","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                   db_base_plugin_v2.NeutronDbPluginV2,"},{"line_number":49,"context_line":"                   securitygroups_db.SecurityGroupDbMixin,"},{"line_number":50,"context_line":"                   portbindings_db.PortBindingMixin,"},{"line_number":51,"context_line":"                   extradhcpopt_db.ExtraDhcpOptMixin):"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    \"\"\"Dragonflow ML2 MechanismDriver for Neutron."},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"bab6814e_5401aa05","line":51,"in_reply_to":"bab6814e_5ebe04d5","updated":"2016-05-25 08:17:46.000000000","message":"Thank you for your review. Your advice is very valuable, I have deleted NeutronDbPluginV2,pPortBindingMixin and ExtraDhcpOptMixin from mech_driver.\nBut SecurityGroupDbMixin must be reserved, because in \"delete_security_group_rule\", I must call the method \"get_security_group_rule\" in SecurityGroupDbMixin to get the rule info, so that I can obtain security group id from rule info.","commit_id":"dfc93ed331acefb60f2c8370a714f6733997e33c"},{"author":{"_account_id":20336,"name":"heshan","email":"shan.he@huawei.com","username":"shanhe"},"change_message_id":"18c7831d105d6dd69b28eef31913243386e13d5a","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            version_db._delete_db_version_row(plugin_context.session,"},{"line_number":190,"context_line":"                                              network_id)"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        for port in self.nb_api.get_all_logical_ports(topic\u003dtenant_id):"},{"line_number":193,"context_line":"            if port.get_lswitch_id() \u003d\u003d network_id:"},{"line_number":194,"context_line":"                try:"},{"line_number":195,"context_line":"                    self.nb_api.delete_lport(id\u003dport.get_id(),"}],"source_content_type":"text/x-python","patch_set":29,"id":"bab6814e_de902298","line":192,"range":{"start_line":192,"start_character":8,"end_line":192,"end_character":71},"updated":"2016-05-25 03:36:01.000000000","message":"It\u0027s redundant operation.\nbecause the ml2 plugin notify deleting_ports before notify deleting_network","commit_id":"dfc93ed331acefb60f2c8370a714f6733997e33c"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"3de7a8e56b7eb70d4c8571f66df4b1e23eafd62d","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            version_db._delete_db_version_row(plugin_context.session,"},{"line_number":190,"context_line":"                                              network_id)"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        for port in self.nb_api.get_all_logical_ports(topic\u003dtenant_id):"},{"line_number":193,"context_line":"            if port.get_lswitch_id() \u003d\u003d network_id:"},{"line_number":194,"context_line":"                try:"},{"line_number":195,"context_line":"                    self.nb_api.delete_lport(id\u003dport.get_id(),"}],"source_content_type":"text/x-python","patch_set":29,"id":"bab6814e_ef1f2b59","line":192,"range":{"start_line":192,"start_character":8,"end_line":192,"end_character":71},"in_reply_to":"bab6814e_de902298","updated":"2016-05-25 08:17:46.000000000","message":"Thank you, I will fix it.","commit_id":"dfc93ed331acefb60f2c8370a714f6733997e33c"},{"author":{"_account_id":20336,"name":"heshan","email":"shan.he@huawei.com","username":"shanhe"},"change_message_id":"18c7831d105d6dd69b28eef31913243386e13d5a","unresolved":false,"context_lines":[{"line_number":320,"context_line":"            if ip:"},{"line_number":321,"context_line":"                return ip"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    def _get_subnet_dhcp_port_address(self, context, subnet):"},{"line_number":324,"context_line":"        \"\"\"Create the dhcp configration for the subnet"},{"line_number":325,"context_line":"        Returns the dhcp server ip address if configured"},{"line_number":326,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":29,"id":"bab6814e_99f8747e","line":323,"range":{"start_line":323,"start_character":8,"end_line":323,"end_character":37},"updated":"2016-05-25 03:36:01.000000000","message":"don\u0027t find the caller of this method","commit_id":"dfc93ed331acefb60f2c8370a714f6733997e33c"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"3de7a8e56b7eb70d4c8571f66df4b1e23eafd62d","unresolved":false,"context_lines":[{"line_number":320,"context_line":"            if ip:"},{"line_number":321,"context_line":"                return ip"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    def _get_subnet_dhcp_port_address(self, context, subnet):"},{"line_number":324,"context_line":"        \"\"\"Create the dhcp configration for the subnet"},{"line_number":325,"context_line":"        Returns the dhcp server ip address if configured"},{"line_number":326,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":29,"id":"bab6814e_4f2f5788","line":323,"range":{"start_line":323,"start_character":8,"end_line":323,"end_character":37},"in_reply_to":"bab6814e_99f8747e","updated":"2016-05-25 08:17:46.000000000","message":"Thank you, I will delete it.","commit_id":"dfc93ed331acefb60f2c8370a714f6733997e33c"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"0f502f138a9b220fcfb60b8279150658058cdbd7","unresolved":false,"context_lines":[{"line_number":537,"context_line":""},{"line_number":538,"context_line":"        # If a subnet enabled dhcp, the DFMechDriver will create a dhcp server"},{"line_number":539,"context_line":"        # port. When delete this subnet, the port should be deleted."},{"line_number":540,"context_line":"        # In ml2\\plugin.py, when delete subnet, it will call"},{"line_number":541,"context_line":"        # update_port_postcommit, DFMechDriver should judge the port is dhcp"},{"line_number":542,"context_line":"        # port or not, if it is, then delete it."},{"line_number":543,"context_line":"        if self._is_dhcp_port_after_subnet_delete(updated_port):"}],"source_content_type":"text/x-python","patch_set":29,"id":"bab6814e_7e1148af","line":540,"range":{"start_line":540,"start_character":16,"end_line":540,"end_character":17},"updated":"2016-05-24 17:39:33.000000000","message":"/","commit_id":"dfc93ed331acefb60f2c8370a714f6733997e33c"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"3de7a8e56b7eb70d4c8571f66df4b1e23eafd62d","unresolved":false,"context_lines":[{"line_number":537,"context_line":""},{"line_number":538,"context_line":"        # If a subnet enabled dhcp, the DFMechDriver will create a dhcp server"},{"line_number":539,"context_line":"        # port. When delete this subnet, the port should be deleted."},{"line_number":540,"context_line":"        # In ml2\\plugin.py, when delete subnet, it will call"},{"line_number":541,"context_line":"        # update_port_postcommit, DFMechDriver should judge the port is dhcp"},{"line_number":542,"context_line":"        # port or not, if it is, then delete it."},{"line_number":543,"context_line":"        if self._is_dhcp_port_after_subnet_delete(updated_port):"}],"source_content_type":"text/x-python","patch_set":29,"id":"bab6814e_8f4f7f69","line":540,"range":{"start_line":540,"start_character":16,"end_line":540,"end_character":17},"in_reply_to":"bab6814e_7e1148af","updated":"2016-05-25 08:17:46.000000000","message":"Thank you, I will fix it.","commit_id":"dfc93ed331acefb60f2c8370a714f6733997e33c"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"52448ef78a9076b596a55e31bab255523a56f845","unresolved":false,"context_lines":[{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        for fixed_ip in port[\u0027fixed_ips\u0027]:"},{"line_number":279,"context_line":"            ip \u003d fixed_ip.get(\u0027ip_address\u0027, None)"},{"line_number":280,"context_line":"            if ip:"},{"line_number":281,"context_line":"                return ip"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"    @lock_db.wrap_db_lock(lock_db.RESOURCE_ML2_CORE)"},{"line_number":284,"context_line":"    def create_subnet_postcommit(self, context):"}],"source_content_type":"text/x-python","patch_set":31,"id":"bab6814e_60bdd767","line":281,"range":{"start_line":280,"start_character":12,"end_line":281,"end_character":25},"updated":"2016-05-26 01:45:30.000000000","message":"return ip if ip else None","commit_id":"941e9dde90c4ecfc3a7147e38cae410c4e550d72"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"5105a699111c820e0f1eb945dde01a71721ea5ea","unresolved":false,"context_lines":[{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        for fixed_ip in port[\u0027fixed_ips\u0027]:"},{"line_number":279,"context_line":"            ip \u003d fixed_ip.get(\u0027ip_address\u0027, None)"},{"line_number":280,"context_line":"            if ip:"},{"line_number":281,"context_line":"                return ip"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"    @lock_db.wrap_db_lock(lock_db.RESOURCE_ML2_CORE)"},{"line_number":284,"context_line":"    def create_subnet_postcommit(self, context):"}],"source_content_type":"text/x-python","patch_set":31,"id":"bab6814e_3bbca005","line":281,"range":{"start_line":280,"start_character":12,"end_line":281,"end_character":25},"in_reply_to":"bab6814e_60bdd767","updated":"2016-05-26 02:09:39.000000000","message":"Thank you, I will fix it like this: return None at last line.","commit_id":"941e9dde90c4ecfc3a7147e38cae410c4e550d72"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"52448ef78a9076b596a55e31bab255523a56f845","unresolved":false,"context_lines":[{"line_number":455,"context_line":"    def _is_dhcp_port_after_subnet_delete(self, port):"},{"line_number":456,"context_line":"        # If a subnet enabled dhcp, the DFMechDriver will create a dhcp server"},{"line_number":457,"context_line":"        # port. When delete this subnet, the port should be deleted."},{"line_number":458,"context_line":"        # In ml2\\plugin.py, when delete subnet, it will call"},{"line_number":459,"context_line":"        # update_port_postcommit, DFMechDriver should judge the port is dhcp"},{"line_number":460,"context_line":"        # port or not, if it is, then delete it."},{"line_number":461,"context_line":"        host_id \u003d port.get(\u0027binding:host_id\u0027, None)"}],"source_content_type":"text/x-python","patch_set":31,"id":"bab6814e_00532b3a","line":458,"range":{"start_line":458,"start_character":16,"end_line":458,"end_character":17},"updated":"2016-05-26 01:45:30.000000000","message":"/","commit_id":"941e9dde90c4ecfc3a7147e38cae410c4e550d72"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"5105a699111c820e0f1eb945dde01a71721ea5ea","unresolved":false,"context_lines":[{"line_number":455,"context_line":"    def _is_dhcp_port_after_subnet_delete(self, port):"},{"line_number":456,"context_line":"        # If a subnet enabled dhcp, the DFMechDriver will create a dhcp server"},{"line_number":457,"context_line":"        # port. When delete this subnet, the port should be deleted."},{"line_number":458,"context_line":"        # In ml2\\plugin.py, when delete subnet, it will call"},{"line_number":459,"context_line":"        # update_port_postcommit, DFMechDriver should judge the port is dhcp"},{"line_number":460,"context_line":"        # port or not, if it is, then delete it."},{"line_number":461,"context_line":"        host_id \u003d port.get(\u0027binding:host_id\u0027, None)"}],"source_content_type":"text/x-python","patch_set":31,"id":"bab6814e_fb4cd843","line":458,"range":{"start_line":458,"start_character":16,"end_line":458,"end_character":17},"in_reply_to":"bab6814e_00532b3a","updated":"2016-05-26 02:09:39.000000000","message":"Thank you, I will fix it.","commit_id":"941e9dde90c4ecfc3a7147e38cae410c4e550d72"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"52448ef78a9076b596a55e31bab255523a56f845","unresolved":false,"context_lines":[{"line_number":573,"context_line":"                                                    constants.TYPE_VXLAN,"},{"line_number":574,"context_line":"                                                    constants.TYPE_FLAT,"},{"line_number":575,"context_line":"                                                    constants.TYPE_GRE,"},{"line_number":576,"context_line":"                                                    constants.TYPE_LOCAL]"}],"source_content_type":"text/x-python","patch_set":31,"id":"bab6814e_40cd3330","line":576,"updated":"2016-05-26 01:45:30.000000000","message":"Do we support non-tunnel protocols currently? Why not geneve here? (we use it as our default tunneling method.)","commit_id":"941e9dde90c4ecfc3a7147e38cae410c4e550d72"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"5105a699111c820e0f1eb945dde01a71721ea5ea","unresolved":false,"context_lines":[{"line_number":573,"context_line":"                                                    constants.TYPE_VXLAN,"},{"line_number":574,"context_line":"                                                    constants.TYPE_FLAT,"},{"line_number":575,"context_line":"                                                    constants.TYPE_GRE,"},{"line_number":576,"context_line":"                                                    constants.TYPE_LOCAL]"}],"source_content_type":"text/x-python","patch_set":31,"id":"bab6814e_fb96984a","line":576,"in_reply_to":"bab6814e_40cd3330","updated":"2016-05-26 02:09:39.000000000","message":"Thank you, I will add it.","commit_id":"941e9dde90c4ecfc3a7147e38cae410c4e550d72"},{"author":{"_account_id":9044,"name":"Will","email":"wangjian.ika@bytedance.com","username":"Will"},"change_message_id":"185da0b05d3a943131cb1fa9b6e6d3317d67f7b7","unresolved":false,"context_lines":[{"line_number":10,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"from dragonflow._i18n import _LI"},{"line_number":14,"context_line":"from dragonflow.common import common_params"},{"line_number":15,"context_line":"from dragonflow.common import constants as df_common_const"},{"line_number":16,"context_line":"from dragonflow.common import exceptions as df_exceptions"},{"line_number":17,"context_line":"from dragonflow.common import extensions"},{"line_number":18,"context_line":"from dragonflow.db import api_nb"},{"line_number":19,"context_line":"from dragonflow.db.neutron import lockedobjects_db as lock_db"},{"line_number":20,"context_line":"from dragonflow.db.neutron import versionobjects_db as version_db"},{"line_number":21,"context_line":"from dragonflow.neutron.common import constants as df_const"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from neutron.api.v2 import attributes as attr"},{"line_number":24,"context_line":"from neutron.callbacks import events"},{"line_number":25,"context_line":"from neutron.callbacks import registry"},{"line_number":26,"context_line":"from neutron.callbacks import resources"},{"line_number":27,"context_line":"from neutron.common import constants as n_const"},{"line_number":28,"context_line":"from neutron.db import common_db_mixin"},{"line_number":29,"context_line":"from neutron.db import securitygroups_db"},{"line_number":30,"context_line":"from neutron.extensions import allowedaddresspairs as addr_pair"},{"line_number":31,"context_line":"from neutron.extensions import portbindings"},{"line_number":32,"context_line":"from neutron.extensions import portsecurity as psec"},{"line_number":33,"context_line":"from neutron import manager"},{"line_number":34,"context_line":"from neutron.plugins.common import constants"},{"line_number":35,"context_line":"from neutron.plugins.ml2 import driver_api"},{"line_number":36,"context_line":"from neutron.plugins.ml2 import models"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"from oslo_config import cfg"},{"line_number":39,"context_line":"from oslo_log import log"},{"line_number":40,"context_line":"from oslo_utils import importutils"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":43,"context_line":"cfg.CONF.register_opts(common_params.df_opts, \u0027df\u0027)"}],"source_content_type":"text/x-python","patch_set":38,"id":"7aa08908_4e68fd87","line":40,"range":{"start_line":13,"start_character":0,"end_line":40,"end_character":34},"updated":"2016-06-07 00:40:49.000000000","message":"Hi yongben, you may want to follow this practice to reorganize the import code block, http://docs.openstack.org/developer/hacking/#import-order-template","commit_id":"8b091022106391ea42e85af6c15f399cffc614f3"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"80bd7db66423bcfd99c25975545e9e02c01a9113","unresolved":false,"context_lines":[{"line_number":162,"context_line":"                                               sg_version\u003dsg_version_id)"},{"line_number":163,"context_line":"        LOG.info(_LI(\"DFMechDriver: delete security group rule %s\"), sgr_id)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    @lock_db.wrap_db_lock(lock_db.RESOURCE_ML2_CORE)"},{"line_number":166,"context_line":"    def create_network_postcommit(self, context):"},{"line_number":167,"context_line":"        network \u003d context.current"},{"line_number":168,"context_line":"        plugin_context \u003d context._plugin_context"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        with plugin_context.session.begin(subtransactions\u003dTrue):"},{"line_number":171,"context_line":"            nw_version \u003d version_db._create_db_version_row("},{"line_number":172,"context_line":"                plugin_context.session, network[\u0027id\u0027])"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        self.nb_api.create_lswitch("},{"line_number":175,"context_line":"            id\u003dnetwork[\u0027id\u0027],"},{"line_number":176,"context_line":"            topic\u003dnetwork[\u0027tenant_id\u0027],"},{"line_number":177,"context_line":"            name\u003dnetwork.get(\u0027name\u0027, df_const.DF_NETWORK_DEFAULT_NAME),"},{"line_number":178,"context_line":"            network_type\u003dnetwork[\u0027provider:network_type\u0027],"},{"line_number":179,"context_line":"            segmentation_id\u003dnetwork[\u0027provider:segmentation_id\u0027],"},{"line_number":180,"context_line":"            router_external\u003dnetwork[\u0027router:external\u0027],"},{"line_number":181,"context_line":"            mtu\u003dnetwork[\u0027mtu\u0027],"},{"line_number":182,"context_line":"            version\u003dnw_version,"},{"line_number":183,"context_line":"            subnets\u003d[])"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        LOG.info(_LI(\"DFMechDriver: create network %s\"), network[\u0027id\u0027])"},{"line_number":186,"context_line":"        return network"}],"source_content_type":"text/x-python","patch_set":38,"id":"7aa08908_591118ac","line":183,"range":{"start_line":165,"start_character":4,"end_line":183,"end_character":23},"updated":"2016-06-06 10:31:15.000000000","message":"Because ML2 plugin separate the logic into three part: precommit, ml2 logic, postcommit. So the current workflow is precommit-\u003eml2 logic-\u003eobtain_lock-\u003epostcommit-\u003erelease_lock. So, the race happens when the user concurrently calls ml2 logic for the same object. The lock only protects postcommit, but not the whole ml2 operation.\n\nWhen versioning involves, we can solve it via comparing object version. But this also needs some modification of the current code. The version object operations needs to be put in precommit, not postcommit. Because the precommit is in the ml2 main db transaction. If you put in the postcommit, the versioning doesn\u0027t make sense, because it is in another db transaction, so the operation on version is not atomic at all.","commit_id":"8b091022106391ea42e85af6c15f399cffc614f3"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"35209cde6ad33ec4ba217f0c52a9c9783d1ee5c5","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class DFMechDriver(driver_api.MechanismDriver,"},{"line_number":47,"context_line":"                   securitygroups_db.SecurityGroupDbMixin,"},{"line_number":48,"context_line":"                   common_db_mixin.CommonDbMixin):"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    \"\"\"Dragonflow ML2 MechanismDriver for Neutron."},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":41,"id":"7aa08908_cf0af225","line":48,"range":{"start_line":47,"start_character":19,"end_line":48,"end_character":48},"updated":"2016-06-13 08:24:34.000000000","message":"i think it\u0027s better to call core plugin\u0027s methods than having db-mixins here.","commit_id":"ceb13801b7c06c286e5fbd6cd3dce9f163fb932e"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"fea54cd37db5f8ff8781b16e6209835de954eb31","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class DFMechDriver(driver_api.MechanismDriver,"},{"line_number":47,"context_line":"                   securitygroups_db.SecurityGroupDbMixin,"},{"line_number":48,"context_line":"                   common_db_mixin.CommonDbMixin):"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    \"\"\"Dragonflow ML2 MechanismDriver for Neutron."},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":41,"id":"7aa08908_acd331d4","line":48,"range":{"start_line":47,"start_character":19,"end_line":48,"end_character":48},"in_reply_to":"7aa08908_cf0af225","updated":"2016-06-14 01:58:24.000000000","message":"Thank you, I will fix it.","commit_id":"ceb13801b7c06c286e5fbd6cd3dce9f163fb932e"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"35209cde6ad33ec4ba217f0c52a9c9783d1ee5c5","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    def create_network_precommit(self, context):"},{"line_number":166,"context_line":"        nw_version \u003d version_db._create_db_version_row("},{"line_number":167,"context_line":"            context._plugin_context.session, context.current[\u0027id\u0027])"},{"line_number":168,"context_line":"        context.current[\u0027db_version\u0027] \u003d nw_version"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    @lock_db.wrap_db_lock(lock_db.RESOURCE_ML2_CORE)"},{"line_number":171,"context_line":"    def create_network_postcommit(self, context):"}],"source_content_type":"text/x-python","patch_set":41,"id":"7aa08908_2fa8d61f","line":168,"range":{"start_line":168,"start_character":8,"end_line":168,"end_character":23},"updated":"2016-06-13 08:24:34.000000000","message":"i don\u0027t think it\u0027s a good idea to modify objects owned by the other modules this way.\n\nwhat you want here is MD-specific context data, right?\nhave you proposed it to ml2 folks?  i think it would be useful for other MDs as well.","commit_id":"ceb13801b7c06c286e5fbd6cd3dce9f163fb932e"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"55de7b215a969722f6b6bb052c3ef409b4da9f8e","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    def create_network_precommit(self, context):"},{"line_number":166,"context_line":"        nw_version \u003d version_db._create_db_version_row("},{"line_number":167,"context_line":"            context._plugin_context.session, context.current[\u0027id\u0027])"},{"line_number":168,"context_line":"        context.current[\u0027db_version\u0027] \u003d nw_version"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    @lock_db.wrap_db_lock(lock_db.RESOURCE_ML2_CORE)"},{"line_number":171,"context_line":"    def create_network_postcommit(self, context):"}],"source_content_type":"text/x-python","patch_set":41,"id":"7aa08908_8d2608cc","line":168,"range":{"start_line":168,"start_character":8,"end_line":168,"end_character":23},"in_reply_to":"7aa08908_0d617839","updated":"2016-06-14 03:20:36.000000000","message":"i filed a bug\nhttps://bugs.launchpad.net/neutron/+bug/1592238","commit_id":"ceb13801b7c06c286e5fbd6cd3dce9f163fb932e"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"fea54cd37db5f8ff8781b16e6209835de954eb31","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    def create_network_precommit(self, context):"},{"line_number":166,"context_line":"        nw_version \u003d version_db._create_db_version_row("},{"line_number":167,"context_line":"            context._plugin_context.session, context.current[\u0027id\u0027])"},{"line_number":168,"context_line":"        context.current[\u0027db_version\u0027] \u003d nw_version"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    @lock_db.wrap_db_lock(lock_db.RESOURCE_ML2_CORE)"},{"line_number":171,"context_line":"    def create_network_postcommit(self, context):"}],"source_content_type":"text/x-python","patch_set":41,"id":"7aa08908_6fc2dbea","line":168,"range":{"start_line":168,"start_character":8,"end_line":168,"end_character":23},"in_reply_to":"7aa08908_2fa8d61f","updated":"2016-06-14 01:58:24.000000000","message":"Thank you for your advice.\nWhat I want to do is to transmit the db_version to postcommit phase. The db_version must be wrote to neutron db in precommit phase and wrote to df db in postcommit phase, so I write db_version in context so that it can be carried to postcommit phase.\n\nSorry I don\u0027t really get the meaning of \"proposed it to ml2 folks\"，do you mean I should modify the neutron code and add a attribute like \"user_data\" to the context?","commit_id":"ceb13801b7c06c286e5fbd6cd3dce9f163fb932e"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"6a8f1bce56acd26a5050bea439c5ce60ca863328","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    def create_network_precommit(self, context):"},{"line_number":166,"context_line":"        nw_version \u003d version_db._create_db_version_row("},{"line_number":167,"context_line":"            context._plugin_context.session, context.current[\u0027id\u0027])"},{"line_number":168,"context_line":"        context.current[\u0027db_version\u0027] \u003d nw_version"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    @lock_db.wrap_db_lock(lock_db.RESOURCE_ML2_CORE)"},{"line_number":171,"context_line":"    def create_network_postcommit(self, context):"}],"source_content_type":"text/x-python","patch_set":41,"id":"7aa08908_0d617839","line":168,"range":{"start_line":168,"start_character":8,"end_line":168,"end_character":23},"in_reply_to":"7aa08908_6fc2dbea","updated":"2016-06-14 03:10:49.000000000","message":"yes, i suggest to add user_data or driver_data or something along the line.\nas it might take some time, it might be more appropriate to add REVISIT comment here for now and propose it to ml2 team in parallel.","commit_id":"ceb13801b7c06c286e5fbd6cd3dce9f163fb932e"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"a9f8858139297627ff6e830ebba9db4ee5335368","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    def create_network_precommit(self, context):"},{"line_number":166,"context_line":"        nw_version \u003d version_db._create_db_version_row("},{"line_number":167,"context_line":"            context._plugin_context.session, context.current[\u0027id\u0027])"},{"line_number":168,"context_line":"        context.current[\u0027db_version\u0027] \u003d nw_version"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    @lock_db.wrap_db_lock(lock_db.RESOURCE_ML2_CORE)"},{"line_number":171,"context_line":"    def create_network_postcommit(self, context):"}],"source_content_type":"text/x-python","patch_set":41,"id":"7aa08908_bc55f41e","line":168,"range":{"start_line":168,"start_character":8,"end_line":168,"end_character":23},"in_reply_to":"7aa08908_8d2608cc","updated":"2016-06-14 06:49:30.000000000","message":"thank you,i got it. i will fix this bug after neutron\u0027s bug fixed.","commit_id":"ceb13801b7c06c286e5fbd6cd3dce9f163fb932e"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"ac9ede8a2b1c59c1afd6e5c3eae033fe0e96f7b6","unresolved":false,"context_lines":[{"line_number":527,"context_line":"            device_owner\u003dupdated_port.get(\u0027device_owner\u0027, None),"},{"line_number":528,"context_line":"            security_groups\u003dsecurity_groups,"},{"line_number":529,"context_line":"            port_security_enabled\u003dupdated_port.get(psec.PORTSECURITY, False),"},{"line_number":530,"context_line":"            allowed_address_pairs\u003dupdated_port.get(addr_pair.ADDRESS_PAIRS,"},{"line_number":531,"context_line":"                                                   []),"},{"line_number":532,"context_line":"            version\u003dupdated_port[\u0027db_version\u0027])"},{"line_number":533,"context_line":""},{"line_number":534,"context_line":"        LOG.info(_LI(\"DFMechDriver: update port %s\"), updated_port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":41,"id":"7aa08908_33c20aea","line":531,"range":{"start_line":530,"start_character":51,"end_line":531,"end_character":53},"updated":"2016-06-13 02:45:43.000000000","message":"Consider make the default value to None, it will simplify the judgement which could use None instead of empty list","commit_id":"ceb13801b7c06c286e5fbd6cd3dce9f163fb932e"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"fea54cd37db5f8ff8781b16e6209835de954eb31","unresolved":false,"context_lines":[{"line_number":527,"context_line":"            device_owner\u003dupdated_port.get(\u0027device_owner\u0027, None),"},{"line_number":528,"context_line":"            security_groups\u003dsecurity_groups,"},{"line_number":529,"context_line":"            port_security_enabled\u003dupdated_port.get(psec.PORTSECURITY, False),"},{"line_number":530,"context_line":"            allowed_address_pairs\u003dupdated_port.get(addr_pair.ADDRESS_PAIRS,"},{"line_number":531,"context_line":"                                                   []),"},{"line_number":532,"context_line":"            version\u003dupdated_port[\u0027db_version\u0027])"},{"line_number":533,"context_line":""},{"line_number":534,"context_line":"        LOG.info(_LI(\"DFMechDriver: update port %s\"), updated_port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":41,"id":"7aa08908_fb6e8d2d","line":531,"range":{"start_line":530,"start_character":51,"end_line":531,"end_character":53},"in_reply_to":"7aa08908_33c20aea","updated":"2016-06-14 01:58:24.000000000","message":"Thank you, I will fix it.","commit_id":"ceb13801b7c06c286e5fbd6cd3dce9f163fb932e"},{"author":{"_account_id":22060,"name":"jingting","email":"kangjingting@huawei.com","username":"jingting"},"change_message_id":"5297f73cf60b2fe89f38028ace6189b2eda40782","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                         \u0027admin_state_up\u0027: True, \u0027device_id\u0027: \u0027\u0027,"},{"line_number":255,"context_line":"                         \u0027device_owner\u0027: n_const.DEVICE_OWNER_DHCP,"},{"line_number":256,"context_line":"                         \u0027mac_address\u0027: attr.ATTR_NOT_SPECIFIED,"},{"line_number":257,"context_line":"                         \u0027fixed_ips\u0027: [{\u0027subnet_id\u0027: subnet[\u0027id\u0027]}]}}"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":260,"context_line":"        port \u003d core_plugin.create_port(context, port)"}],"source_content_type":"text/x-python","patch_set":46,"id":"7aa08908_e8413a0b","line":257,"updated":"2016-06-15 03:50:04.000000000","message":"Is it really needed for the fixed_ips?","commit_id":"8af768c77b581711d733d2dd975aeca2efa484f5"},{"author":{"_account_id":22060,"name":"jingting","email":"kangjingting@huawei.com","username":"jingting"},"change_message_id":"5297f73cf60b2fe89f38028ace6189b2eda40782","unresolved":false,"context_lines":[{"line_number":376,"context_line":"        try:"},{"line_number":377,"context_line":"            dhcp_port \u003d self._handle_update_subnet_dhcp(plugin_context,"},{"line_number":378,"context_line":"                                                        old_subnet,"},{"line_number":379,"context_line":"                                                        new_subnet)"},{"line_number":380,"context_line":"        except Exception as e:"},{"line_number":381,"context_line":"            LOG.exception(e)"},{"line_number":382,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":46,"id":"7aa08908_c84b9e85","line":379,"updated":"2016-06-15 03:50:04.000000000","message":"here we only need to update port info?","commit_id":"8af768c77b581711d733d2dd975aeca2efa484f5"}],"dragonflow/tests/unit/test_controller.py":[{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"0a7d1252125f8c1625621a3d2d557636623fd232","unresolved":false,"context_lines":[{"line_number":25,"context_line":"        super(TestDfController, self).setUp()"},{"line_number":26,"context_line":"        dispatcher.AppDispatcher \u003d mock.Mock()"},{"line_number":27,"context_line":"        db_store.DbStore \u003d mock.Mock()"},{"line_number":28,"context_line":"        # cfg.CONF \u003d mock.Mock()"},{"line_number":29,"context_line":"        self.controller \u003d mock.Mock()"},{"line_number":30,"context_line":"        self.controller.nb_api \u003d mock.Mock()"},{"line_number":31,"context_line":"        self.controller.vswitch_api \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":24,"id":"bab6814e_d518f186","line":28,"updated":"2016-05-19 12:22:11.000000000","message":"why did you need to remove that?","commit_id":"86328bcd7fb5e3678d72013111ca124f0c0a6a5d"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"1283204ab9a52c3d74f884f3cc2089085a73394f","unresolved":false,"context_lines":[{"line_number":25,"context_line":"        super(TestDfController, self).setUp()"},{"line_number":26,"context_line":"        dispatcher.AppDispatcher \u003d mock.Mock()"},{"line_number":27,"context_line":"        db_store.DbStore \u003d mock.Mock()"},{"line_number":28,"context_line":"        # cfg.CONF \u003d mock.Mock()"},{"line_number":29,"context_line":"        self.controller \u003d mock.Mock()"},{"line_number":30,"context_line":"        self.controller.nb_api \u003d mock.Mock()"},{"line_number":31,"context_line":"        self.controller.vswitch_api \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":24,"id":"bab6814e_a434affb","line":28,"in_reply_to":"bab6814e_d518f186","updated":"2016-05-23 02:31:28.000000000","message":"\"cfg.CONF\u003dmock.Mock()\" will cause the test_mech_driver.py failed, bacause the test_mech_driver.py need to access the real address of cfg.CONF.","commit_id":"86328bcd7fb5e3678d72013111ca124f0c0a6a5d"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"52448ef78a9076b596a55e31bab255523a56f845","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"import mock"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"# from oslo_config import cfg"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from dragonflow.controller import dispatcher"},{"line_number":18,"context_line":"from dragonflow.db import db_store"}],"source_content_type":"text/x-python","patch_set":31,"id":"bab6814e_401ed370","line":15,"updated":"2016-05-26 01:45:30.000000000","message":"remove it? why comment it?","commit_id":"941e9dde90c4ecfc3a7147e38cae410c4e550d72"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"5105a699111c820e0f1eb945dde01a71721ea5ea","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"import mock"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"# from oslo_config import cfg"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from dragonflow.controller import dispatcher"},{"line_number":18,"context_line":"from dragonflow.db import db_store"}],"source_content_type":"text/x-python","patch_set":31,"id":"bab6814e_fbcb3851","line":15,"in_reply_to":"bab6814e_401ed370","updated":"2016-05-26 02:09:39.000000000","message":"Thank you, I will delete it.","commit_id":"941e9dde90c4ecfc3a7147e38cae410c4e550d72"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"52448ef78a9076b596a55e31bab255523a56f845","unresolved":false,"context_lines":[{"line_number":25,"context_line":"        super(TestDfController, self).setUp()"},{"line_number":26,"context_line":"        dispatcher.AppDispatcher \u003d mock.Mock()"},{"line_number":27,"context_line":"        db_store.DbStore \u003d mock.Mock()"},{"line_number":28,"context_line":"        # cfg.CONF \u003d mock.Mock()"},{"line_number":29,"context_line":"        self.controller \u003d mock.Mock()"},{"line_number":30,"context_line":"        self.controller.nb_api \u003d mock.Mock()"},{"line_number":31,"context_line":"        self.controller.vswitch_api \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":31,"id":"bab6814e_c00ac325","line":28,"updated":"2016-05-26 01:45:30.000000000","message":"ditto","commit_id":"941e9dde90c4ecfc3a7147e38cae410c4e550d72"},{"author":{"_account_id":20960,"name":"wangyongben","email":"wangyongben@huawei.com","username":"wangyonben"},"change_message_id":"5105a699111c820e0f1eb945dde01a71721ea5ea","unresolved":false,"context_lines":[{"line_number":25,"context_line":"        super(TestDfController, self).setUp()"},{"line_number":26,"context_line":"        dispatcher.AppDispatcher \u003d mock.Mock()"},{"line_number":27,"context_line":"        db_store.DbStore \u003d mock.Mock()"},{"line_number":28,"context_line":"        # cfg.CONF \u003d mock.Mock()"},{"line_number":29,"context_line":"        self.controller \u003d mock.Mock()"},{"line_number":30,"context_line":"        self.controller.nb_api \u003d mock.Mock()"},{"line_number":31,"context_line":"        self.controller.vswitch_api \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":31,"id":"bab6814e_dbc8f457","line":28,"in_reply_to":"bab6814e_c00ac325","updated":"2016-05-26 02:09:39.000000000","message":"Thank you, I will delete it.","commit_id":"941e9dde90c4ecfc3a7147e38cae410c4e550d72"}]}
