)]}'
{"etc/neutron/plugins/ml2/ml2_conf_odl.ini":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":20,"context_line":"# (IntOpt) Timeout in seconds to wait for ODL HTTP request completion."},{"line_number":21,"context_line":"# This is an optional parameter, default value is 10 seconds."},{"line_number":22,"context_line":"#"},{"line_number":23,"context_line":"# timeout \u003d"},{"line_number":24,"context_line":"# Example: timeout \u003d 15"}],"source_content_type":"text/x-properties","patch_set":1,"id":"AAAAUH%2F9vrc%3D","line":23,"updated":"2014-02-04 14:33:34.000000000","message":"The default is 10. We usually write the default value here.\n\n timeout \u003d 10","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":21,"context_line":"# This is an optional parameter, default value is 10 seconds."},{"line_number":22,"context_line":"#"},{"line_number":23,"context_line":"# timeout \u003d"},{"line_number":24,"context_line":"# Example: timeout \u003d 15"}],"source_content_type":"text/x-properties","patch_set":1,"id":"AAAAUH%2F9vro%3D","line":24,"updated":"2014-02-04 14:33:34.000000000","message":"session_timeout seems missing here.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1a0372421872077ee87036cadcccf2af12479f4a","unresolved":false,"context_lines":[{"line_number":21,"context_line":"# This is an optional parameter, default value is 10 seconds."},{"line_number":22,"context_line":"#"},{"line_number":23,"context_line":"# timeout \u003d"},{"line_number":24,"context_line":"# Example: timeout \u003d 15"}],"source_content_type":"text/x-properties","patch_set":2,"id":"AAAAUH%2F9nKY%3D","line":24,"updated":"2014-02-05 17:21:42.000000000","message":"Needs to add session_timeout too.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":21,"context_line":"# This is an optional parameter, default value is 10 seconds."},{"line_number":22,"context_line":"#"},{"line_number":23,"context_line":"# timeout \u003d"},{"line_number":24,"context_line":"# Example: timeout \u003d 15"}],"source_content_type":"text/x-properties","patch_set":2,"id":"AAAAUX%2F%2F6EU%3D","line":24,"in_reply_to":"AAAAUH%2F9nKY%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"}],"neutron/db/migration/alembic_migrations/versions/4692d074d587_agent_scheduler.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    \u0027neutron.plugins.nicira.NeutronPlugin.NvpPluginV2\u0027,"},{"line_number":36,"context_line":"    \u0027neutron.plugins.nec.nec_plugin.NECPluginV2\u0027,"},{"line_number":37,"context_line":"    \u0027neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2\u0027,"},{"line_number":38,"context_line":"    \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027,"},{"line_number":39,"context_line":"]"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"from alembic import op"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vPs%3D","line":38,"updated":"2014-02-04 14:33:34.000000000","message":"I wonder why this change is required to support ODL mech driver.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1a0372421872077ee87036cadcccf2af12479f4a","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    \u0027neutron.plugins.nicira.NeutronPlugin.NvpPluginV2\u0027,"},{"line_number":36,"context_line":"    \u0027neutron.plugins.nec.nec_plugin.NECPluginV2\u0027,"},{"line_number":37,"context_line":"    \u0027neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2\u0027,"},{"line_number":38,"context_line":"    \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027,"},{"line_number":39,"context_line":"]"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"from alembic import op"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9nJs%3D","line":38,"updated":"2014-02-05 17:21:42.000000000","message":"I wonder why this migration is related to ODL MD patch.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    \u0027neutron.plugins.nicira.NeutronPlugin.NvpPluginV2\u0027,"},{"line_number":36,"context_line":"    \u0027neutron.plugins.nec.nec_plugin.NECPluginV2\u0027,"},{"line_number":37,"context_line":"    \u0027neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2\u0027,"},{"line_number":38,"context_line":"    \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027,"},{"line_number":39,"context_line":"]"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"from alembic import op"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F6CY%3D","line":38,"in_reply_to":"AAAAUH%2F9nJs%3D","updated":"2014-02-10 16:50:58.000000000","message":"At one point in development, these were required, but both were likely taken care of during another migration fix. Either way, I have deleted them now and things still work.","commit_id":"06990aec961733063109f4528b925df1504b109f"}],"neutron/db/migration/alembic_migrations/versions/511471cc46b_agent_ext_model_supp.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    \u0027neutron.plugins.nec.nec_plugin.NECPluginV2\u0027,"},{"line_number":37,"context_line":"    \u0027neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2\u0027,"},{"line_number":38,"context_line":"    \u0027neutron.services.loadbalancer.plugin.LoadBalancerPlugin\u0027,"},{"line_number":39,"context_line":"    \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027,"},{"line_number":40,"context_line":"]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"from alembic import op"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vPk%3D","line":39,"updated":"2014-02-04 14:33:34.000000000","message":"Same comment as the previous db migration.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1a0372421872077ee87036cadcccf2af12479f4a","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    \u0027neutron.plugins.nec.nec_plugin.NECPluginV2\u0027,"},{"line_number":37,"context_line":"    \u0027neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2\u0027,"},{"line_number":38,"context_line":"    \u0027neutron.services.loadbalancer.plugin.LoadBalancerPlugin\u0027,"},{"line_number":39,"context_line":"    \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027,"},{"line_number":40,"context_line":"]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"from alembic import op"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9nJk%3D","line":39,"updated":"2014-02-05 17:21:42.000000000","message":"The same comment as the previous migration script.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    \u0027neutron.plugins.nec.nec_plugin.NECPluginV2\u0027,"},{"line_number":37,"context_line":"    \u0027neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2\u0027,"},{"line_number":38,"context_line":"    \u0027neutron.services.loadbalancer.plugin.LoadBalancerPlugin\u0027,"},{"line_number":39,"context_line":"    \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027,"},{"line_number":40,"context_line":"]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"from alembic import op"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F6CU%3D","line":39,"in_reply_to":"AAAAUH%2F9nJk%3D","updated":"2014-02-10 16:50:58.000000000","message":"Same comment as previous migration.","commit_id":"06990aec961733063109f4528b925df1504b109f"}],"neutron/plugins/ml2/drivers/README.odl":[{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"29f1fd5b2e8c34ef11a625133f521f21eb2c8eff","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"How to use the OpenDaylight ML2 MechanismDriver"},{"line_number":21,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":22,"context_line":"To use the ML2 MechanismDriver, you need to ensure you have the it configured"},{"line_number":23,"context_line":"as one of the \"mechanism_drivers\" in ML2:"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    mechanism_drivers\u003dopendaylight"}],"source_content_type":"application/octet-stream","patch_set":15,"id":"AAAAVn%2F%2F5cw%3D","line":22,"updated":"2014-03-03 15:59:17.000000000","message":"Typo: \"the it\"-\u003e\"it\"","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"9422f01e8fe723300e1a19acc97321aeb4873524","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"How to use the OpenDaylight ML2 MechanismDriver"},{"line_number":21,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":22,"context_line":"To use the ML2 MechanismDriver, you need to ensure you have the it configured"},{"line_number":23,"context_line":"as one of the \"mechanism_drivers\" in ML2:"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    mechanism_drivers\u003dopendaylight"}],"source_content_type":"application/octet-stream","patch_set":15,"id":"AAAAVn%2F%2Fr7w%3D","line":22,"in_reply_to":"AAAAVn%2F%2F5cw%3D","updated":"2014-03-04 17:35:12.000000000","message":"Done","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"}],"neutron/plugins/ml2/drivers/mechanism_odl.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        jsessionid \u003d r.cookies.get(\u0027JSESSIONID\u0027)"},{"line_number":70,"context_line":"        jsessionidsso \u003d r.cookies.get(\u0027JSESSIONIDSSO\u0027)"},{"line_number":71,"context_line":"        if jsessionid and jsessionidsso:"},{"line_number":72,"context_line":"            self.auth_cookies \u003d dict(JSESSIONID\u003djsessionid,"},{"line_number":73,"context_line":"                                     JSESSIONIDSSO\u003djsessionidsso)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def check_expiry(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLac%3D","line":72,"updated":"2014-01-29 12:38:13.000000000","message":"if auth cookies  are obtained, should self.expired be set to False?","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"bb17f7e04475019da0326a58b57ba278b2e16470","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        jsessionid \u003d r.cookies.get(\u0027JSESSIONID\u0027)"},{"line_number":70,"context_line":"        jsessionidsso \u003d r.cookies.get(\u0027JSESSIONIDSSO\u0027)"},{"line_number":71,"context_line":"        if jsessionid and jsessionidsso:"},{"line_number":72,"context_line":"            self.auth_cookies \u003d dict(JSESSIONID\u003djsessionid,"},{"line_number":73,"context_line":"                                     JSESSIONIDSSO\u003djsessionidsso)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def check_expiry(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F97rE%3D","line":72,"in_reply_to":"AAAAUH%2F%2BLac%3D","updated":"2014-01-31 23:05:14.000000000","message":"I don\u0027t think so, because the __call__ method will be called each time self.auth is accessed, thus ensuring self.expired is set.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def check_expiry(self):"},{"line_number":76,"context_line":"        if not self.last_request:"},{"line_number":77,"context_line":"            return True"},{"line_number":78,"context_line":"        # The cookies are good for the whole session"},{"line_number":79,"context_line":"        # Session timeout in Tomcat is about 30 mins..."},{"line_number":80,"context_line":"        delta \u003d datetime.datetime.utcnow() - self.last_request"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLb8%3D","line":77,"updated":"2014-01-29 12:38:13.000000000","message":"Do you mean to do:\n    self.expired \u003d True\n    return","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"bb17f7e04475019da0326a58b57ba278b2e16470","unresolved":false,"context_lines":[{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def check_expiry(self):"},{"line_number":76,"context_line":"        if not self.last_request:"},{"line_number":77,"context_line":"            return True"},{"line_number":78,"context_line":"        # The cookies are good for the whole session"},{"line_number":79,"context_line":"        # Session timeout in Tomcat is about 30 mins..."},{"line_number":80,"context_line":"        delta \u003d datetime.datetime.utcnow() - self.last_request"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F977s%3D","line":77,"in_reply_to":"AAAAUH%2F%2BLb8%3D","updated":"2014-01-31 23:05:14.000000000","message":"Yes, nice catch!","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def __call__(self, r):"},{"line_number":87,"context_line":"        self.check_expiry()"},{"line_number":88,"context_line":"        if self.auth_cookies is None or self.expired:"},{"line_number":89,"context_line":"            self.obtain_auth_cookies()"},{"line_number":90,"context_line":"        self.last_request \u003d datetime.datetime.utcnow()"},{"line_number":91,"context_line":"        r.prepare_cookies(self.auth_cookies)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLW0%3D","line":88,"updated":"2014-01-29 12:38:13.000000000","message":"if set self.expired in check_expiry() when first request and clear when get token, then this if clause could just check for self.expired.\n\nAlternately, you could have check_expiry() return T/F and eliminate the self.expired flag,altogether (unless it i needed elsewhere). Maybe change check_expiry() to is_expired() in that case.\n\nif not self.auth_cookies or self.is_expired():\n    self.obtain_auth_cookies()","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"bb17f7e04475019da0326a58b57ba278b2e16470","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def __call__(self, r):"},{"line_number":87,"context_line":"        self.check_expiry()"},{"line_number":88,"context_line":"        if self.auth_cookies is None or self.expired:"},{"line_number":89,"context_line":"            self.obtain_auth_cookies()"},{"line_number":90,"context_line":"        self.last_request \u003d datetime.datetime.utcnow()"},{"line_number":91,"context_line":"        r.prepare_cookies(self.auth_cookies)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F977U%3D","line":88,"in_reply_to":"AAAAUH%2F%2BLW0%3D","updated":"2014-01-31 23:05:14.000000000","message":"Done.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def __call__(self, r):"},{"line_number":87,"context_line":"        self.check_expiry()"},{"line_number":88,"context_line":"        if self.auth_cookies is None or self.expired:"},{"line_number":89,"context_line":"            self.obtain_auth_cookies()"},{"line_number":90,"context_line":"        self.last_request \u003d datetime.datetime.utcnow()"},{"line_number":91,"context_line":"        r.prepare_cookies(self.auth_cookies)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9voQ%3D","line":88,"in_reply_to":"AAAAUH%2F977U%3D","updated":"2014-02-04 14:33:34.000000000","message":"I prefer the latter option Paul suggested.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    but the general concepts are the same."},{"line_number":102,"context_line":"    \"\"\""},{"line_number":103,"context_line":"    auth \u003d None"},{"line_number":104,"context_line":"    out_of_sync \u003d True"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def initialize(self):"},{"line_number":107,"context_line":"        self.url \u003d cfg.CONF.ml2_odl.url"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vkw%3D","line":104,"updated":"2014-02-04 14:33:34.000000000","message":"Is there any reason it is initialized in initialize() method below? self.out_of_sync changes depending on the connection status, so an instance variable looks better rather than a class variable.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        else:"},{"line_number":149,"context_line":"            self.sync_object(operation, object_type, context)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def sync_full(self, context):"},{"line_number":152,"context_line":"        \"\"\"Resync the entire database to ODL."},{"line_number":153,"context_line":"        Transition to the in-sync state on success."},{"line_number":154,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vhc%3D","line":151,"updated":"2014-02-04 14:33:34.000000000","message":"sync_full is very high-cost operation and it takes time. Assume that self.out_of_sync is false and another API call comes while sync_full is being processed. We will have two sync_full method are running in parallel. How about running one sync_full operation at the same time?\n\nEven if the second API call wait for the completion of sync_full from the first API call, the response time of the second API call does not change and we can reduce the number of API call to ODL.\n\nThis solution does not help us if we use multiple-worker mode, but at least it helps us as long as we use single-worker (the current default mode).","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def sync_full(self, context):"},{"line_number":152,"context_line":"        \"\"\"Resync the entire database to ODL."},{"line_number":153,"context_line":"        Transition to the in-sync state on success."},{"line_number":154,"context_line":"        \"\"\""},{"line_number":155,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":156,"context_line":"        networks \u003d context._plugin.get_networks(dbcontext)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLWI%3D","line":153,"updated":"2014-01-29 12:38:13.000000000","message":"Nit: PEP 257, blank line between summary line and rest of docstring.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"bb17f7e04475019da0326a58b57ba278b2e16470","unresolved":false,"context_lines":[{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def sync_full(self, context):"},{"line_number":152,"context_line":"        \"\"\"Resync the entire database to ODL."},{"line_number":153,"context_line":"        Transition to the in-sync state on success."},{"line_number":154,"context_line":"        \"\"\""},{"line_number":155,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":156,"context_line":"        networks \u003d context._plugin.get_networks(dbcontext)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F97rA%3D","line":153,"in_reply_to":"AAAAUH%2F%2BLWI%3D","updated":"2014-01-31 23:05:14.000000000","message":"Done","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":168,"context_line":"                        if d in network:"},{"line_number":169,"context_line":"                            try:"},{"line_number":170,"context_line":"                                del network[d]"},{"line_number":171,"context_line":"                            except KeyError:"},{"line_number":172,"context_line":"                                pass"},{"line_number":173,"context_line":"                    nets.append(network)"},{"line_number":174,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLTU%3D","line":171,"updated":"2014-01-29 12:38:13.000000000","message":"Maybe I\u0027m having a brain fart, but if d is in network (L168) how would you get a KeyError?\n\nInstead of L167-173 could do:\n\n    trimmed_network \u003d dict((k,v) for k,v in network.iteritems() if k not in (\u0027status\u0027, \u0027subnets\u0027))\n    nets.append(trimmed_network)","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"bb17f7e04475019da0326a58b57ba278b2e16470","unresolved":false,"context_lines":[{"line_number":168,"context_line":"                        if d in network:"},{"line_number":169,"context_line":"                            try:"},{"line_number":170,"context_line":"                                del network[d]"},{"line_number":171,"context_line":"                            except KeyError:"},{"line_number":172,"context_line":"                                pass"},{"line_number":173,"context_line":"                    nets.append(network)"},{"line_number":174,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F97qU%3D","line":171,"in_reply_to":"AAAAUH%2F%2BLTU%3D","updated":"2014-01-31 23:05:14.000000000","message":"What I noticed was that when launching 50 VMs at the same time, I was hitting key errors here, likely because multiple threads were working on this at the same time. I think your sample code would hit the same problem. I looked at dict.pop(), but it has a huge performance penalty.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":168,"context_line":"                        if d in network:"},{"line_number":169,"context_line":"                            try:"},{"line_number":170,"context_line":"                                del network[d]"},{"line_number":171,"context_line":"                            except KeyError:"},{"line_number":172,"context_line":"                                pass"},{"line_number":173,"context_line":"                    nets.append(network)"},{"line_number":174,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vd8%3D","line":171,"in_reply_to":"AAAAUH%2F91r4%3D","updated":"2014-02-04 14:33:34.000000000","message":"IMO, it is better that removing status and subnets from a network dict is moved after this for-loop. This for-loop invokes socket call and it leads to eventlet thread switch. If we move it after for-loop around L.175, I think we can avoid eventlet thread loop.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"8c90b7320aa381d62de0a25a21447cc1b1aafc46","unresolved":false,"context_lines":[{"line_number":168,"context_line":"                        if d in network:"},{"line_number":169,"context_line":"                            try:"},{"line_number":170,"context_line":"                                del network[d]"},{"line_number":171,"context_line":"                            except KeyError:"},{"line_number":172,"context_line":"                                pass"},{"line_number":173,"context_line":"                    nets.append(network)"},{"line_number":174,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F91r4%3D","line":171,"in_reply_to":"AAAAUH%2F97qU%3D","updated":"2014-02-03 13:18:33.000000000","message":"My concern was with modifying network (L170), while looping through it (L167) and was wondering if deleting elements from a dict while traversing was the issue - hence the suggestion of making a temp variable vs modifying in place.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                    nets.append(network)"},{"line_number":174,"context_line":"                continue"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        if len(nets) \u003e 1:"},{"line_number":177,"context_line":"            try:"},{"line_number":178,"context_line":"                self.sendjson(\u0027post\u0027, \u0027networks\u0027, {\u0027networks\u0027: nets})"},{"line_number":179,"context_line":"            except requests.exceptions.HTTPError as e:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLTA%3D","line":176,"updated":"2014-01-29 12:38:13.000000000","message":"It looks like the actions taken for len\u003e1 and len\u003d1 are the same? Combine?","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"bb17f7e04475019da0326a58b57ba278b2e16470","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                    nets.append(network)"},{"line_number":174,"context_line":"                continue"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        if len(nets) \u003e 1:"},{"line_number":177,"context_line":"            try:"},{"line_number":178,"context_line":"                self.sendjson(\u0027post\u0027, \u0027networks\u0027, {\u0027networks\u0027: nets})"},{"line_number":179,"context_line":"            except requests.exceptions.HTTPError as e:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F97qI%3D","line":176,"in_reply_to":"AAAAUH%2F%2BLTA%3D","updated":"2014-01-31 23:05:14.000000000","message":"One subtle difference is \"networks\" vs. \"network\" for the data to sendjson().","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                    nets.append(network)"},{"line_number":174,"context_line":"                continue"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        if len(nets) \u003e 1:"},{"line_number":177,"context_line":"            try:"},{"line_number":178,"context_line":"                self.sendjson(\u0027post\u0027, \u0027networks\u0027, {\u0027networks\u0027: nets})"},{"line_number":179,"context_line":"            except requests.exceptions.HTTPError as e:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vdA%3D","line":176,"in_reply_to":"AAAAUH%2F91rk%3D","updated":"2014-02-04 14:33:34.000000000","message":"How about the following logic? I don\u0027t see any reason of copy-and-paste :-)\n\n  if len(nets) \u003e 1:\n    resource_name \u003d \u0027networks\u0027\n  else:\n    resource_name \u003d \u0027network\u0027\n  self.sendjson(\u0027post\u0027, \u0027networks\u0027, {resource_name: nets})","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"8c90b7320aa381d62de0a25a21447cc1b1aafc46","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                    nets.append(network)"},{"line_number":174,"context_line":"                continue"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        if len(nets) \u003e 1:"},{"line_number":177,"context_line":"            try:"},{"line_number":178,"context_line":"                self.sendjson(\u0027post\u0027, \u0027networks\u0027, {\u0027networks\u0027: nets})"},{"line_number":179,"context_line":"            except requests.exceptions.HTTPError as e:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F91rk%3D","line":176,"in_reply_to":"AAAAUH%2F97qI%3D","updated":"2014-02-03 13:18:33.000000000","message":"Ah missed that!","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                self.sendjson(\u0027post\u0027, \u0027networks\u0027, {\u0027networks\u0027: nets})"},{"line_number":179,"context_line":"            except requests.exceptions.HTTPError as e:"},{"line_number":180,"context_line":"                if e.response.status_code \u003d\u003d 400:"},{"line_number":181,"context_line":"                    # Ignore 400 errors"},{"line_number":182,"context_line":"                    pass"},{"line_number":183,"context_line":"        elif len(nets) \u003d\u003d 1:"},{"line_number":184,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vcc%3D","line":181,"updated":"2014-02-04 14:33:34.000000000","message":"Why do you need to ignore 400?","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"989897b04af3a2054edfed5213680261f658775a","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            try:"},{"line_number":185,"context_line":"                self.sendjson(\u0027post\u0027, \u0027networks\u0027, {\u0027network\u0027: nets})"},{"line_number":186,"context_line":"            except requests.exceptions.HTTPError as e:"},{"line_number":187,"context_line":"                if e.response.status_code \u003d\u003d 400:"},{"line_number":188,"context_line":"                    # Ignore 400 errors"},{"line_number":189,"context_line":"                    pass"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BKBg%3D","line":187,"updated":"2014-01-29 16:19:34.000000000","message":"instead of repeating of this logic, helper function should be introduced lie sendjson_ignore400","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"bb17f7e04475019da0326a58b57ba278b2e16470","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            try:"},{"line_number":185,"context_line":"                self.sendjson(\u0027post\u0027, \u0027networks\u0027, {\u0027network\u0027: nets})"},{"line_number":186,"context_line":"            except requests.exceptions.HTTPError as e:"},{"line_number":187,"context_line":"                if e.response.status_code \u003d\u003d 400:"},{"line_number":188,"context_line":"                    # Ignore 400 errors"},{"line_number":189,"context_line":"                    pass"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F97pw%3D","line":187,"in_reply_to":"AAAAUH%2F%2BKBg%3D","updated":"2014-01-31 23:05:14.000000000","message":"Good idea! I\u0027ll add a flag to sendjson() which will allow the caller to ignore 400 errors instead.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                if e.response.status_code \u003d\u003d 400:"},{"line_number":188,"context_line":"                    # Ignore 400 errors"},{"line_number":189,"context_line":"                    pass"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        snets \u003d []"},{"line_number":192,"context_line":"        for subnet in subnets:"},{"line_number":193,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vbk%3D","line":190,"updated":"2014-02-04 14:33:34.000000000","message":"The logic for network, subnet and port are very similar. The only difference is how a dict is modified. I prefer to have common methods to check existing resources and to post non-existing resources.\n\n  - check existing resources\n  - update resource dicts to create\n  - create non-existing resources","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                    snets.append(subnet)"},{"line_number":199,"context_line":"                continue"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if len(snets) \u003e 1:"},{"line_number":202,"context_line":"            try:"},{"line_number":203,"context_line":"                self.sendjson(\u0027post\u0027, \u0027subnets\u0027, {\u0027subnets\u0027: snets})"},{"line_number":204,"context_line":"            except requests.exceptions.HTTPError as e:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLS4%3D","line":201,"updated":"2014-01-29 12:38:13.000000000","message":"Ditto for subnetst","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"989897b04af3a2054edfed5213680261f658775a","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                    snets.append(subnet)"},{"line_number":199,"context_line":"                continue"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if len(snets) \u003e 1:"},{"line_number":202,"context_line":"            try:"},{"line_number":203,"context_line":"                self.sendjson(\u0027post\u0027, \u0027subnets\u0027, {\u0027subnets\u0027: snets})"},{"line_number":204,"context_line":"            except requests.exceptions.HTTPError as e:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BKCo%3D","line":201,"updated":"2014-01-29 16:19:34.000000000","message":"probaly something like this\nkey \u003d \u0027subnet\u0027 if len \u003d\u003d 1 else \u0027subnets\u0027\nself.sendjson(post, key, {key: snets})\n\nSimilar below","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"bb17f7e04475019da0326a58b57ba278b2e16470","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                    snets.append(subnet)"},{"line_number":199,"context_line":"                continue"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if len(snets) \u003e 1:"},{"line_number":202,"context_line":"            try:"},{"line_number":203,"context_line":"                self.sendjson(\u0027post\u0027, \u0027subnets\u0027, {\u0027subnets\u0027: snets})"},{"line_number":204,"context_line":"            except requests.exceptions.HTTPError as e:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F97n4%3D","line":201,"in_reply_to":"AAAAUH%2F%2BKCo%3D","updated":"2014-01-31 23:05:14.000000000","message":"This is a great idea, and I have incorporated it into the new version.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"989897b04af3a2054edfed5213680261f658775a","unresolved":false,"context_lines":[{"line_number":223,"context_line":"                    self.add_security_groups(context, dbcontext, port)"},{"line_number":224,"context_line":"                    # TODO(kmestery): Converting to uppercase due to ODL bug"},{"line_number":225,"context_line":"                    port[\u0027mac_address\u0027] \u003d port[\u0027mac_address\u0027].upper()"},{"line_number":226,"context_line":"                    if \u0027status\u0027 in port:"},{"line_number":227,"context_line":"                        try:"},{"line_number":228,"context_line":"                            del port[\u0027status\u0027]"},{"line_number":229,"context_line":"                        except KeyError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BKBM%3D","line":226,"updated":"2014-01-29 16:19:34.000000000","message":"port.pop(\u0027status\u0027, None)","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"bb17f7e04475019da0326a58b57ba278b2e16470","unresolved":false,"context_lines":[{"line_number":223,"context_line":"                    self.add_security_groups(context, dbcontext, port)"},{"line_number":224,"context_line":"                    # TODO(kmestery): Converting to uppercase due to ODL bug"},{"line_number":225,"context_line":"                    port[\u0027mac_address\u0027] \u003d port[\u0027mac_address\u0027].upper()"},{"line_number":226,"context_line":"                    if \u0027status\u0027 in port:"},{"line_number":227,"context_line":"                        try:"},{"line_number":228,"context_line":"                            del port[\u0027status\u0027]"},{"line_number":229,"context_line":"                        except KeyError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F97nY%3D","line":226,"in_reply_to":"AAAAUH%2F%2BKBM%3D","updated":"2014-01-31 23:05:14.000000000","message":"I thought about this, but pop() is very slow, and could still lead to the KEyError exception if I\u0027m not mistaken.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":231,"context_line":"                    pports.append(port)"},{"line_number":232,"context_line":"                continue"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        if len(pports) \u003e 1:"},{"line_number":235,"context_line":"            try:"},{"line_number":236,"context_line":"                self.sendjson(\u0027post\u0027, \u0027ports\u0027, {\u0027ports\u0027: pports})"},{"line_number":237,"context_line":"            except requests.exceptions.HTTPError as e:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLSY%3D","line":234,"updated":"2014-01-29 12:38:13.000000000","message":"ditto. Also, could all three cases be put in a helper function that is passed the resource and dict?","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":251,"context_line":"        \"\"\"Synchronize the single modified record to ODL."},{"line_number":252,"context_line":"        \"\"\""},{"line_number":253,"context_line":"        self.out_of_sync \u003d True"},{"line_number":254,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":255,"context_line":"        id \u003d context.current[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vas%3D","line":252,"updated":"2014-02-04 14:33:34.000000000","message":"One line docstring is better in this case.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":250,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":251,"context_line":"        \"\"\"Synchronize the single modified record to ODL."},{"line_number":252,"context_line":"        \"\"\""},{"line_number":253,"context_line":"        self.out_of_sync \u003d True"},{"line_number":254,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":255,"context_line":"        id \u003d context.current[\u0027id\u0027]"},{"line_number":256,"context_line":"        if operation \u003d\u003d \u0027delete\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vZY%3D","line":253,"updated":"2014-02-04 14:33:34.000000000","message":"I think it is not a good idea to set out_of_sync to True here. If it is set to True, another API call will trigger full_sync.\n\nI understand it is to make out_of_sync True when an exception occurs, but I think setting out_of_sync to True should be done in an error handling logic.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":252,"context_line":"        \"\"\""},{"line_number":253,"context_line":"        self.out_of_sync \u003d True"},{"line_number":254,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":255,"context_line":"        id \u003d context.current[\u0027id\u0027]"},{"line_number":256,"context_line":"        if operation \u003d\u003d \u0027delete\u0027:"},{"line_number":257,"context_line":"            urlpath \u003d object_type + \u0027/\u0027 + id"},{"line_number":258,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLQ4%3D","line":255,"updated":"2014-01-29 12:38:13.000000000","message":"Thoughout file, may want to use different name than id to be more descriptive and to differ from built-in id() function.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"bb17f7e04475019da0326a58b57ba278b2e16470","unresolved":false,"context_lines":[{"line_number":252,"context_line":"        \"\"\""},{"line_number":253,"context_line":"        self.out_of_sync \u003d True"},{"line_number":254,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":255,"context_line":"        id \u003d context.current[\u0027id\u0027]"},{"line_number":256,"context_line":"        if operation \u003d\u003d \u0027delete\u0027:"},{"line_number":257,"context_line":"            urlpath \u003d object_type + \u0027/\u0027 + id"},{"line_number":258,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F97nM%3D","line":255,"in_reply_to":"AAAAUH%2F%2BLQ4%3D","updated":"2014-01-31 23:05:14.000000000","message":"Done","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":260,"context_line":"            except requests.exceptions.HTTPError as e:"},{"line_number":261,"context_line":"                if e.response.status_code \u003d\u003d 400:"},{"line_number":262,"context_line":"                    # Ignore 400 errors"},{"line_number":263,"context_line":"                    pass"},{"line_number":264,"context_line":"        else:"},{"line_number":265,"context_line":"            assert operation \u003d\u003d \u0027create\u0027 or operation \u003d\u003d \u0027update\u0027"},{"line_number":266,"context_line":"            if operation \u003d\u003d \u0027create\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vRo%3D","line":263,"updated":"2014-02-04 14:33:34.000000000","message":"This logic actually ignore all exceptions. If we need to raise an exception for other errors, we need to re-raise. If so, it is better to use openstack.common.excutils.save_and_reraise_exception because it is executed in an eventlet thread.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":262,"context_line":"                    # Ignore 400 errors"},{"line_number":263,"context_line":"                    pass"},{"line_number":264,"context_line":"        else:"},{"line_number":265,"context_line":"            assert operation \u003d\u003d \u0027create\u0027 or operation \u003d\u003d \u0027update\u0027"},{"line_number":266,"context_line":"            if operation \u003d\u003d \u0027create\u0027:"},{"line_number":267,"context_line":"                urlpath \u003d object_type"},{"line_number":268,"context_line":"                method \u003d \u0027post\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLR0%3D","line":265,"updated":"2014-01-29 12:38:13.000000000","message":"Do you want an assert here or a test and log?\n\nCould do operation in (\u0027create\u0027, \u0027update\u0027)","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"bb17f7e04475019da0326a58b57ba278b2e16470","unresolved":false,"context_lines":[{"line_number":262,"context_line":"                    # Ignore 400 errors"},{"line_number":263,"context_line":"                    pass"},{"line_number":264,"context_line":"        else:"},{"line_number":265,"context_line":"            assert operation \u003d\u003d \u0027create\u0027 or operation \u003d\u003d \u0027update\u0027"},{"line_number":266,"context_line":"            if operation \u003d\u003d \u0027create\u0027:"},{"line_number":267,"context_line":"                urlpath \u003d object_type"},{"line_number":268,"context_line":"                method \u003d \u0027post\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F97mQ%3D","line":265,"in_reply_to":"AAAAUH%2F%2BLR0%3D","updated":"2014-01-31 23:05:14.000000000","message":"I think the assert is fine, but let me know if you want this changed.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":262,"context_line":"                    # Ignore 400 errors"},{"line_number":263,"context_line":"                    pass"},{"line_number":264,"context_line":"        else:"},{"line_number":265,"context_line":"            assert operation \u003d\u003d \u0027create\u0027 or operation \u003d\u003d \u0027update\u0027"},{"line_number":266,"context_line":"            if operation \u003d\u003d \u0027create\u0027:"},{"line_number":267,"context_line":"                urlpath \u003d object_type"},{"line_number":268,"context_line":"                method \u003d \u0027post\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vYE%3D","line":265,"in_reply_to":"AAAAUH%2F91q0%3D","updated":"2014-02-04 14:33:34.000000000","message":"An alternative is:\n\n  if operation \u003d\u003d \u0027delete\u0027:\n      ...\n  elif operation in (\u0027create\u0027, \u0027update\u0027):\n      ...\n  else:\n      LOG.error(\u0027unexpected operation\u0027)","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"8c90b7320aa381d62de0a25a21447cc1b1aafc46","unresolved":false,"context_lines":[{"line_number":262,"context_line":"                    # Ignore 400 errors"},{"line_number":263,"context_line":"                    pass"},{"line_number":264,"context_line":"        else:"},{"line_number":265,"context_line":"            assert operation \u003d\u003d \u0027create\u0027 or operation \u003d\u003d \u0027update\u0027"},{"line_number":266,"context_line":"            if operation \u003d\u003d \u0027create\u0027:"},{"line_number":267,"context_line":"                urlpath \u003d object_type"},{"line_number":268,"context_line":"                method \u003d \u0027post\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F91q0%3D","line":265,"in_reply_to":"AAAAUH%2F97mQ%3D","updated":"2014-02-03 13:18:33.000000000","message":"Sounds like just defensive code for programming errors so fine.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":273,"context_line":"                try:"},{"line_number":274,"context_line":"                    network \u003d context._plugin.get_network(dbcontext, id)"},{"line_number":275,"context_line":"                except n_exc.NetworkNotFound:"},{"line_number":276,"context_line":"                    LOG.debug(_(\u0027Network not found (%d)\u0027) % id)"},{"line_number":277,"context_line":"                else:"},{"line_number":278,"context_line":"                    # Remove the following for update calls"},{"line_number":279,"context_line":"                    if operation \u003d\u003d \u0027update\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vWU%3D","line":276,"updated":"2014-02-04 14:33:34.000000000","message":"When is NotFound exception raised? A case where net-update and net-delete are running in parallel hits this case?","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                            if d in network:"},{"line_number":282,"context_line":"                                try:"},{"line_number":283,"context_line":"                                    del network[d]"},{"line_number":284,"context_line":"                                except KeyError:"},{"line_number":285,"context_line":"                                    pass"},{"line_number":286,"context_line":"                    elif operation \u003d\u003d \u0027create\u0027:"},{"line_number":287,"context_line":"                        for d in [\u0027status\u0027, \u0027subnets\u0027]:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLQI%3D","line":284,"updated":"2014-01-29 12:38:13.000000000","message":"Similar comments on KeyError, tuple vs ist, here and following uses.  Maybe a helper function could be used to remove keys from a dict in all these places?","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                            if d in network:"},{"line_number":282,"context_line":"                                try:"},{"line_number":283,"context_line":"                                    del network[d]"},{"line_number":284,"context_line":"                                except KeyError:"},{"line_number":285,"context_line":"                                    pass"},{"line_number":286,"context_line":"                    elif operation \u003d\u003d \u0027create\u0027:"},{"line_number":287,"context_line":"                        for d in [\u0027status\u0027, \u0027subnets\u0027]:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vXU%3D","line":284,"in_reply_to":"AAAAUH%2F%2BLQI%3D","updated":"2014-02-04 14:33:34.000000000","message":"+1 for helper function.\n\nI still wonder why KeyError occurs here.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":318,"context_line":"                            # Ignore 400 errors"},{"line_number":319,"context_line":"                            pass"},{"line_number":320,"context_line":"            else:"},{"line_number":321,"context_line":"                assert object_type \u003d\u003d \u0027ports\u0027"},{"line_number":322,"context_line":"                try:"},{"line_number":323,"context_line":"                    port \u003d context._plugin.get_port(dbcontext, id)"},{"line_number":324,"context_line":"                    self.add_security_groups(context, dbcontext, port)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLQA%3D","line":321,"updated":"2014-01-29 12:38:13.000000000","message":"if and log vs assert?","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":353,"context_line":"    def add_security_groups(self, context, dbcontext, port):"},{"line_number":354,"context_line":"        \"\"\"Populate the \u0027security_groups\u0027 field with entire records.\"\"\""},{"line_number":355,"context_line":"        groups \u003d [context._plugin.get_security_group(dbcontext, sg)"},{"line_number":356,"context_line":"                  for sg in port[\u0027security_groups\u0027]]"},{"line_number":357,"context_line":"        port[\u0027security_groups\u0027] \u003d groups"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"    def sendjson(self, method, urlpath, obj):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vVs%3D","line":356,"updated":"2014-02-04 14:33:34.000000000","message":"I think we need to wrap it with try-except. Security group may be deleted here.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":390,"context_line":"                          {\u0027id\u0027: segment[api.ID],"},{"line_number":391,"context_line":"                           \u0027seg\u0027: segment[api.SEGMENTATION_ID],"},{"line_number":392,"context_line":"                           \u0027physnet\u0027: segment[api.PHYSICAL_NETWORK],"},{"line_number":393,"context_line":"                           \u0027nettype\u0027: segment[api.NETWORK_TYPE]})"},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"    def validate_port_binding(self, context):"},{"line_number":396,"context_line":"        if self.check_segment(context.bound_segment):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vno%3D","line":393,"updated":"2014-02-04 14:33:34.000000000","message":"Don\u0027t we need to raise an error here? A user cannot know his/her request is invalid.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":403,"context_line":"        LOG.debug(_(\"Unbinding port %(port)s on \""},{"line_number":404,"context_line":"                    \"network %(network)s\"),"},{"line_number":405,"context_line":"                  {\u0027port\u0027: context.current[\u0027id\u0027],"},{"line_number":406,"context_line":"                   \u0027network\u0027: context.network.current[\u0027id\u0027]})"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    def check_segment(self, segment):"},{"line_number":409,"context_line":"        \"\"\"Verify a segment is valid for the OpenDaylight MechanismDriver"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vQ0%3D","line":406,"updated":"2014-02-04 14:33:34.000000000","message":"Is no actual operation needed here? (just a confirmation)","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":414,"context_line":"        network_type \u003d segment[api.NETWORK_TYPE]"},{"line_number":415,"context_line":"        if network_type in [constants.TYPE_LOCAL, constants.TYPE_FLAT,"},{"line_number":416,"context_line":"                            constants.TYPE_GRE, constants.TYPE_VXLAN]:"},{"line_number":417,"context_line":"            #TODO(mestery): Validate these"},{"line_number":418,"context_line":"            return True"},{"line_number":419,"context_line":"        else:"},{"line_number":420,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vQQ%3D","line":417,"updated":"2014-02-04 14:33:34.000000000","message":"question: is this a temporary logic?","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c5dcf7de02ee498a55adef265170d8001feac452","unresolved":false,"context_lines":[{"line_number":38,"context_line":"               help\u003d_(\"HTTP password for authentication\")),"},{"line_number":39,"context_line":"    cfg.IntOpt(\u0027timeout\u0027, default\u003d10,"},{"line_number":40,"context_line":"               help\u003d_(\"HTTP timeout in seconds.\")),"},{"line_number":41,"context_line":"    cfg.IntOpt(\u0027session_timeout\u0027, default\u003d30,"},{"line_number":42,"context_line":"               help\u003d_(\"Tomcat session timeout in minutes.\")),"},{"line_number":43,"context_line":"]"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9pUA%3D","line":41,"updated":"2014-02-05 12:00:41.000000000","message":"Should session_timeout be configurable via config file?","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":38,"context_line":"               help\u003d_(\"HTTP password for authentication\")),"},{"line_number":39,"context_line":"    cfg.IntOpt(\u0027timeout\u0027, default\u003d10,"},{"line_number":40,"context_line":"               help\u003d_(\"HTTP timeout in seconds.\")),"},{"line_number":41,"context_line":"    cfg.IntOpt(\u0027session_timeout\u0027, default\u003d30,"},{"line_number":42,"context_line":"               help\u003d_(\"Tomcat session timeout in minutes.\")),"},{"line_number":43,"context_line":"]"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0sc%3D","line":41,"in_reply_to":"AAAAUH%2F9pUA%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    set of cookies are obtained."},{"line_number":54,"context_line":"    \"\"\""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def __init__(self, url, username, password):"},{"line_number":57,"context_line":"        self.url \u003d str(url) + \u0027/networks\u0027"},{"line_number":58,"context_line":"        self.username \u003d username"},{"line_number":59,"context_line":"        self.password \u003d password"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mb0%3D","line":56,"updated":"2014-02-05 18:55:14.000000000","message":"Need docstring","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    set of cookies are obtained."},{"line_number":54,"context_line":"    \"\"\""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def __init__(self, url, username, password):"},{"line_number":57,"context_line":"        self.url \u003d str(url) + \u0027/networks\u0027"},{"line_number":58,"context_line":"        self.username \u003d username"},{"line_number":59,"context_line":"        self.password \u003d password"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0ek%3D","line":56,"in_reply_to":"AAAAUH%2F9mb0%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    \"\"\""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def __init__(self, url, username, password):"},{"line_number":57,"context_line":"        self.url \u003d str(url) + \u0027/networks\u0027"},{"line_number":58,"context_line":"        self.username \u003d username"},{"line_number":59,"context_line":"        self.password \u003d password"},{"line_number":60,"context_line":"        self.auth_cookies \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mlA%3D","line":57,"updated":"2014-02-05 18:55:14.000000000","message":"Might be better to make these strings constants.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    \"\"\""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def __init__(self, url, username, password):"},{"line_number":57,"context_line":"        self.url \u003d str(url) + \u0027/networks\u0027"},{"line_number":58,"context_line":"        self.username \u003d username"},{"line_number":59,"context_line":"        self.password \u003d password"},{"line_number":60,"context_line":"        self.auth_cookies \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0eo%3D","line":57,"in_reply_to":"AAAAUH%2F9mlA%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self.expired \u003d None"},{"line_number":63,"context_line":"        self.session_timeout \u003d cfg.CONF.ml2_odl.session_timeout"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def obtain_auth_cookies(self):"},{"line_number":66,"context_line":"        url \u003d self.url"},{"line_number":67,"context_line":"        r \u003d requests.get(url, auth\u003d(self.username, self.password))"},{"line_number":68,"context_line":"        r.raise_for_status()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mbw%3D","line":65,"updated":"2014-02-05 18:55:14.000000000","message":"Need docstring","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self.expired \u003d None"},{"line_number":63,"context_line":"        self.session_timeout \u003d cfg.CONF.ml2_odl.session_timeout"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def obtain_auth_cookies(self):"},{"line_number":66,"context_line":"        url \u003d self.url"},{"line_number":67,"context_line":"        r \u003d requests.get(url, auth\u003d(self.username, self.password))"},{"line_number":68,"context_line":"        r.raise_for_status()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0ew%3D","line":65,"in_reply_to":"AAAAUH%2F9mbw%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        self.session_timeout \u003d cfg.CONF.ml2_odl.session_timeout"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def obtain_auth_cookies(self):"},{"line_number":66,"context_line":"        url \u003d self.url"},{"line_number":67,"context_line":"        r \u003d requests.get(url, auth\u003d(self.username, self.password))"},{"line_number":68,"context_line":"        r.raise_for_status()"},{"line_number":69,"context_line":"        jsessionid \u003d r.cookies.get(\u0027JSESSIONID\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mb8%3D","line":66,"updated":"2014-02-05 18:55:14.000000000","message":"Don\u0027t need this variable here, can just use self.url in the line below.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        self.session_timeout \u003d cfg.CONF.ml2_odl.session_timeout"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def obtain_auth_cookies(self):"},{"line_number":66,"context_line":"        url \u003d self.url"},{"line_number":67,"context_line":"        r \u003d requests.get(url, auth\u003d(self.username, self.password))"},{"line_number":68,"context_line":"        r.raise_for_status()"},{"line_number":69,"context_line":"        jsessionid \u003d r.cookies.get(\u0027JSESSIONID\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0fI%3D","line":66,"in_reply_to":"AAAAUH%2F9mb8%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            self.auth_cookies \u003d dict(JSESSIONID\u003djsessionid,"},{"line_number":73,"context_line":"                                     JSESSIONIDSSO\u003djsessionidsso)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def check_expiry(self):"},{"line_number":76,"context_line":"        if not self.last_request:"},{"line_number":77,"context_line":"            self.expired \u003d True"},{"line_number":78,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mbs%3D","line":75,"updated":"2014-02-05 18:55:14.000000000","message":"Need docstring","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            self.auth_cookies \u003d dict(JSESSIONID\u003djsessionid,"},{"line_number":73,"context_line":"                                     JSESSIONIDSSO\u003djsessionidsso)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def check_expiry(self):"},{"line_number":76,"context_line":"        if not self.last_request:"},{"line_number":77,"context_line":"            self.expired \u003d True"},{"line_number":78,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0fc%3D","line":75,"in_reply_to":"AAAAUH%2F9mbs%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        else:"},{"line_number":85,"context_line":"            self.expired \u003d False"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def __call__(self, r):"},{"line_number":88,"context_line":"        self.check_expiry()"},{"line_number":89,"context_line":"        if self.expired:"},{"line_number":90,"context_line":"            self.obtain_auth_cookies()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mbo%3D","line":87,"updated":"2014-02-05 18:55:14.000000000","message":"Need docstring","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        else:"},{"line_number":85,"context_line":"            self.expired \u003d False"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def __call__(self, r):"},{"line_number":88,"context_line":"        self.check_expiry()"},{"line_number":89,"context_line":"        if self.expired:"},{"line_number":90,"context_line":"            self.obtain_auth_cookies()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0fs%3D","line":87,"in_reply_to":"AAAAUH%2F9mbo%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    exposed by ODL is slightly different from the API exposed by NCS,"},{"line_number":102,"context_line":"    but the general concepts are the same."},{"line_number":103,"context_line":"    \"\"\""},{"line_number":104,"context_line":"    auth \u003d None"},{"line_number":105,"context_line":"    out_of_sync \u003d True"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def initialize(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mbQ%3D","line":104,"updated":"2014-02-05 18:55:14.000000000","message":"Is the auth variable used anywhere?","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    exposed by ODL is slightly different from the API exposed by NCS,"},{"line_number":102,"context_line":"    but the general concepts are the same."},{"line_number":103,"context_line":"    \"\"\""},{"line_number":104,"context_line":"    auth \u003d None"},{"line_number":105,"context_line":"    out_of_sync \u003d True"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def initialize(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0hE%3D","line":104,"in_reply_to":"AAAAUH%2F9mbQ%3D","updated":"2014-02-10 16:50:58.000000000","message":"It\u0027s only used to initialize and store the JsessionId.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        nets \u003d []"},{"line_number":163,"context_line":"        for network in networks:"},{"line_number":164,"context_line":"            try:"},{"line_number":165,"context_line":"                urlpath \u003d \u0027networks\u0027 + \u0027/\u0027 + network[\u0027id\u0027]"},{"line_number":166,"context_line":"                self.sendjson(\u0027get\u0027, urlpath, None)"},{"line_number":167,"context_line":"            except requests.exceptions.HTTPError as e:"},{"line_number":168,"context_line":"                if e.response.status_code \u003d\u003d 404:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mh4%3D","line":165,"updated":"2014-02-05 18:55:14.000000000","message":"Constants for these fixed strings.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        nets \u003d []"},{"line_number":163,"context_line":"        for network in networks:"},{"line_number":164,"context_line":"            try:"},{"line_number":165,"context_line":"                urlpath \u003d \u0027networks\u0027 + \u0027/\u0027 + network[\u0027id\u0027]"},{"line_number":166,"context_line":"                self.sendjson(\u0027get\u0027, urlpath, None)"},{"line_number":167,"context_line":"            except requests.exceptions.HTTPError as e:"},{"line_number":168,"context_line":"                if e.response.status_code \u003d\u003d 404:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0hw%3D","line":165,"in_reply_to":"AAAAUH%2F9mh4%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                            except KeyError:"},{"line_number":174,"context_line":"                                pass"},{"line_number":175,"context_line":"                    nets.append(network)"},{"line_number":176,"context_line":"                continue"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        key \u003d \u0027network\u0027 if len(nets) \u003d\u003d 1 else \u0027networks\u0027"},{"line_number":179,"context_line":"        self.sendjson(\u0027post\u0027, \u0027networks\u0027, {key: nets}, [400])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mmc%3D","line":176,"updated":"2014-02-05 18:55:14.000000000","message":"Don\u0027t need the continue","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                            except KeyError:"},{"line_number":174,"context_line":"                                pass"},{"line_number":175,"context_line":"                    nets.append(network)"},{"line_number":176,"context_line":"                continue"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        key \u003d \u0027network\u0027 if len(nets) \u003d\u003d 1 else \u0027networks\u0027"},{"line_number":179,"context_line":"        self.sendjson(\u0027post\u0027, \u0027networks\u0027, {key: nets}, [400])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0iA%3D","line":176,"in_reply_to":"AAAAUH%2F9mmc%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        snets \u003d []"},{"line_number":182,"context_line":"        for subnet in subnets:"},{"line_number":183,"context_line":"            try:"},{"line_number":184,"context_line":"                urlpath \u003d \u0027subnets\u0027 + \u0027/\u0027 + subnet[\u0027id\u0027]"},{"line_number":185,"context_line":"                self.sendjson(\u0027get\u0027, urlpath, None)"},{"line_number":186,"context_line":"            except requests.exceptions.HTTPError as e:"},{"line_number":187,"context_line":"                if e.response.status_code \u003d\u003d 404:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mkA%3D","line":184,"updated":"2014-02-05 18:55:14.000000000","message":"Constants for these fixed strings.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        snets \u003d []"},{"line_number":182,"context_line":"        for subnet in subnets:"},{"line_number":183,"context_line":"            try:"},{"line_number":184,"context_line":"                urlpath \u003d \u0027subnets\u0027 + \u0027/\u0027 + subnet[\u0027id\u0027]"},{"line_number":185,"context_line":"                self.sendjson(\u0027get\u0027, urlpath, None)"},{"line_number":186,"context_line":"            except requests.exceptions.HTTPError as e:"},{"line_number":187,"context_line":"                if e.response.status_code \u003d\u003d 404:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0iI%3D","line":184,"in_reply_to":"AAAAUH%2F9mkA%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            except requests.exceptions.HTTPError as e:"},{"line_number":187,"context_line":"                if e.response.status_code \u003d\u003d 404:"},{"line_number":188,"context_line":"                    snets.append(subnet)"},{"line_number":189,"context_line":"                continue"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        key \u003d \u0027subnet\u0027 if len(snets) \u003d\u003d 1 else \u0027subnets\u0027"},{"line_number":192,"context_line":"        self.sendjson(\u0027post\u0027, \u0027subnets\u0027, {key: snets}, [400])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mmY%3D","line":189,"updated":"2014-02-05 18:55:14.000000000","message":"Don\u0027t need the continue","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            except requests.exceptions.HTTPError as e:"},{"line_number":187,"context_line":"                if e.response.status_code \u003d\u003d 404:"},{"line_number":188,"context_line":"                    snets.append(subnet)"},{"line_number":189,"context_line":"                continue"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        key \u003d \u0027subnet\u0027 if len(snets) \u003d\u003d 1 else \u0027subnets\u0027"},{"line_number":192,"context_line":"        self.sendjson(\u0027post\u0027, \u0027subnets\u0027, {key: snets}, [400])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0iQ%3D","line":189,"in_reply_to":"AAAAUH%2F9mmY%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        pports \u003d []"},{"line_number":195,"context_line":"        for port in ports:"},{"line_number":196,"context_line":"            try:"},{"line_number":197,"context_line":"                urlpath \u003d \u0027ports\u0027 + \u0027/\u0027 + port[\u0027id\u0027]"},{"line_number":198,"context_line":"                self.sendjson(\u0027get\u0027, urlpath, None)"},{"line_number":199,"context_line":"            except requests.exceptions.HTTPError as e:"},{"line_number":200,"context_line":"                if e.response.status_code \u003d\u003d 404:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mjo%3D","line":197,"updated":"2014-02-05 18:55:14.000000000","message":"Constants for these fixed strings.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        pports \u003d []"},{"line_number":195,"context_line":"        for port in ports:"},{"line_number":196,"context_line":"            try:"},{"line_number":197,"context_line":"                urlpath \u003d \u0027ports\u0027 + \u0027/\u0027 + port[\u0027id\u0027]"},{"line_number":198,"context_line":"                self.sendjson(\u0027get\u0027, urlpath, None)"},{"line_number":199,"context_line":"            except requests.exceptions.HTTPError as e:"},{"line_number":200,"context_line":"                if e.response.status_code \u003d\u003d 404:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0ik%3D","line":197,"in_reply_to":"AAAAUH%2F9mjo%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":207,"context_line":"                        except KeyError:"},{"line_number":208,"context_line":"                            pass"},{"line_number":209,"context_line":"                    pports.append(port)"},{"line_number":210,"context_line":"                continue"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        key \u003d \u0027port\u0027 if len(pports) \u003d\u003d 1 else \u0027ports\u0027"},{"line_number":213,"context_line":"        self.sendjson(\u0027post\u0027, \u0027ports\u0027, {key: pports}, [400])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mmM%3D","line":210,"updated":"2014-02-05 18:55:14.000000000","message":"Don\u0027t need the continue","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":207,"context_line":"                        except KeyError:"},{"line_number":208,"context_line":"                            pass"},{"line_number":209,"context_line":"                    pports.append(port)"},{"line_number":210,"context_line":"                continue"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        key \u003d \u0027port\u0027 if len(pports) \u003d\u003d 1 else \u0027ports\u0027"},{"line_number":213,"context_line":"        self.sendjson(\u0027post\u0027, \u0027ports\u0027, {key: pports}, [400])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0kw%3D","line":210,"in_reply_to":"AAAAUH%2F9mmM%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1a0372421872077ee87036cadcccf2af12479f4a","unresolved":false,"context_lines":[{"line_number":217,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":218,"context_line":"        \"\"\"Synchronize the single modified record to ODL."},{"line_number":219,"context_line":"        \"\"\""},{"line_number":220,"context_line":"        self.out_of_sync \u003d True"},{"line_number":221,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":222,"context_line":"        id \u003d context.current[\u0027id\u0027]"},{"line_number":223,"context_line":"        if operation \u003d\u003d \u0027delete\u0027:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9nIQ%3D","line":220,"updated":"2014-02-05 17:21:42.000000000","message":"I don\u0027t think it is a good idea to set out_of_sync to True here. If it is set to True, another API call will trigger full_sync.\n\nI understand it is to make out_of_sync True when an exception occurs, but I think setting out_of_sync to True should be done in an error handling logic.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":217,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":218,"context_line":"        \"\"\"Synchronize the single modified record to ODL."},{"line_number":219,"context_line":"        \"\"\""},{"line_number":220,"context_line":"        self.out_of_sync \u003d True"},{"line_number":221,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":222,"context_line":"        id \u003d context.current[\u0027id\u0027]"},{"line_number":223,"context_line":"        if operation \u003d\u003d \u0027delete\u0027:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0k0%3D","line":220,"in_reply_to":"AAAAUH%2F9nIQ%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"5d1f409c6fe7e7647bb94c5b312561e8a5722c64","unresolved":false,"context_lines":[{"line_number":231,"context_line":"            else:"},{"line_number":232,"context_line":"                urlpath \u003d object_type + \u0027/\u0027 + id"},{"line_number":233,"context_line":"                method \u003d \u0027put\u0027"},{"line_number":234,"context_line":"            if object_type \u003d\u003d \u0027networks\u0027:"},{"line_number":235,"context_line":"                try:"},{"line_number":236,"context_line":"                    network \u003d context._plugin.get_network(dbcontext, id)"},{"line_number":237,"context_line":"                except n_exc.NetworkNotFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9r4I%3D","line":234,"updated":"2014-02-05 00:36:57.000000000","message":"Each part of the this if/elif/else feels like it should be a separate method for each resource type.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":231,"context_line":"            else:"},{"line_number":232,"context_line":"                urlpath \u003d object_type + \u0027/\u0027 + id"},{"line_number":233,"context_line":"                method \u003d \u0027put\u0027"},{"line_number":234,"context_line":"            if object_type \u003d\u003d \u0027networks\u0027:"},{"line_number":235,"context_line":"                try:"},{"line_number":236,"context_line":"                    network \u003d context._plugin.get_network(dbcontext, id)"},{"line_number":237,"context_line":"                except n_exc.NetworkNotFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0XQ%3D","line":234,"in_reply_to":"AAAAUH%2F9pL4%3D","updated":"2014-02-10 16:50:58.000000000","message":"Thanks for the input here Mark and Paul. Let me take a look at this after cleaning up all the rest of these comments.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c5dcf7de02ee498a55adef265170d8001feac452","unresolved":false,"context_lines":[{"line_number":231,"context_line":"            else:"},{"line_number":232,"context_line":"                urlpath \u003d object_type + \u0027/\u0027 + id"},{"line_number":233,"context_line":"                method \u003d \u0027put\u0027"},{"line_number":234,"context_line":"            if object_type \u003d\u003d \u0027networks\u0027:"},{"line_number":235,"context_line":"                try:"},{"line_number":236,"context_line":"                    network \u003d context._plugin.get_network(dbcontext, id)"},{"line_number":237,"context_line":"                except n_exc.NetworkNotFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9pL4%3D","line":234,"in_reply_to":"AAAAUH%2F9r4I%3D","updated":"2014-02-05 12:00:41.000000000","message":"I agree. Wondering if duplication can be factored out between resource types and between full and partial sync.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":240,"context_line":"                    # Remove the following for update calls"},{"line_number":241,"context_line":"                    if operation \u003d\u003d \u0027update\u0027:"},{"line_number":242,"context_line":"                        for d in [\u0027id\u0027, \u0027status\u0027, \u0027subnets\u0027, \u0027tenant_id\u0027]:"},{"line_number":243,"context_line":"                            if d in network:"},{"line_number":244,"context_line":"                                try:"},{"line_number":245,"context_line":"                                    del network[d]"},{"line_number":246,"context_line":"                                except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9maI%3D","line":243,"updated":"2014-02-05 18:55:14.000000000","message":"If statement not required","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":240,"context_line":"                    # Remove the following for update calls"},{"line_number":241,"context_line":"                    if operation \u003d\u003d \u0027update\u0027:"},{"line_number":242,"context_line":"                        for d in [\u0027id\u0027, \u0027status\u0027, \u0027subnets\u0027, \u0027tenant_id\u0027]:"},{"line_number":243,"context_line":"                            if d in network:"},{"line_number":244,"context_line":"                                try:"},{"line_number":245,"context_line":"                                    del network[d]"},{"line_number":246,"context_line":"                                except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0lA%3D","line":243,"in_reply_to":"AAAAUH%2F9maI%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":247,"context_line":"                                    pass"},{"line_number":248,"context_line":"                    elif operation \u003d\u003d \u0027create\u0027:"},{"line_number":249,"context_line":"                        for d in [\u0027status\u0027, \u0027subnets\u0027]:"},{"line_number":250,"context_line":"                            if d in network:"},{"line_number":251,"context_line":"                                try:"},{"line_number":252,"context_line":"                                    del network[d]"},{"line_number":253,"context_line":"                                except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9maE%3D","line":250,"updated":"2014-02-05 18:55:14.000000000","message":"If statement not required","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":247,"context_line":"                                    pass"},{"line_number":248,"context_line":"                    elif operation \u003d\u003d \u0027create\u0027:"},{"line_number":249,"context_line":"                        for d in [\u0027status\u0027, \u0027subnets\u0027]:"},{"line_number":250,"context_line":"                            if d in network:"},{"line_number":251,"context_line":"                                try:"},{"line_number":252,"context_line":"                                    del network[d]"},{"line_number":253,"context_line":"                                except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0lE%3D","line":250,"in_reply_to":"AAAAUH%2F9maE%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":264,"context_line":"                    if operation \u003d\u003d \u0027update\u0027:"},{"line_number":265,"context_line":"                        for d in [\u0027id\u0027, \u0027network_id\u0027, \u0027ip_version\u0027, \u0027cidr\u0027,"},{"line_number":266,"context_line":"                                  \u0027allocation_pools\u0027, \u0027tenant_id\u0027]:"},{"line_number":267,"context_line":"                            if d in subnet:"},{"line_number":268,"context_line":"                                try:"},{"line_number":269,"context_line":"                                    del subnet[d]"},{"line_number":270,"context_line":"                                except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9maA%3D","line":267,"updated":"2014-02-05 18:55:14.000000000","message":"If statement not required","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":264,"context_line":"                    if operation \u003d\u003d \u0027update\u0027:"},{"line_number":265,"context_line":"                        for d in [\u0027id\u0027, \u0027network_id\u0027, \u0027ip_version\u0027, \u0027cidr\u0027,"},{"line_number":266,"context_line":"                                  \u0027allocation_pools\u0027, \u0027tenant_id\u0027]:"},{"line_number":267,"context_line":"                            if d in subnet:"},{"line_number":268,"context_line":"                                try:"},{"line_number":269,"context_line":"                                    del subnet[d]"},{"line_number":270,"context_line":"                                except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0lg%3D","line":267,"in_reply_to":"AAAAUH%2F9maA%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":282,"context_line":"                    if operation \u003d\u003d \u0027create\u0027:"},{"line_number":283,"context_line":"                        # TODO(kmestery): Converting due to ODL bug"},{"line_number":284,"context_line":"                        port[\u0027mac_address\u0027] \u003d port[\u0027mac_address\u0027].upper()"},{"line_number":285,"context_line":"                        if \u0027status\u0027 in port:"},{"line_number":286,"context_line":"                            try:"},{"line_number":287,"context_line":"                                del port[\u0027status\u0027]"},{"line_number":288,"context_line":"                            except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mfI%3D","line":285,"updated":"2014-02-05 18:55:14.000000000","message":"This if is not really required","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":282,"context_line":"                    if operation \u003d\u003d \u0027create\u0027:"},{"line_number":283,"context_line":"                        # TODO(kmestery): Converting due to ODL bug"},{"line_number":284,"context_line":"                        port[\u0027mac_address\u0027] \u003d port[\u0027mac_address\u0027].upper()"},{"line_number":285,"context_line":"                        if \u0027status\u0027 in port:"},{"line_number":286,"context_line":"                            try:"},{"line_number":287,"context_line":"                                del port[\u0027status\u0027]"},{"line_number":288,"context_line":"                            except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0lk%3D","line":285,"in_reply_to":"AAAAUH%2F9mfI%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                        # Remove the following for update calls"},{"line_number":292,"context_line":"                        for d in [\u0027network_id\u0027, \u0027id\u0027, \u0027status\u0027, \u0027mac_address\u0027,"},{"line_number":293,"context_line":"                                  \u0027tenant_id\u0027, \u0027fixed_ips\u0027]:"},{"line_number":294,"context_line":"                            if d in port:"},{"line_number":295,"context_line":"                                try:"},{"line_number":296,"context_line":"                                    del port[d]"},{"line_number":297,"context_line":"                                except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mew%3D","line":294,"updated":"2014-02-05 18:55:14.000000000","message":"This if is not really required","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                        # Remove the following for update calls"},{"line_number":292,"context_line":"                        for d in [\u0027network_id\u0027, \u0027id\u0027, \u0027status\u0027, \u0027mac_address\u0027,"},{"line_number":293,"context_line":"                                  \u0027tenant_id\u0027, \u0027fixed_ips\u0027]:"},{"line_number":294,"context_line":"                            if d in port:"},{"line_number":295,"context_line":"                                try:"},{"line_number":296,"context_line":"                                    del port[d]"},{"line_number":297,"context_line":"                                except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0ls%3D","line":294,"in_reply_to":"AAAAUH%2F9mew%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c5dcf7de02ee498a55adef265170d8001feac452","unresolved":false,"context_lines":[{"line_number":308,"context_line":"    def sendjson(self, method, urlpath, obj, ignorecodes\u003d[None]):"},{"line_number":309,"context_line":"        \"\"\"Send json to the OpenDaylight controller."},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        ignoreces contains a list of HTTP error codes to ignore."},{"line_number":312,"context_line":"        \"\"\""},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"        headers \u003d {\u0027Content-Type\u0027: \u0027application/json\u0027}"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9pOM%3D","line":311,"updated":"2014-02-05 12:00:41.000000000","message":"ignoreces -\u003e ignorecodes","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":308,"context_line":"    def sendjson(self, method, urlpath, obj, ignorecodes\u003d[None]):"},{"line_number":309,"context_line":"        \"\"\"Send json to the OpenDaylight controller."},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        ignoreces contains a list of HTTP error codes to ignore."},{"line_number":312,"context_line":"        \"\"\""},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"        headers \u003d {\u0027Content-Type\u0027: \u0027application/json\u0027}"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0l8%3D","line":311,"in_reply_to":"AAAAUH%2F9pOM%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"2fe630ad087b4545ebb31b9898bb6b366284c451","unresolved":false,"context_lines":[{"line_number":315,"context_line":"        if obj is None:"},{"line_number":316,"context_line":"            data \u003d None"},{"line_number":317,"context_line":"        else:"},{"line_number":318,"context_line":"            data \u003d jsonutils.dumps(obj, indent\u003d2)"},{"line_number":319,"context_line":"        if self.url:"},{"line_number":320,"context_line":"            url \u003d \u0027/\u0027.join([self.url, urlpath])"},{"line_number":321,"context_line":"            LOG.debug(_(\u0027ODL-----\u003e sending URL (%s) \u003c-----ODL\u0027) % url)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9mXo%3D","line":318,"updated":"2014-02-05 18:55:14.000000000","message":"can replace 315 - 318 this with:\ndata \u003d jsonutils.dumps(obj, indent\u003d2) if obj else None","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":315,"context_line":"        if obj is None:"},{"line_number":316,"context_line":"            data \u003d None"},{"line_number":317,"context_line":"        else:"},{"line_number":318,"context_line":"            data \u003d jsonutils.dumps(obj, indent\u003d2)"},{"line_number":319,"context_line":"        if self.url:"},{"line_number":320,"context_line":"            url \u003d \u0027/\u0027.join([self.url, urlpath])"},{"line_number":321,"context_line":"            LOG.debug(_(\u0027ODL-----\u003e sending URL (%s) \u003c-----ODL\u0027) % url)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0mU%3D","line":318,"in_reply_to":"AAAAUH%2F9mXo%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"5d1f409c6fe7e7647bb94c5b312561e8a5722c64","unresolved":false,"context_lines":[{"line_number":353,"context_line":"            LOG.debug(_(\u0027Binding valid.\u0027))"},{"line_number":354,"context_line":"            return True"},{"line_number":355,"context_line":"        LOG.warning(_(\"Binding invalid for port: %s\"), context.current)"},{"line_number":356,"context_line":"        return False"},{"line_number":357,"context_line":""},{"line_number":358,"context_line":"    def unbind_port(self, context):"},{"line_number":359,"context_line":"        LOG.debug(_(\"Unbinding port %(port)s on \""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9r24%3D","line":356,"updated":"2014-02-05 00:36:57.000000000","message":"Do we need to explicitly return False here or will the implied None work?","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":353,"context_line":"            LOG.debug(_(\u0027Binding valid.\u0027))"},{"line_number":354,"context_line":"            return True"},{"line_number":355,"context_line":"        LOG.warning(_(\"Binding invalid for port: %s\"), context.current)"},{"line_number":356,"context_line":"        return False"},{"line_number":357,"context_line":""},{"line_number":358,"context_line":"    def unbind_port(self, context):"},{"line_number":359,"context_line":"        LOG.debug(_(\"Unbinding port %(port)s on \""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0ms%3D","line":356,"in_reply_to":"AAAAUH%2F9r24%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"5d1f409c6fe7e7647bb94c5b312561e8a5722c64","unresolved":false,"context_lines":[{"line_number":368,"context_line":"        False to indicate this to callers."},{"line_number":369,"context_line":"        \"\"\""},{"line_number":370,"context_line":"        network_type \u003d segment[api.NETWORK_TYPE]"},{"line_number":371,"context_line":"        if network_type in [constants.TYPE_LOCAL, constants.TYPE_FLAT,"},{"line_number":372,"context_line":"                            constants.TYPE_GRE, constants.TYPE_VXLAN]:"},{"line_number":373,"context_line":"            #TODO(mestery): Validate these"},{"line_number":374,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9r34%3D","line":371,"updated":"2014-02-05 00:36:57.000000000","message":"return network_type in [...]","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":368,"context_line":"        False to indicate this to callers."},{"line_number":369,"context_line":"        \"\"\""},{"line_number":370,"context_line":"        network_type \u003d segment[api.NETWORK_TYPE]"},{"line_number":371,"context_line":"        if network_type in [constants.TYPE_LOCAL, constants.TYPE_FLAT,"},{"line_number":372,"context_line":"                            constants.TYPE_GRE, constants.TYPE_VXLAN]:"},{"line_number":373,"context_line":"            #TODO(mestery): Validate these"},{"line_number":374,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F0ro%3D","line":371,"in_reply_to":"AAAAUH%2F9r34%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"91bd3548eabdc78335e22a642fba8f6845e02324","unresolved":false,"context_lines":[{"line_number":15,"context_line":"# @author: Kyle Mestery, Cisco Systems, Inc."},{"line_number":16,"context_line":"# @author: Dave Tucker, Hewlett-Packard Development Company L.P."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import datetime"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from oslo.config import cfg"},{"line_number":21,"context_line":"import requests"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FiWo%3D","line":18,"updated":"2014-02-12 14:44:22.000000000","message":"May I suggest using time instead? It uses seconds since the epoch and is easier to do timeout calculations with.","commit_id":"79f6ae3f5c6f39a149b2c65f3989e894c2bbc783"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"de1d8e00e841f0b2a639bc1e26887d595332c3b7","unresolved":false,"context_lines":[{"line_number":15,"context_line":"# @author: Kyle Mestery, Cisco Systems, Inc."},{"line_number":16,"context_line":"# @author: Dave Tucker, Hewlett-Packard Development Company L.P."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import datetime"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from oslo.config import cfg"},{"line_number":21,"context_line":"import requests"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2Ffrc%3D","line":18,"in_reply_to":"AAAAUX%2F%2FiWo%3D","updated":"2014-02-12 19:42:27.000000000","message":"Thanks for all the comments on time() here Henry, I\u0027ve implemented all of them and they will show up in the version I will push soon.","commit_id":"79f6ae3f5c6f39a149b2c65f3989e894c2bbc783"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"91bd3548eabdc78335e22a642fba8f6845e02324","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    def __call__(self, r):"},{"line_number":100,"context_line":"        \"\"\"Verify timestamp for Tomcat session timeout.\"\"\""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        self.check_expiry()"},{"line_number":103,"context_line":"        if self.expired:"},{"line_number":104,"context_line":"            self.obtain_auth_cookies()"},{"line_number":105,"context_line":"        self.last_request \u003d datetime.datetime.utcnow()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FiTw%3D","line":102,"updated":"2014-02-12 14:44:22.000000000","message":"Not needed if you use session_deadline ...","commit_id":"79f6ae3f5c6f39a149b2c65f3989e894c2bbc783"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"91bd3548eabdc78335e22a642fba8f6845e02324","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        \"\"\"Verify timestamp for Tomcat session timeout.\"\"\""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        self.check_expiry()"},{"line_number":103,"context_line":"        if self.expired:"},{"line_number":104,"context_line":"            self.obtain_auth_cookies()"},{"line_number":105,"context_line":"        self.last_request \u003d datetime.datetime.utcnow()"},{"line_number":106,"context_line":"        r.prepare_cookies(self.auth_cookies)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FiSo%3D","line":103,"updated":"2014-02-12 14:44:22.000000000","message":"Use session_deadline like this:\n\n    if time.time() \u003e self.session_deadline:","commit_id":"79f6ae3f5c6f39a149b2c65f3989e894c2bbc783"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"91bd3548eabdc78335e22a642fba8f6845e02324","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        self.check_expiry()"},{"line_number":103,"context_line":"        if self.expired:"},{"line_number":104,"context_line":"            self.obtain_auth_cookies()"},{"line_number":105,"context_line":"        self.last_request \u003d datetime.datetime.utcnow()"},{"line_number":106,"context_line":"        r.prepare_cookies(self.auth_cookies)"},{"line_number":107,"context_line":"        return r"},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FiS0%3D","line":105,"updated":"2014-02-12 14:44:22.000000000","message":"Use time since the epoch instead:\n\n    self.session_deadline \u003d time.time() + self.session_timeout * 60\n\n(Or even better, convert minutes to seconds in __init__.)","commit_id":"79f6ae3f5c6f39a149b2c65f3989e894c2bbc783"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"46dc0b8733c83e1dd16cbf7053f7ffa58692eb64","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":229,"context_line":"        \"\"\"Synchronize the single modified record to ODL."},{"line_number":230,"context_line":"        \"\"\""},{"line_number":231,"context_line":"        self.out_of_sync \u003d True"},{"line_number":232,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":233,"context_line":"        id \u003d context.current[\u0027id\u0027]"},{"line_number":234,"context_line":"        if operation \u003d\u003d \u0027delete\u0027:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FsdQ%3D","line":231,"updated":"2014-02-11 12:47:51.000000000","message":"I don\u0027t understand why you set \u0027out_of_sync\u0027 to True here. Looking at line 163-164 from synchronize, sync_object is called only when  \u0027out_of_sync\u0027 is False. What\u0027s the point of setting  \u0027out_of_sync\u0027 to True here and then setting it to False again at the end of the method? Do you want to take into account the possibility that sync_object fails throwing an exception?","commit_id":"79f6ae3f5c6f39a149b2c65f3989e894c2bbc783"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d5b63baf0bec4e6b537da3a84da11d75ea4f346b","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":229,"context_line":"        \"\"\"Synchronize the single modified record to ODL."},{"line_number":230,"context_line":"        \"\"\""},{"line_number":231,"context_line":"        self.out_of_sync \u003d True"},{"line_number":232,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":233,"context_line":"        id \u003d context.current[\u0027id\u0027]"},{"line_number":234,"context_line":"        if operation \u003d\u003d \u0027delete\u0027:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FkK0%3D","line":231,"in_reply_to":"AAAAUX%2F%2Fr%2B4%3D","updated":"2014-02-12 10:06:26.000000000","message":"My bad Kyle, I missed that comment. Anyway thanks for addressing this!","commit_id":"79f6ae3f5c6f39a149b2c65f3989e894c2bbc783"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"08e7fd409b72c41d90568f573ecaf478125c8e63","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":229,"context_line":"        \"\"\"Synchronize the single modified record to ODL."},{"line_number":230,"context_line":"        \"\"\""},{"line_number":231,"context_line":"        self.out_of_sync \u003d True"},{"line_number":232,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":233,"context_line":"        id \u003d context.current[\u0027id\u0027]"},{"line_number":234,"context_line":"        if operation \u003d\u003d \u0027delete\u0027:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2Fr%2B4%3D","line":231,"in_reply_to":"AAAAUX%2F%2FsdQ%3D","updated":"2014-02-11 17:44:36.000000000","message":"Yes, in fact I am going to address this in the next version of this patch. It was mentioned on a prior version of the patch as something to address as well. Thanks for reminding me again Rossella!","commit_id":"79f6ae3f5c6f39a149b2c65f3989e894c2bbc783"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"cd681ab9ab5d573c95176e2895d7a144208f53ef","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        if time.time() \u003e self.session_deadline:"},{"line_number":91,"context_line":"            self.obtain_auth_cookies()"},{"line_number":92,"context_line":"        self.session_deadline \u003d time.time() + self.session_timeout * 60"},{"line_number":93,"context_line":"        r.prepare_cookies(self.auth_cookies)"},{"line_number":94,"context_line":"        return r"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUX%2F%2FfK4%3D","line":92,"updated":"2014-02-12 20:45:07.000000000","message":"session_timeout should be converted to seconds in __init__.","commit_id":"1052d3adfc25b3850889e3576d1cbf32d8c46e5b"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"782ac54debf77d49373bc0d91fe96fc2dd2418b2","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        if time.time() \u003e self.session_deadline:"},{"line_number":91,"context_line":"            self.obtain_auth_cookies()"},{"line_number":92,"context_line":"        self.session_deadline \u003d time.time() + self.session_timeout * 60"},{"line_number":93,"context_line":"        r.prepare_cookies(self.auth_cookies)"},{"line_number":94,"context_line":"        return r"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUX%2F%2FfI8%3D","line":92,"in_reply_to":"AAAAUX%2F%2FfK4%3D","updated":"2014-02-12 20:50:18.000000000","message":"Per our IRC chat, agreed. New patch inbound. Thanks Henry!","commit_id":"1052d3adfc25b3850889e3576d1cbf32d8c46e5b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"58da182a017a818bc9567f9eed12454fbe30ef48","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":220,"context_line":"        \"\"\"Synchronize the single modified record to ODL."},{"line_number":221,"context_line":"        \"\"\""},{"line_number":222,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":223,"context_line":"        id \u003d context.current[\u0027id\u0027]"},{"line_number":224,"context_line":"        if operation \u003d\u003d \u0027delete\u0027:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FXdE%3D","line":221,"updated":"2014-02-13 17:47:02.000000000","message":"This fits into one line.","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"1fdef27e2469b7d88f7f7d6bc96ee16c4ba3ec27","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":220,"context_line":"        \"\"\"Synchronize the single modified record to ODL."},{"line_number":221,"context_line":"        \"\"\""},{"line_number":222,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":223,"context_line":"        id \u003d context.current[\u0027id\u0027]"},{"line_number":224,"context_line":"        if operation \u003d\u003d \u0027delete\u0027:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FWms%3D","line":221,"in_reply_to":"AAAAUX%2F%2FXdE%3D","updated":"2014-02-13 20:01:27.000000000","message":"Done","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"58da182a017a818bc9567f9eed12454fbe30ef48","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                self.sendjson(\u0027delete\u0027, urlpath, None, [400])"},{"line_number":228,"context_line":"            except Exception:"},{"line_number":229,"context_line":"                self.out_of_sync \u003d True"},{"line_number":230,"context_line":"                raise"},{"line_number":231,"context_line":"        else:"},{"line_number":232,"context_line":"            assert operation \u003d\u003d \u0027create\u0027 or operation \u003d\u003d \u0027update\u0027"},{"line_number":233,"context_line":"            if operation \u003d\u003d \u0027create\u0027:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FXcU%3D","line":230,"updated":"2014-02-13 17:47:02.000000000","message":"It is better to use excutils.\n\n  with excutils.save_and_reraise_exception():\n      self.out_of_sync \u003d True","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"1fdef27e2469b7d88f7f7d6bc96ee16c4ba3ec27","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                self.sendjson(\u0027delete\u0027, urlpath, None, [400])"},{"line_number":228,"context_line":"            except Exception:"},{"line_number":229,"context_line":"                self.out_of_sync \u003d True"},{"line_number":230,"context_line":"                raise"},{"line_number":231,"context_line":"        else:"},{"line_number":232,"context_line":"            assert operation \u003d\u003d \u0027create\u0027 or operation \u003d\u003d \u0027update\u0027"},{"line_number":233,"context_line":"            if operation \u003d\u003d \u0027create\u0027:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FWm0%3D","line":230,"in_reply_to":"AAAAUX%2F%2FXcU%3D","updated":"2014-02-13 20:01:27.000000000","message":"Done","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"58da182a017a818bc9567f9eed12454fbe30ef48","unresolved":false,"context_lines":[{"line_number":260,"context_line":"                                      [400])"},{"line_number":261,"context_line":"                    except Exception:"},{"line_number":262,"context_line":"                        self.out_of_sync \u003d True"},{"line_number":263,"context_line":"                        raise"},{"line_number":264,"context_line":"            elif object_type \u003d\u003d ODL_SUBNETS:"},{"line_number":265,"context_line":"                try:"},{"line_number":266,"context_line":"                    subnet \u003d context._plugin.get_subnet(dbcontext, id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FXb4%3D","line":263,"updated":"2014-02-13 17:47:02.000000000","message":"Same as the above.","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"1fdef27e2469b7d88f7f7d6bc96ee16c4ba3ec27","unresolved":false,"context_lines":[{"line_number":260,"context_line":"                                      [400])"},{"line_number":261,"context_line":"                    except Exception:"},{"line_number":262,"context_line":"                        self.out_of_sync \u003d True"},{"line_number":263,"context_line":"                        raise"},{"line_number":264,"context_line":"            elif object_type \u003d\u003d ODL_SUBNETS:"},{"line_number":265,"context_line":"                try:"},{"line_number":266,"context_line":"                    subnet \u003d context._plugin.get_subnet(dbcontext, id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FWj8%3D","line":263,"in_reply_to":"AAAAUX%2F%2FXb4%3D","updated":"2014-02-13 20:01:27.000000000","message":"Done","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"58da182a017a818bc9567f9eed12454fbe30ef48","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                                      [400])"},{"line_number":281,"context_line":"                    except Exception:"},{"line_number":282,"context_line":"                        self.out_of_sync \u003d True"},{"line_number":283,"context_line":"                        raise"},{"line_number":284,"context_line":"            else:"},{"line_number":285,"context_line":"                assert object_type \u003d\u003d ODL_PORTS"},{"line_number":286,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FXbg%3D","line":283,"updated":"2014-02-13 17:47:02.000000000","message":"Same as the above.","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"1fdef27e2469b7d88f7f7d6bc96ee16c4ba3ec27","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                                      [400])"},{"line_number":281,"context_line":"                    except Exception:"},{"line_number":282,"context_line":"                        self.out_of_sync \u003d True"},{"line_number":283,"context_line":"                        raise"},{"line_number":284,"context_line":"            else:"},{"line_number":285,"context_line":"                assert object_type \u003d\u003d ODL_PORTS"},{"line_number":286,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FWmo%3D","line":283,"in_reply_to":"AAAAUX%2F%2FXbg%3D","updated":"2014-02-13 20:01:27.000000000","message":"Done","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"58da182a017a818bc9567f9eed12454fbe30ef48","unresolved":false,"context_lines":[{"line_number":309,"context_line":"                    except Exception:"},{"line_number":310,"context_line":"                        self.out_of_sync \u003d True"},{"line_number":311,"context_line":"                        raise"},{"line_number":312,"context_line":"        self.out_of_sync \u003d False"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"    def add_security_groups(self, context, dbcontext, port):"},{"line_number":315,"context_line":"        \"\"\"Populate the \u0027security_groups\u0027 field with entire records.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FXaA%3D","line":312,"updated":"2014-02-13 17:47:02.000000000","message":"I think it is unnecessary because self.out_of_sync is already False when sync_object is called. There is case where an exception occurs in another API call and this line can override self.out_of_sync to False. It needs to be avoided.","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"1fdef27e2469b7d88f7f7d6bc96ee16c4ba3ec27","unresolved":false,"context_lines":[{"line_number":309,"context_line":"                    except Exception:"},{"line_number":310,"context_line":"                        self.out_of_sync \u003d True"},{"line_number":311,"context_line":"                        raise"},{"line_number":312,"context_line":"        self.out_of_sync \u003d False"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"    def add_security_groups(self, context, dbcontext, port):"},{"line_number":315,"context_line":"        \"\"\"Populate the \u0027security_groups\u0027 field with entire records.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FWqo%3D","line":312,"in_reply_to":"AAAAUX%2F%2FXaA%3D","updated":"2014-02-13 20:01:27.000000000","message":"Done","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"e0b50f0ed2cea3e17ba8ad6b0732d873dfd72295","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                self.sendjson(\u0027delete\u0027, urlpath, None, [400])"},{"line_number":228,"context_line":"            except Exception:"},{"line_number":229,"context_line":"                self.out_of_sync \u003d True"},{"line_number":230,"context_line":"                raise"},{"line_number":231,"context_line":"        else:"},{"line_number":232,"context_line":"            assert operation \u003d\u003d \u0027create\u0027 or operation \u003d\u003d \u0027update\u0027"},{"line_number":233,"context_line":"            if operation \u003d\u003d \u0027create\u0027:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUX%2F%2FUtc%3D","line":230,"updated":"2014-02-13 23:35:21.000000000","message":"We need save_and_reraise_exceptions here.","commit_id":"696d571b7e99900df21ad4ddff7ecfcfa195febf"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"c2cf010c5972174b2f53aa759a88d4bcabf5c6c9","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                self.sendjson(\u0027delete\u0027, urlpath, None, [400])"},{"line_number":228,"context_line":"            except Exception:"},{"line_number":229,"context_line":"                self.out_of_sync \u003d True"},{"line_number":230,"context_line":"                raise"},{"line_number":231,"context_line":"        else:"},{"line_number":232,"context_line":"            assert operation \u003d\u003d \u0027create\u0027 or operation \u003d\u003d \u0027update\u0027"},{"line_number":233,"context_line":"            if operation \u003d\u003d \u0027create\u0027:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUX%2F%2FTsU%3D","line":230,"in_reply_to":"AAAAUX%2F%2FUtc%3D","updated":"2014-02-14 03:08:22.000000000","message":"I missed this one, thanks Akihiro!","commit_id":"696d571b7e99900df21ad4ddff7ecfcfa195febf"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"01ad05ed7d0e8e44500603cf3f612f7a86c25b5b","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                            try:"},{"line_number":178,"context_line":"                                del network[d]"},{"line_number":179,"context_line":"                            except KeyError:"},{"line_number":180,"context_line":"                                pass"},{"line_number":181,"context_line":"                    nets.append(network)"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        key \u003d ODL_NETWORK if len(nets) \u003d\u003d 1 else ODL_NETWORKS"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUX%2F%2B7Vg%3D","line":180,"updated":"2014-02-18 07:11:20.000000000","message":"You could have a function like this:\n\ndef try_del(d, keys):\n    for key in keys:\n        try:\n            del d[key]\n        except KeyError:\n            pass\n\nThen replace lines 175-180 with:\n\n    try_del(network, [\u0027status\u0027, \u0027subnets\u0027])\n\nand do the same everywhere this pattern occurs.","commit_id":"4f8470c1bb4f2b80e7ff1bb4a8838b0c58bf9068"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"ac099c98338f64eb7d96b3631aadd15c8fc843a6","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                            try:"},{"line_number":178,"context_line":"                                del network[d]"},{"line_number":179,"context_line":"                            except KeyError:"},{"line_number":180,"context_line":"                                pass"},{"line_number":181,"context_line":"                    nets.append(network)"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        key \u003d ODL_NETWORK if len(nets) \u003d\u003d 1 else ODL_NETWORKS"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUX%2F%2B33c%3D","line":180,"in_reply_to":"AAAAUX%2F%2B7Vg%3D","updated":"2014-02-18 14:00:32.000000000","message":"This is a fabulous suggestion Henry, thanks! I\u0027ve implemented this in the next version of this patch.","commit_id":"4f8470c1bb4f2b80e7ff1bb4a8838b0c58bf9068"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"01ad05ed7d0e8e44500603cf3f612f7a86c25b5b","unresolved":false,"context_lines":[{"line_number":220,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":221,"context_line":"        \"\"\"Synchronize the single modified record to ODL.\"\"\""},{"line_number":222,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":223,"context_line":"        id \u003d context.current[\u0027id\u0027]"},{"line_number":224,"context_line":"        if operation \u003d\u003d \u0027delete\u0027:"},{"line_number":225,"context_line":"            urlpath \u003d object_type + \u0027/\u0027 + id"},{"line_number":226,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUX%2F%2B7Qo%3D","line":223,"updated":"2014-02-18 07:11:20.000000000","message":"Since id is a Python built-in function, I discourage this use of id as a variable name. Can you call it obj_id instead?","commit_id":"4f8470c1bb4f2b80e7ff1bb4a8838b0c58bf9068"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"ac099c98338f64eb7d96b3631aadd15c8fc843a6","unresolved":false,"context_lines":[{"line_number":220,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":221,"context_line":"        \"\"\"Synchronize the single modified record to ODL.\"\"\""},{"line_number":222,"context_line":"        dbcontext \u003d context._plugin_context"},{"line_number":223,"context_line":"        id \u003d context.current[\u0027id\u0027]"},{"line_number":224,"context_line":"        if operation \u003d\u003d \u0027delete\u0027:"},{"line_number":225,"context_line":"            urlpath \u003d object_type + \u0027/\u0027 + id"},{"line_number":226,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUX%2F%2B31Y%3D","line":223,"in_reply_to":"AAAAUX%2F%2B7Qo%3D","updated":"2014-02-18 14:00:32.000000000","message":"Done","commit_id":"4f8470c1bb4f2b80e7ff1bb4a8838b0c58bf9068"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"01ad05ed7d0e8e44500603cf3f612f7a86c25b5b","unresolved":false,"context_lines":[{"line_number":316,"context_line":"                  for sg in port[\u0027security_groups\u0027]]"},{"line_number":317,"context_line":"        port[\u0027security_groups\u0027] \u003d groups"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"    def sendjson(self, method, urlpath, obj, ignorecodes\u003d[None]):"},{"line_number":320,"context_line":"        \"\"\"Send json to the OpenDaylight controller."},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        ignorecodes contains a list of HTTP error codes to ignore."}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUX%2F%2B7SM%3D","line":319,"updated":"2014-02-18 07:11:20.000000000","message":"I think ignorecodes\u003d[] would be better.","commit_id":"4f8470c1bb4f2b80e7ff1bb4a8838b0c58bf9068"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"ac099c98338f64eb7d96b3631aadd15c8fc843a6","unresolved":false,"context_lines":[{"line_number":316,"context_line":"                  for sg in port[\u0027security_groups\u0027]]"},{"line_number":317,"context_line":"        port[\u0027security_groups\u0027] \u003d groups"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"    def sendjson(self, method, urlpath, obj, ignorecodes\u003d[None]):"},{"line_number":320,"context_line":"        \"\"\"Send json to the OpenDaylight controller."},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        ignorecodes contains a list of HTTP error codes to ignore."}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUX%2F%2B31I%3D","line":319,"in_reply_to":"AAAAUX%2F%2B7SM%3D","updated":"2014-02-18 14:00:32.000000000","message":"Done","commit_id":"4f8470c1bb4f2b80e7ff1bb4a8838b0c58bf9068"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c36aaa45f50d0689d8ff23d9ec2e7be90260f3f9","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                        try:"},{"line_number":205,"context_line":"                            del port[\u0027status\u0027]"},{"line_number":206,"context_line":"                        except KeyError:"},{"line_number":207,"context_line":"                            pass"},{"line_number":208,"context_line":"                    pports.append(port)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"        key \u003d ODL_PORT if len(pports) \u003d\u003d 1 else ODL_PORTS"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2BviU%3D","line":207,"updated":"2014-02-19 13:17:42.000000000","message":"Consider using try_del.\n\n  try_del(port, [\u0027status\u0027])","commit_id":"86bb44fe339bbc364e2503bddcb37478de928536"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"138cc814d53429d23d203037dde179474701296d","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                        try:"},{"line_number":205,"context_line":"                            del port[\u0027status\u0027]"},{"line_number":206,"context_line":"                        except KeyError:"},{"line_number":207,"context_line":"                            pass"},{"line_number":208,"context_line":"                    pports.append(port)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"        key \u003d ODL_PORT if len(pports) \u003d\u003d 1 else ODL_PORTS"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2Buv4%3D","line":207,"in_reply_to":"AAAAUX%2F%2BviU%3D","updated":"2014-02-19 14:36:12.000000000","message":"I have no idea how I missed this, thanks Akihiro!","commit_id":"86bb44fe339bbc364e2503bddcb37478de928536"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"b93a856e63987258a08dc944ae1db26f4b520839","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        self.auth \u003d JsessionId(self.url, self.username, self.password)"},{"line_number":124,"context_line":"        self.vif_type \u003d portbindings.VIF_TYPE_OVS"},{"line_number":125,"context_line":"        self.cap_port_filter \u003d False"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    # Postcommit hooks are used to trigger synchronization."},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    def create_network_postcommit(self, context):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2Br3I%3D","line":126,"updated":"2014-02-19 20:52:54.000000000","message":"With the current logic, if the plugin restarts then it\u0027ll have to wait for a neutron operation to be performed to do a full sync, so it could potentially end up out of sync with the controller. Would it be better to include a self.synchronize at the end of initialize ?","commit_id":"23e3655022d07e44e2175b5ce0a8141dc15a2eee"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"d406722ad8914e8cf422e65cb65a6a4a78accba4","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        self.auth \u003d JsessionId(self.url, self.username, self.password)"},{"line_number":124,"context_line":"        self.vif_type \u003d portbindings.VIF_TYPE_OVS"},{"line_number":125,"context_line":"        self.cap_port_filter \u003d False"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    # Postcommit hooks are used to trigger synchronization."},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    def create_network_postcommit(self, context):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2BjAI%3D","line":126,"in_reply_to":"AAAAUX%2F%2Br3I%3D","updated":"2014-02-20 16:58:13.000000000","message":"I don\u0027t think this is possible since at init time we don\u0027t have the context to perform this operation.","commit_id":"23e3655022d07e44e2175b5ce0a8141dc15a2eee"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"b93a856e63987258a08dc944ae1db26f4b520839","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                    nets.append(network)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"        key \u003d ODL_NETWORK if len(nets) \u003d\u003d 1 else ODL_NETWORKS"},{"line_number":188,"context_line":"        self.sendjson(\u0027post\u0027, ODL_NETWORKS, {key: nets}, [400])"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        snets \u003d []"},{"line_number":191,"context_line":"        for subnet in subnets:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2Br0c%3D","line":188,"updated":"2014-02-19 20:52:54.000000000","message":"A few comments would be useful to figure out what\u0027s going on in these blocks :). Also consider moving these to separate methods like sync_networks, sync_subnets and sync_ports, it would make the code more readable.","commit_id":"23e3655022d07e44e2175b5ce0a8141dc15a2eee"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"d406722ad8914e8cf422e65cb65a6a4a78accba4","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                    nets.append(network)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"        key \u003d ODL_NETWORK if len(nets) \u003d\u003d 1 else ODL_NETWORKS"},{"line_number":188,"context_line":"        self.sendjson(\u0027post\u0027, ODL_NETWORKS, {key: nets}, [400])"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        snets \u003d []"},{"line_number":191,"context_line":"        for subnet in subnets:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2BixI%3D","line":188,"in_reply_to":"AAAAUX%2F%2Br0c%3D","updated":"2014-02-20 16:58:13.000000000","message":"Done","commit_id":"23e3655022d07e44e2175b5ce0a8141dc15a2eee"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"b93a856e63987258a08dc944ae1db26f4b520839","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            else:"},{"line_number":238,"context_line":"                urlpath \u003d object_type + \u0027/\u0027 + obj_id"},{"line_number":239,"context_line":"                method \u003d \u0027put\u0027"},{"line_number":240,"context_line":"            if object_type \u003d\u003d ODL_NETWORKS:"},{"line_number":241,"context_line":"                try:"},{"line_number":242,"context_line":"                    network \u003d context._plugin.get_network(dbcontext, obj_id)"},{"line_number":243,"context_line":"                except n_exc.NetworkNotFound:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2Brr8%3D","line":240,"updated":"2014-02-19 20:52:54.000000000","message":"Consider moving these to separate methods as well. You might be able to reduce code by writing common methods to be reused in both sync_full and sync_object.","commit_id":"23e3655022d07e44e2175b5ce0a8141dc15a2eee"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"d406722ad8914e8cf422e65cb65a6a4a78accba4","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            else:"},{"line_number":238,"context_line":"                urlpath \u003d object_type + \u0027/\u0027 + obj_id"},{"line_number":239,"context_line":"                method \u003d \u0027put\u0027"},{"line_number":240,"context_line":"            if object_type \u003d\u003d ODL_NETWORKS:"},{"line_number":241,"context_line":"                try:"},{"line_number":242,"context_line":"                    network \u003d context._plugin.get_network(dbcontext, obj_id)"},{"line_number":243,"context_line":"                except n_exc.NetworkNotFound:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2BiN4%3D","line":240,"in_reply_to":"AAAAUX%2F%2Brr8%3D","updated":"2014-02-20 16:58:13.000000000","message":"Done, though collapsing them together didn\u0027t prove fruitful.","commit_id":"23e3655022d07e44e2175b5ce0a8141dc15a2eee"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ed3272532cb19d8f0fad8cc61b770f5572004e5","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        else:"},{"line_number":161,"context_line":"            self.sync_object(operation, object_type, context)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def sync_networks(self, networks):"},{"line_number":164,"context_line":"        \"\"\"Sync all Neutron networks over to OpenDaylight."},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        The logic below will walk through all Neutron networks and verify if"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2F8BY%3D","line":163,"updated":"2014-02-23 23:39:35.000000000","message":"The differences between sync_networks, subnets and ports are how to filter each resource. How about the following logic?\n\nhttp://paste.openstack.org/show/68788/","commit_id":"4040b04b6a9476f3c691fa6227f40f7de1ef0951"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"11452428d79a16af787b37c2d9d43d6d65a04a92","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        else:"},{"line_number":161,"context_line":"            self.sync_object(operation, object_type, context)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def sync_networks(self, networks):"},{"line_number":164,"context_line":"        \"\"\"Sync all Neutron networks over to OpenDaylight."},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        The logic below will walk through all Neutron networks and verify if"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2F2S4%3D","line":163,"in_reply_to":"AAAAU3%2F%2F8BY%3D","updated":"2014-02-24 15:14:04.000000000","message":"I like that approach a lot Akihiro! I\u0027ll take a stab and modifying the code to work that way, thanks!","commit_id":"4040b04b6a9476f3c691fa6227f40f7de1ef0951"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ed3272532cb19d8f0fad8cc61b770f5572004e5","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        self.sync_subnets(subnets)"},{"line_number":242,"context_line":"        self.sync_ports(ports, context, dbcontext)"},{"line_number":243,"context_line":"        self.out_of_sync \u003d False"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"    def sync_single_network(self, network, method, obj_id, urlpath,"},{"line_number":246,"context_line":"                            operation):"},{"line_number":247,"context_line":"        \"\"\"Sync a single network over to OpenDaylight.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2F7%2BQ%3D","line":244,"updated":"2014-02-23 23:39:35.000000000","message":"Same comment on sync_full().\nI tried to rewrite the code: http://paste.openstack.org/show/68793/\n\nThought?","commit_id":"4040b04b6a9476f3c691fa6227f40f7de1ef0951"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"11452428d79a16af787b37c2d9d43d6d65a04a92","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        self.sync_subnets(subnets)"},{"line_number":242,"context_line":"        self.sync_ports(ports, context, dbcontext)"},{"line_number":243,"context_line":"        self.out_of_sync \u003d False"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"    def sync_single_network(self, network, method, obj_id, urlpath,"},{"line_number":246,"context_line":"                            operation):"},{"line_number":247,"context_line":"        \"\"\"Sync a single network over to OpenDaylight.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2F2SQ%3D","line":244,"in_reply_to":"AAAAU3%2F%2F7%2BQ%3D","updated":"2014-02-24 15:14:04.000000000","message":"This also looks a bit cleaner, thank you!","commit_id":"4040b04b6a9476f3c691fa6227f40f7de1ef0951"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ed3272532cb19d8f0fad8cc61b770f5572004e5","unresolved":false,"context_lines":[{"line_number":307,"context_line":"                try:"},{"line_number":308,"context_line":"                    network \u003d context._plugin.get_network(dbcontext, obj_id)"},{"line_number":309,"context_line":"                except n_exc.NetworkNotFound:"},{"line_number":310,"context_line":"                    LOG.debug(_(\u0027Network not found (%d)\u0027) % obj_id)"},{"line_number":311,"context_line":"                else:"},{"line_number":312,"context_line":"                    self.sync_single_network(network, method, obj_id, urlpath,"},{"line_number":313,"context_line":"                                             operation)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2F7%2BM%3D","line":310,"updated":"2014-02-23 23:39:35.000000000","message":"I think %d should be %s because obj_id is UUID.","commit_id":"4040b04b6a9476f3c691fa6227f40f7de1ef0951"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"11452428d79a16af787b37c2d9d43d6d65a04a92","unresolved":false,"context_lines":[{"line_number":307,"context_line":"                try:"},{"line_number":308,"context_line":"                    network \u003d context._plugin.get_network(dbcontext, obj_id)"},{"line_number":309,"context_line":"                except n_exc.NetworkNotFound:"},{"line_number":310,"context_line":"                    LOG.debug(_(\u0027Network not found (%d)\u0027) % obj_id)"},{"line_number":311,"context_line":"                else:"},{"line_number":312,"context_line":"                    self.sync_single_network(network, method, obj_id, urlpath,"},{"line_number":313,"context_line":"                                             operation)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2F2R0%3D","line":310,"in_reply_to":"AAAAU3%2F%2F7%2BM%3D","updated":"2014-02-24 15:14:04.000000000","message":"Done","commit_id":"4040b04b6a9476f3c691fa6227f40f7de1ef0951"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ed3272532cb19d8f0fad8cc61b770f5572004e5","unresolved":false,"context_lines":[{"line_number":315,"context_line":"                try:"},{"line_number":316,"context_line":"                    subnet \u003d context._plugin.get_subnet(dbcontext, obj_id)"},{"line_number":317,"context_line":"                except n_exc.SubnetNotFound:"},{"line_number":318,"context_line":"                    LOG.debug(_(\u0027Subnet not found (%d)\u0027) % obj_id)"},{"line_number":319,"context_line":"                else:"},{"line_number":320,"context_line":"                    self.sync_single_subnet(subnet, method, obj_id, urlpath,"},{"line_number":321,"context_line":"                                            operation)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2F7%2BI%3D","line":318,"updated":"2014-02-23 23:39:35.000000000","message":"ditto","commit_id":"4040b04b6a9476f3c691fa6227f40f7de1ef0951"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"11452428d79a16af787b37c2d9d43d6d65a04a92","unresolved":false,"context_lines":[{"line_number":315,"context_line":"                try:"},{"line_number":316,"context_line":"                    subnet \u003d context._plugin.get_subnet(dbcontext, obj_id)"},{"line_number":317,"context_line":"                except n_exc.SubnetNotFound:"},{"line_number":318,"context_line":"                    LOG.debug(_(\u0027Subnet not found (%d)\u0027) % obj_id)"},{"line_number":319,"context_line":"                else:"},{"line_number":320,"context_line":"                    self.sync_single_subnet(subnet, method, obj_id, urlpath,"},{"line_number":321,"context_line":"                                            operation)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2F2Ro%3D","line":318,"in_reply_to":"AAAAU3%2F%2F7%2BI%3D","updated":"2014-02-24 15:14:04.000000000","message":"Done","commit_id":"4040b04b6a9476f3c691fa6227f40f7de1ef0951"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ed3272532cb19d8f0fad8cc61b770f5572004e5","unresolved":false,"context_lines":[{"line_number":325,"context_line":"                    port \u003d context._plugin.get_port(dbcontext, obj_id)"},{"line_number":326,"context_line":"                    self.add_security_groups(context, dbcontext, port)"},{"line_number":327,"context_line":"                except n_exc.PortNotFound:"},{"line_number":328,"context_line":"                    LOG.debug(_(\u0027Port not found (%d)\u0027) % obj_id)"},{"line_number":329,"context_line":"                else:"},{"line_number":330,"context_line":"                    self.sync_single_port(port, method, obj_id, urlpath,"},{"line_number":331,"context_line":"                                          operation)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2F7%2BE%3D","line":328,"updated":"2014-02-23 23:39:35.000000000","message":"ditto","commit_id":"4040b04b6a9476f3c691fa6227f40f7de1ef0951"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"11452428d79a16af787b37c2d9d43d6d65a04a92","unresolved":false,"context_lines":[{"line_number":325,"context_line":"                    port \u003d context._plugin.get_port(dbcontext, obj_id)"},{"line_number":326,"context_line":"                    self.add_security_groups(context, dbcontext, port)"},{"line_number":327,"context_line":"                except n_exc.PortNotFound:"},{"line_number":328,"context_line":"                    LOG.debug(_(\u0027Port not found (%d)\u0027) % obj_id)"},{"line_number":329,"context_line":"                else:"},{"line_number":330,"context_line":"                    self.sync_single_port(port, method, obj_id, urlpath,"},{"line_number":331,"context_line":"                                          operation)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2F2Rk%3D","line":328,"in_reply_to":"AAAAU3%2F%2F7%2BE%3D","updated":"2014-02-24 15:14:04.000000000","message":"Done","commit_id":"4040b04b6a9476f3c691fa6227f40f7de1ef0951"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2897ea1610bc9f17349b9a3f1eba3e7ac05205bc","unresolved":false,"context_lines":[{"line_number":257,"context_line":"        filter attributes out which are not required for the requisite"},{"line_number":258,"context_line":"        operation (create or update) being handled."},{"line_number":259,"context_line":"        \"\"\""},{"line_number":260,"context_line":"        if object_type \u003d\u003d ODL_NETWORKS:"},{"line_number":261,"context_line":"            object_key \u003d ODL_NETWORK"},{"line_number":262,"context_line":"        elif object_type \u003d\u003d ODL_SUBNETS:"},{"line_number":263,"context_line":"            object_key \u003d ODL_SUBNET"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2FzMs%3D","line":260,"updated":"2014-02-24 18:19:34.000000000","message":"I don\u0027t know if it makes it less clear, but you could just use:\nobject_type[:-1]\n\non L274 and L286, instead of L260-265.","commit_id":"f1f583d9f65a87ca41f07ca0d0bfe70a746339be"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"5526c3c8487abb1ce010375bfa587aa00603592a","unresolved":false,"context_lines":[{"line_number":257,"context_line":"        filter attributes out which are not required for the requisite"},{"line_number":258,"context_line":"        operation (create or update) being handled."},{"line_number":259,"context_line":"        \"\"\""},{"line_number":260,"context_line":"        if object_type \u003d\u003d ODL_NETWORKS:"},{"line_number":261,"context_line":"            object_key \u003d ODL_NETWORK"},{"line_number":262,"context_line":"        elif object_type \u003d\u003d ODL_SUBNETS:"},{"line_number":263,"context_line":"            object_key \u003d ODL_SUBNET"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2FxVw%3D","line":260,"in_reply_to":"AAAAU3%2F%2FzMs%3D","updated":"2014-02-24 21:28:37.000000000","message":"I actually like this Paul, making this change now.","commit_id":"f1f583d9f65a87ca41f07ca0d0bfe70a746339be"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"39e947a8206dccc944e1536efe433b979e26e9cc","unresolved":false,"context_lines":[{"line_number":326,"context_line":"            if self.check_segment(segment):"},{"line_number":327,"context_line":"                context.set_binding(segment[api.ID],"},{"line_number":328,"context_line":"                                    self.vif_type,"},{"line_number":329,"context_line":"                                    self.cap_port_filter)"},{"line_number":330,"context_line":"                LOG.debug(_(\"Bound using segment: %s\"), segment)"},{"line_number":331,"context_line":"                return"},{"line_number":332,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2Ft%2BE%3D","line":329,"updated":"2014-02-25 04:25:42.000000000","message":"This will need to be rebased and pass a vif_details dictionary rather than a cap_port_filter boolean.","commit_id":"88ac61cd6144024d9ad925166c97c216e51c52eb"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"c1237398391ad5900455a095616814780f41582e","unresolved":false,"context_lines":[{"line_number":326,"context_line":"            if self.check_segment(segment):"},{"line_number":327,"context_line":"                context.set_binding(segment[api.ID],"},{"line_number":328,"context_line":"                                    self.vif_type,"},{"line_number":329,"context_line":"                                    self.cap_port_filter)"},{"line_number":330,"context_line":"                LOG.debug(_(\"Bound using segment: %s\"), segment)"},{"line_number":331,"context_line":"                return"},{"line_number":332,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FpOY%3D","line":329,"in_reply_to":"AAAAU3%2F%2Ft%2BE%3D","updated":"2014-02-25 14:06:20.000000000","message":"Done","commit_id":"88ac61cd6144024d9ad925166c97c216e51c52eb"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"39e947a8206dccc944e1536efe433b979e26e9cc","unresolved":false,"context_lines":[{"line_number":330,"context_line":"                LOG.debug(_(\"Bound using segment: %s\"), segment)"},{"line_number":331,"context_line":"                return"},{"line_number":332,"context_line":"            else:"},{"line_number":333,"context_line":"                LOG.error(_(\"Failed binding port for segment ID %(id)s, \""},{"line_number":334,"context_line":"                            \"segment %(seg)s, phys net %(physnet)s, and \""},{"line_number":335,"context_line":"                            \"network type %(nettype)s\"),"},{"line_number":336,"context_line":"                          {\u0027id\u0027: segment[api.ID],"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2Ft%2BQ%3D","line":333,"updated":"2014-02-25 04:25:42.000000000","message":"Not being able to bind any individual segment should not be considered an error. The network might have other segments that can be bound by this driver, or some other mechanism driver may be able to bind the port. This probably should be LOG.debug(_(\"Refusing to bind port ...\".","commit_id":"88ac61cd6144024d9ad925166c97c216e51c52eb"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"c1237398391ad5900455a095616814780f41582e","unresolved":false,"context_lines":[{"line_number":330,"context_line":"                LOG.debug(_(\"Bound using segment: %s\"), segment)"},{"line_number":331,"context_line":"                return"},{"line_number":332,"context_line":"            else:"},{"line_number":333,"context_line":"                LOG.error(_(\"Failed binding port for segment ID %(id)s, \""},{"line_number":334,"context_line":"                            \"segment %(seg)s, phys net %(physnet)s, and \""},{"line_number":335,"context_line":"                            \"network type %(nettype)s\"),"},{"line_number":336,"context_line":"                          {\u0027id\u0027: segment[api.ID],"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FpNM%3D","line":333,"in_reply_to":"AAAAU3%2F%2Ft%2BQ%3D","updated":"2014-02-25 14:06:20.000000000","message":"Done","commit_id":"88ac61cd6144024d9ad925166c97c216e51c52eb"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ad8d98074f0392adb8b929bb1189c04e1ee0cc05","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def __init__(self, url, username, password):"},{"line_number":79,"context_line":"        \"\"\"Initialization function for JsessionId.\"\"\""},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        self.url \u003d str(url) + \u0027/\u0027 + ODL_NETWORKS"},{"line_number":82,"context_line":"        self.username \u003d username"},{"line_number":83,"context_line":"        self.password \u003d password"},{"line_number":84,"context_line":"        self.auth_cookies \u003d None"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2F%2FTA%3D","line":81,"updated":"2014-03-02 22:51:16.000000000","message":"Really pedant comment.\nIt seems here a GET /networks is performed on the backend with the only purpose of refreshing cookies.\n\nThis is totally agreeable, but it might become not really efficient when the number of networks grows to thousands.\n\nPerhaps you might use request limit or paging if that\u0027s allowed by the ODL API so that at most 1 result is returned?","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"9422f01e8fe723300e1a19acc97321aeb4873524","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def __init__(self, url, username, password):"},{"line_number":79,"context_line":"        \"\"\"Initialization function for JsessionId.\"\"\""},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        self.url \u003d str(url) + \u0027/\u0027 + ODL_NETWORKS"},{"line_number":82,"context_line":"        self.username \u003d username"},{"line_number":83,"context_line":"        self.password \u003d password"},{"line_number":84,"context_line":"        self.auth_cookies \u003d None"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2Fr7M%3D","line":81,"in_reply_to":"AAAAVn%2F%2F%2FTA%3D","updated":"2014-03-04 17:35:12.000000000","message":"ODL doesn\u0027t support pagination right now, sadly. Dave Tucker is going to implement a stopgap on the ODL side though, and work to fully implement pagination in the Helium timeframe.","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ad8d98074f0392adb8b929bb1189c04e1ee0cc05","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    This driver was a port from the Tail-F NCS MechanismDriver.  The API"},{"line_number":116,"context_line":"    exposed by ODL is slightly different from the API exposed by NCS,"},{"line_number":117,"context_line":"    but the general concepts are the same."},{"line_number":118,"context_line":"    \"\"\""},{"line_number":119,"context_line":"    auth \u003d None"},{"line_number":120,"context_line":"    out_of_sync \u003d True"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2F%2FSw%3D","line":117,"updated":"2014-03-02 22:51:16.000000000","message":"More pedantry: this docstring makes sense only to people who are ware of the Tail-F NCS mech driver...\n\n(no need to address, definetely not a blocker)","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ad8d98074f0392adb8b929bb1189c04e1ee0cc05","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def filter_create_port_attributes(self, port, context, dbcontext):"},{"line_number":176,"context_line":"        \"\"\"Filter out port attributes not required for a create.\"\"\""},{"line_number":177,"context_line":"        self.add_security_groups(context, dbcontext, port)"},{"line_number":178,"context_line":"        # TODO(kmestery): Converting to uppercase due to ODL bug"},{"line_number":179,"context_line":"        port[\u0027mac_address\u0027] \u003d port[\u0027mac_address\u0027].upper()"},{"line_number":180,"context_line":"        try_del(port, [\u0027status\u0027])"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2F%2FRk%3D","line":178,"updated":"2014-03-02 22:51:16.000000000","message":"pedant me says you should put the bug ID in the previous comment","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"9422f01e8fe723300e1a19acc97321aeb4873524","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def filter_create_port_attributes(self, port, context, dbcontext):"},{"line_number":176,"context_line":"        \"\"\"Filter out port attributes not required for a create.\"\"\""},{"line_number":177,"context_line":"        self.add_security_groups(context, dbcontext, port)"},{"line_number":178,"context_line":"        # TODO(kmestery): Converting to uppercase due to ODL bug"},{"line_number":179,"context_line":"        port[\u0027mac_address\u0027] \u003d port[\u0027mac_address\u0027].upper()"},{"line_number":180,"context_line":"        try_del(port, [\u0027status\u0027])"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2Fr6M%3D","line":178,"in_reply_to":"AAAAVn%2F%2F%2FRk%3D","updated":"2014-03-04 17:35:12.000000000","message":"Done","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ad8d98074f0392adb8b929bb1189c04e1ee0cc05","unresolved":false,"context_lines":[{"line_number":264,"context_line":"            urlpath \u003d object_type + \u0027/\u0027 + obj_id"},{"line_number":265,"context_line":"            method \u003d \u0027put\u0027"},{"line_number":266,"context_line":"        try:"},{"line_number":267,"context_line":"            obj_getter \u003d getattr(context._plugin, \u0027get_%s\u0027 % object_type[:-1])"},{"line_number":268,"context_line":"            resource \u003d obj_getter(dbcontext, obj_id)"},{"line_number":269,"context_line":"        except not_found_exception_map[object_type]:"},{"line_number":270,"context_line":"            LOG.debug(_(\u0027%(object_type)s not found (%(obj_id)s)\u0027),"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2F%2FPI%3D","line":267,"updated":"2014-03-02 22:51:16.000000000","message":"english grammar is thankfully so easy!","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ad8d98074f0392adb8b929bb1189c04e1ee0cc05","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        except not_found_exception_map[object_type]:"},{"line_number":270,"context_line":"            LOG.debug(_(\u0027%(object_type)s not found (%(obj_id)s)\u0027),"},{"line_number":271,"context_line":"                      {\u0027object_type\u0027: object_type.capitalize(),"},{"line_number":272,"context_line":"                      \u0027obj_id\u0027: obj_id})"},{"line_number":273,"context_line":"        else:"},{"line_number":274,"context_line":"            if operation \u003d\u003d \u0027create\u0027:"},{"line_number":275,"context_line":"                attr_filter_create(self, resource, context, dbcontext)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2F%2FOs%3D","line":272,"updated":"2014-03-02 22:51:16.000000000","message":"Should the exception be re-raised here?\n\nI think this condition might occur if the object was removed from the database before the postcommit was completed.\nIt is a tricky condition and perhaps it might be good let the user think that the create operation succeeded even if it was never propagated to the backend.","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"9422f01e8fe723300e1a19acc97321aeb4873524","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        except not_found_exception_map[object_type]:"},{"line_number":270,"context_line":"            LOG.debug(_(\u0027%(object_type)s not found (%(obj_id)s)\u0027),"},{"line_number":271,"context_line":"                      {\u0027object_type\u0027: object_type.capitalize(),"},{"line_number":272,"context_line":"                      \u0027obj_id\u0027: obj_id})"},{"line_number":273,"context_line":"        else:"},{"line_number":274,"context_line":"            if operation \u003d\u003d \u0027create\u0027:"},{"line_number":275,"context_line":"                attr_filter_create(self, resource, context, dbcontext)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2Fr5I%3D","line":272,"in_reply_to":"AAAAVn%2F%2F%2FOs%3D","updated":"2014-03-04 17:35:12.000000000","message":"I think failing before we create the object in the backend is ok here.","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ad8d98074f0392adb8b929bb1189c04e1ee0cc05","unresolved":false,"context_lines":[{"line_number":277,"context_line":"                attr_filter_update(self, resource, context, dbcontext)"},{"line_number":278,"context_line":"            try:"},{"line_number":279,"context_line":"                self.sendjson(method, urlpath, {object_type[:-1]: resource},"},{"line_number":280,"context_line":"                              [400])"},{"line_number":281,"context_line":"            except Exception:"},{"line_number":282,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":283,"context_line":"                    self.out_of_sync \u003d True"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2F%2FOE%3D","line":280,"updated":"2014-03-02 22:51:16.000000000","message":"I think it might be worth explaining why 400 errors are being ignored. This might have been already explained in another round of reviews, but it might be worth leaving it as a comment in the code.","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"9422f01e8fe723300e1a19acc97321aeb4873524","unresolved":false,"context_lines":[{"line_number":277,"context_line":"                attr_filter_update(self, resource, context, dbcontext)"},{"line_number":278,"context_line":"            try:"},{"line_number":279,"context_line":"                self.sendjson(method, urlpath, {object_type[:-1]: resource},"},{"line_number":280,"context_line":"                              [400])"},{"line_number":281,"context_line":"            except Exception:"},{"line_number":282,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":283,"context_line":"                    self.out_of_sync \u003d True"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2Fr38%3D","line":280,"in_reply_to":"AAAAVn%2F%2F%2FOE%3D","updated":"2014-03-04 17:35:12.000000000","message":"Done","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ad8d98074f0392adb8b929bb1189c04e1ee0cc05","unresolved":false,"context_lines":[{"line_number":279,"context_line":"                self.sendjson(method, urlpath, {object_type[:-1]: resource},"},{"line_number":280,"context_line":"                              [400])"},{"line_number":281,"context_line":"            except Exception:"},{"line_number":282,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":283,"context_line":"                    self.out_of_sync \u003d True"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def sync_object(self, operation, object_type, context):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2F%2FOQ%3D","line":282,"updated":"2014-03-02 22:51:16.000000000","message":"not user this is necessary here. Just a raise after line 283 might be enough.","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"9422f01e8fe723300e1a19acc97321aeb4873524","unresolved":false,"context_lines":[{"line_number":279,"context_line":"                self.sendjson(method, urlpath, {object_type[:-1]: resource},"},{"line_number":280,"context_line":"                              [400])"},{"line_number":281,"context_line":"            except Exception:"},{"line_number":282,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":283,"context_line":"                    self.out_of_sync \u003d True"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def sync_object(self, operation, object_type, context):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2Fr3o%3D","line":282,"in_reply_to":"AAAAVn%2F%2F%2FOQ%3D","updated":"2014-03-04 17:35:12.000000000","message":"Per Akihiro\u0027s comments from earlier, I think re-raising is ok here rather than a flat raise.","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"04f767d877e56d2e108216ab977eb31f79fbb763","unresolved":false,"context_lines":[{"line_number":279,"context_line":"                self.sendjson(method, urlpath, {object_type[:-1]: resource},"},{"line_number":280,"context_line":"                              [400])"},{"line_number":281,"context_line":"            except Exception:"},{"line_number":282,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":283,"context_line":"                    self.out_of_sync \u003d True"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def sync_object(self, operation, object_type, context):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FXbc%3D","line":282,"in_reply_to":"AAAAVn%2F%2Fr3o%3D","updated":"2014-03-06 15:49:17.000000000","message":"@Salvatore, Kyle,\n\nPrecisely speaking, we can use \"raise\" in this case because there is no greenthread swithing occurs. save_and_reraise_exception is required when e.g. some I/O operations are included.\n\nMy previous suggestion comes from the following thought.\nNeutron community is growing and not everyone knows the detail of greenthread switching, so I am suggesting to use save_and_reraise for such case recently. If someone add LOG.xxxx here, in my understanding it is better to use save_and_reraise. Of course it would be great if everyone knows the detail :-)\n\nIf I misunderstand, please correct me.","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ad8d98074f0392adb8b929bb1189c04e1ee0cc05","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                              [400])"},{"line_number":281,"context_line":"            except Exception:"},{"line_number":282,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":283,"context_line":"                    self.out_of_sync \u003d True"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":286,"context_line":"        \"\"\"Synchronize the single modified record to ODL.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2F%2FOU%3D","line":283,"updated":"2014-03-02 22:51:16.000000000","message":"I think triggering a full resync on every exception might be a little bit too much.\nFor instance, if the problem is a temporary connection error to the backend, won\u0027t it be better to have a try mechanism?\nAlso, if the problem is that somebody in the meanwhile has removed the object from the backend so that the PUT fails, won\u0027t it be better to retry it as a POST?","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"9422f01e8fe723300e1a19acc97321aeb4873524","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                              [400])"},{"line_number":281,"context_line":"            except Exception:"},{"line_number":282,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":283,"context_line":"                    self.out_of_sync \u003d True"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def sync_object(self, operation, object_type, context):"},{"line_number":286,"context_line":"        \"\"\"Synchronize the single modified record to ODL.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2Fr3Q%3D","line":283,"in_reply_to":"AAAAVn%2F%2F%2FOU%3D","updated":"2014-03-04 17:35:12.000000000","message":"Agreed, and this is something I can work on after this merges, unless you think this will be necessary before merging.","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ad8d98074f0392adb8b929bb1189c04e1ee0cc05","unresolved":false,"context_lines":[{"line_number":288,"context_line":"        obj_id \u003d context.current[\u0027id\u0027]"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        self.sync_single_resource(operation, object_type, obj_id, context,"},{"line_number":291,"context_line":"                                  dbcontext,"},{"line_number":292,"context_line":"                                  self.create_object_map[object_type],"},{"line_number":293,"context_line":"                                  self.update_object_map[object_type])"},{"line_number":294,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2F%2FQ8%3D","line":291,"updated":"2014-03-02 22:51:16.000000000","message":"more pedantry: if dbcontext is an attribute of context I\u0027m not sure why we need two parameters for sync_single_resource","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"9422f01e8fe723300e1a19acc97321aeb4873524","unresolved":false,"context_lines":[{"line_number":288,"context_line":"        obj_id \u003d context.current[\u0027id\u0027]"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        self.sync_single_resource(operation, object_type, obj_id, context,"},{"line_number":291,"context_line":"                                  dbcontext,"},{"line_number":292,"context_line":"                                  self.create_object_map[object_type],"},{"line_number":293,"context_line":"                                  self.update_object_map[object_type])"},{"line_number":294,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2Fr2w%3D","line":291,"in_reply_to":"AAAAVn%2F%2F%2FQ8%3D","updated":"2014-03-04 17:35:12.000000000","message":"Done","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"df75a4e23f8644956a61a54791fa5d869c75e039","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        for segment in context.network.network_segments:"},{"line_number":326,"context_line":"            if self.check_segment(segment):"},{"line_number":327,"context_line":"                context.set_binding(segment[api.ID],"},{"line_number":328,"context_line":"                                    self.vif_type,"},{"line_number":329,"context_line":"                                    self.vif_details)"},{"line_number":330,"context_line":"                LOG.debug(_(\"Bound using segment: %s\"), segment)"},{"line_number":331,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAU3%2F%2FalY%3D","line":328,"updated":"2014-02-26 19:13:53.000000000","message":"I\u0027m just curious, what would the vif_type be set to here?","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"22d308a9459e626b92d85f00f6f4209de873dc51","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        for segment in context.network.network_segments:"},{"line_number":326,"context_line":"            if self.check_segment(segment):"},{"line_number":327,"context_line":"                context.set_binding(segment[api.ID],"},{"line_number":328,"context_line":"                                    self.vif_type,"},{"line_number":329,"context_line":"                                    self.vif_details)"},{"line_number":330,"context_line":"                LOG.debug(_(\"Bound using segment: %s\"), segment)"},{"line_number":331,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVH%2F%2F%2F%2FA%3D","line":328,"in_reply_to":"AAAAU3%2F%2FalY%3D","updated":"2014-02-26 22:17:16.000000000","message":"portbindings.VIF_TYPE_OVS.","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35848a1f6b54d120a77dc664d91140b9f665cc34","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        for segment in context.network.network_segments:"},{"line_number":326,"context_line":"            if self.check_segment(segment):"},{"line_number":327,"context_line":"                context.set_binding(segment[api.ID],"},{"line_number":328,"context_line":"                                    self.vif_type,"},{"line_number":329,"context_line":"                                    self.vif_details)"},{"line_number":330,"context_line":"                LOG.debug(_(\"Bound using segment: %s\"), segment)"},{"line_number":331,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVH%2F%2F%2F7w%3D","line":328,"in_reply_to":"AAAAVH%2F%2F%2F%2FA%3D","updated":"2014-02-26 22:24:38.000000000","message":"OK (and again, I\u0027m just in learning mode here) based on this answer and the answer below, why isn\u0027t there a new VIF_TYPE_ODL type?","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"d08c6d84fe65200b2f99f874260c876087afc10f","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        for segment in context.network.network_segments:"},{"line_number":326,"context_line":"            if self.check_segment(segment):"},{"line_number":327,"context_line":"                context.set_binding(segment[api.ID],"},{"line_number":328,"context_line":"                                    self.vif_type,"},{"line_number":329,"context_line":"                                    self.vif_details)"},{"line_number":330,"context_line":"                LOG.debug(_(\"Bound using segment: %s\"), segment)"},{"line_number":331,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVX%2F%2F%2F6s%3D","line":328,"in_reply_to":"AAAAVH%2F%2F%2F7w%3D","updated":"2014-02-26 22:42:21.000000000","message":"Because the VIF is plugged into Open vSwitch. The vif_type represents what the virtual interface is. In this case, it\u0027s OVS. vif_type is not tied to agent.","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"d4cf9604365121c4df964fd533fbbe7c8b2d3076","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        for segment in context.network.network_segments:"},{"line_number":326,"context_line":"            if self.check_segment(segment):"},{"line_number":327,"context_line":"                context.set_binding(segment[api.ID],"},{"line_number":328,"context_line":"                                    self.vif_type,"},{"line_number":329,"context_line":"                                    self.vif_details)"},{"line_number":330,"context_line":"                LOG.debug(_(\"Bound using segment: %s\"), segment)"},{"line_number":331,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVX%2F%2F%2F%2FU%3D","line":328,"in_reply_to":"AAAAVH%2F%2F%2F7w%3D","updated":"2014-02-26 22:29:31.000000000","message":"you also mentioned below that ODL uses the OVSDB. can you explain how this db is accessed.","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"d08c6d84fe65200b2f99f874260c876087afc10f","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        for segment in context.network.network_segments:"},{"line_number":326,"context_line":"            if self.check_segment(segment):"},{"line_number":327,"context_line":"                context.set_binding(segment[api.ID],"},{"line_number":328,"context_line":"                                    self.vif_type,"},{"line_number":329,"context_line":"                                    self.vif_details)"},{"line_number":330,"context_line":"                LOG.debug(_(\"Bound using segment: %s\"), segment)"},{"line_number":331,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVX%2F%2F%2F6g%3D","line":328,"in_reply_to":"AAAAVX%2F%2F%2F%2FU%3D","updated":"2014-02-26 22:42:21.000000000","message":"This is way outside the scope of this review. Your best bet would be to jump on #opendaylight-ovsdb on Freenode and ping folks there. :)","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"df75a4e23f8644956a61a54791fa5d869c75e039","unresolved":false,"context_lines":[{"line_number":357,"context_line":"        False to indicate this to callers."},{"line_number":358,"context_line":"        \"\"\""},{"line_number":359,"context_line":"        network_type \u003d segment[api.NETWORK_TYPE]"},{"line_number":360,"context_line":"        return network_type in [constants.TYPE_LOCAL, constants.TYPE_FLAT,"},{"line_number":361,"context_line":"                                constants.TYPE_GRE, constants.TYPE_VXLAN]"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAU3%2F%2FakE%3D","line":360,"updated":"2014-02-26 19:13:53.000000000","message":"Another question based on ignorance, can the openvswitch mech driver be configured along w/ ODL?","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"29f1fd5b2e8c34ef11a625133f521f21eb2c8eff","unresolved":false,"context_lines":[{"line_number":357,"context_line":"        False to indicate this to callers."},{"line_number":358,"context_line":"        \"\"\""},{"line_number":359,"context_line":"        network_type \u003d segment[api.NETWORK_TYPE]"},{"line_number":360,"context_line":"        return network_type in [constants.TYPE_LOCAL, constants.TYPE_FLAT,"},{"line_number":361,"context_line":"                                constants.TYPE_GRE, constants.TYPE_VXLAN]"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2F5Hk%3D","line":360,"updated":"2014-03-03 15:59:17.000000000","message":"For TYPE_FLAT, does check_segment() need to verify connectivity to the segment\u0027s physical_network?","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"22d308a9459e626b92d85f00f6f4209de873dc51","unresolved":false,"context_lines":[{"line_number":357,"context_line":"        False to indicate this to callers."},{"line_number":358,"context_line":"        \"\"\""},{"line_number":359,"context_line":"        network_type \u003d segment[api.NETWORK_TYPE]"},{"line_number":360,"context_line":"        return network_type in [constants.TYPE_LOCAL, constants.TYPE_FLAT,"},{"line_number":361,"context_line":"                                constants.TYPE_GRE, constants.TYPE_VXLAN]"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVH%2F%2F%2F%2B0%3D","line":360,"in_reply_to":"AAAAU3%2F%2FakE%3D","updated":"2014-02-26 22:17:16.000000000","message":"No. The main value proposition of ODL is that it doesn\u0027t require a host agent. ODL uses OpenFlow and OVSDB to program networks on the host.","commit_id":"17834696dbd074fdc9bbf971c215eb0d795fd2a1"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"769dd546d24719f256fe19788c6aca0bda94bd5d","unresolved":false,"context_lines":[{"line_number":270,"context_line":"        else:"},{"line_number":271,"context_line":"            urlpath \u003d object_type + \u0027/\u0027 + obj_id"},{"line_number":272,"context_line":"            method \u003d \u0027put\u0027"},{"line_number":273,"context_line":"        try:"},{"line_number":274,"context_line":"            obj_getter \u003d getattr(context._plugin, \u0027get_%s\u0027 % object_type[:-1])"},{"line_number":275,"context_line":"            resource \u003d obj_getter(dbcontext, obj_id)"},{"line_number":276,"context_line":"        except not_found_exception_map[object_type]:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2FpVM%3D","line":273,"updated":"2014-03-04 21:40:32.000000000","message":"consider putting a blank line above the \"try:\". \nMy eyes were treating this as one long conditional.","commit_id":"1d1e1e19a0b02c2340d3a35ba2d91e581935354f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"fffa06ac675da02a265ed1059706093032c8a397","unresolved":false,"context_lines":[{"line_number":270,"context_line":"        else:"},{"line_number":271,"context_line":"            urlpath \u003d object_type + \u0027/\u0027 + obj_id"},{"line_number":272,"context_line":"            method \u003d \u0027put\u0027"},{"line_number":273,"context_line":"        try:"},{"line_number":274,"context_line":"            obj_getter \u003d getattr(context._plugin, \u0027get_%s\u0027 % object_type[:-1])"},{"line_number":275,"context_line":"            resource \u003d obj_getter(dbcontext, obj_id)"},{"line_number":276,"context_line":"        except not_found_exception_map[object_type]:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2FfH8%3D","line":273,"in_reply_to":"AAAAVn%2F%2FpVM%3D","updated":"2014-03-05 20:00:48.000000000","message":"Done","commit_id":"1d1e1e19a0b02c2340d3a35ba2d91e581935354f"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"769dd546d24719f256fe19788c6aca0bda94bd5d","unresolved":false,"context_lines":[{"line_number":307,"context_line":"    def sendjson(self, method, urlpath, obj, ignorecodes\u003d[]):"},{"line_number":308,"context_line":"        \"\"\"Send json to the OpenDaylight controller."},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"        ignorecodes contains a list of HTTP error codes to ignore."},{"line_number":311,"context_line":"        \"\"\""},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"        headers \u003d {\u0027Content-Type\u0027: \u0027application/json\u0027}"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2Fpa0%3D","line":310,"updated":"2014-03-04 21:40:32.000000000","message":"unless there\u0027s a reason for having this comment to be in the docstring, I\u0027d move it to be a comment above the \nif r.status_code in ignorecodes: line.","commit_id":"1d1e1e19a0b02c2340d3a35ba2d91e581935354f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"fffa06ac675da02a265ed1059706093032c8a397","unresolved":false,"context_lines":[{"line_number":307,"context_line":"    def sendjson(self, method, urlpath, obj, ignorecodes\u003d[]):"},{"line_number":308,"context_line":"        \"\"\"Send json to the OpenDaylight controller."},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"        ignorecodes contains a list of HTTP error codes to ignore."},{"line_number":311,"context_line":"        \"\"\""},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"        headers \u003d {\u0027Content-Type\u0027: \u0027application/json\u0027}"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2FfIM%3D","line":310,"in_reply_to":"AAAAVn%2F%2Fpa0%3D","updated":"2014-03-05 20:00:48.000000000","message":"Done","commit_id":"1d1e1e19a0b02c2340d3a35ba2d91e581935354f"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"769dd546d24719f256fe19788c6aca0bda94bd5d","unresolved":false,"context_lines":[{"line_number":348,"context_line":"        if self.check_segment(context.bound_segment):"},{"line_number":349,"context_line":"            LOG.debug(_(\u0027Binding valid.\u0027))"},{"line_number":350,"context_line":"            return True"},{"line_number":351,"context_line":"        LOG.warning(_(\"Binding invalid for port: %s\"), context.current)"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    def unbind_port(self, context):"},{"line_number":354,"context_line":"        LOG.debug(_(\"Unbinding port %(port)s on \""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2Fpg0%3D","line":351,"updated":"2014-03-04 21:40:32.000000000","message":"This method may be going away but to be safe\nI think you should add \"return False\" here or even add\nelse:\n     LOG.warning(...)\n     return False","commit_id":"1d1e1e19a0b02c2340d3a35ba2d91e581935354f"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"7d891abafcd39e4a62d4176a315b99b97b503b76","unresolved":false,"context_lines":[{"line_number":349,"context_line":"            LOG.debug(_(\u0027Binding valid.\u0027))"},{"line_number":350,"context_line":"            return True"},{"line_number":351,"context_line":"        LOG.warning(_(\"Binding invalid for port: %s\"), context.current)"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    def unbind_port(self, context):"},{"line_number":354,"context_line":"        LOG.debug(_(\"Unbinding port %(port)s on \""},{"line_number":355,"context_line":"                    \"network %(network)s\"),"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2Fo2I%3D","line":352,"updated":"2014-03-04 22:28:58.000000000","message":"Just saw this comment from another review (code was returning alse), \"Unless you\u0027re comparing using \u0027is False\u0027 the implicit return None should work here.\". So ignore my first comment. (wonderful world of python)","commit_id":"1d1e1e19a0b02c2340d3a35ba2d91e581935354f"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"769dd546d24719f256fe19788c6aca0bda94bd5d","unresolved":false,"context_lines":[{"line_number":357,"context_line":"                   \u0027network\u0027: context.network.current[\u0027id\u0027]})"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"    def check_segment(self, segment):"},{"line_number":360,"context_line":"        \"\"\"Verify a segment is valid for the OpenDaylight MechanismDriver"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"        Verify the requested segment is supported by ODL and return True or"},{"line_number":363,"context_line":"        False to indicate this to callers."}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2Fpgs%3D","line":360,"updated":"2014-03-04 21:40:32.000000000","message":"period at end of sentence.","commit_id":"1d1e1e19a0b02c2340d3a35ba2d91e581935354f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"fffa06ac675da02a265ed1059706093032c8a397","unresolved":false,"context_lines":[{"line_number":357,"context_line":"                   \u0027network\u0027: context.network.current[\u0027id\u0027]})"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"    def check_segment(self, segment):"},{"line_number":360,"context_line":"        \"\"\"Verify a segment is valid for the OpenDaylight MechanismDriver"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"        Verify the requested segment is supported by ODL and return True or"},{"line_number":363,"context_line":"        False to indicate this to callers."}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2FfJM%3D","line":360,"in_reply_to":"AAAAVn%2F%2Fpgs%3D","updated":"2014-03-05 20:00:48.000000000","message":"Done","commit_id":"1d1e1e19a0b02c2340d3a35ba2d91e581935354f"},{"author":{"_account_id":8499,"name":"Racha Ben Ali","email":"benali@gmail.com","username":"rbenali"},"change_message_id":"1fa3c4e48631238932d8838dad11f8617028bd19","unresolved":false,"context_lines":[{"line_number":364,"context_line":"        \"\"\""},{"line_number":365,"context_line":"        network_type \u003d segment[api.NETWORK_TYPE]"},{"line_number":366,"context_line":"        return network_type in [constants.TYPE_LOCAL, constants.TYPE_FLAT,"},{"line_number":367,"context_line":"                                constants.TYPE_GRE, constants.TYPE_VXLAN]"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2Fox0%3D","line":367,"updated":"2014-03-04 22:38:47.000000000","message":"sorry if I missed any related discussion and for the disturbance here, I am just curious if there\u0027s any limitation in supporting TYPE_VLAN in ODL, since OVSDB already supports isolating tenants networks based on VLANs?","commit_id":"1d1e1e19a0b02c2340d3a35ba2d91e581935354f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"fffa06ac675da02a265ed1059706093032c8a397","unresolved":false,"context_lines":[{"line_number":364,"context_line":"        \"\"\""},{"line_number":365,"context_line":"        network_type \u003d segment[api.NETWORK_TYPE]"},{"line_number":366,"context_line":"        return network_type in [constants.TYPE_LOCAL, constants.TYPE_FLAT,"},{"line_number":367,"context_line":"                                constants.TYPE_GRE, constants.TYPE_VXLAN]"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2FfKI%3D","line":367,"in_reply_to":"AAAAVn%2F%2FnFM%3D","updated":"2014-03-05 20:00:48.000000000","message":"Done","commit_id":"1d1e1e19a0b02c2340d3a35ba2d91e581935354f"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"72c6a1ff0bc004ccc3c9e62e0751dff7ab98abc4","unresolved":false,"context_lines":[{"line_number":364,"context_line":"        \"\"\""},{"line_number":365,"context_line":"        network_type \u003d segment[api.NETWORK_TYPE]"},{"line_number":366,"context_line":"        return network_type in [constants.TYPE_LOCAL, constants.TYPE_FLAT,"},{"line_number":367,"context_line":"                                constants.TYPE_GRE, constants.TYPE_VXLAN]"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2FnFM%3D","line":367,"in_reply_to":"AAAAVn%2F%2Fogw%3D","updated":"2014-03-05 03:30:45.000000000","message":"I had asked about whether the physical_network needs to be checked for flat networks in an earlier patch, but it sounds like ODL doesn\u0027t support flat yet at all. If so, TYPE_FLAT should be removed from the list.","commit_id":"1d1e1e19a0b02c2340d3a35ba2d91e581935354f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"67b6f36951ae39dcbcd43ed152768e53d3cab3db","unresolved":false,"context_lines":[{"line_number":364,"context_line":"        \"\"\""},{"line_number":365,"context_line":"        network_type \u003d segment[api.NETWORK_TYPE]"},{"line_number":366,"context_line":"        return network_type in [constants.TYPE_LOCAL, constants.TYPE_FLAT,"},{"line_number":367,"context_line":"                                constants.TYPE_GRE, constants.TYPE_VXLAN]"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2Fogw%3D","line":367,"in_reply_to":"AAAAVn%2F%2Fox0%3D","updated":"2014-03-04 23:09:45.000000000","message":"The OVSDB code in OpenDaylight only supports tunnel networks for now, which is why we don\u0027t support that type here. Once ODL adds support for that, we can enable it here as well.","commit_id":"1d1e1e19a0b02c2340d3a35ba2d91e581935354f"}],"neutron/tests/unit/ml2/test_mechanism_odl.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4275804d297f5c87e04e4398bf698f38bdd1cf53","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BLPs%3D","line":1,"updated":"2014-01-29 12:38:13.000000000","message":"add 2014","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"bb17f7e04475019da0326a58b57ba278b2e16470","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F979g%3D","line":1,"in_reply_to":"AAAAUH%2F%2BLPs%3D","updated":"2014-01-31 23:05:14.000000000","message":"Done","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        config.cfg.CONF.set_override(\u0027mechanism_drivers\u0027,"},{"line_number":33,"context_line":"                                     [\u0027logger\u0027, \u0027opendaylight\u0027],"},{"line_number":34,"context_line":"                                     \u0027ml2\u0027)"},{"line_number":35,"context_line":"        self.addCleanup(config.cfg.CONF.reset)"},{"line_number":36,"context_line":"        super(OpenDaylightTestCase, self).setUp(PLUGIN_NAME)"},{"line_number":37,"context_line":"        self.port_create_status \u003d \u0027DOWN\u0027"},{"line_number":38,"context_line":"        self.segment \u003d {\u0027api.NETWORK_TYPE\u0027: \"\"}"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vqQ%3D","line":35,"updated":"2014-02-04 14:33:34.000000000","message":"neutron.test.base registers this, so we don\u0027t need it.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6a080d3cea03c0d87b3ee6b119860d67bec43eac","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def check_sendjson(self, method, urlpath, obj):"},{"line_number":44,"context_line":"        self.assertFalse(urlpath.startswith(\"http://\"))"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def test_check_segment(self):"},{"line_number":47,"context_line":"        \"\"\"Validate the check_segment call.\"\"\""},{"line_number":48,"context_line":"        self.segment[api.NETWORK_TYPE] \u003d constants.TYPE_LOCAL"},{"line_number":49,"context_line":"        self.assertTrue(self.mech.check_segment(self.segment))"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F9vo8%3D","line":46,"updated":"2014-02-04 14:33:34.000000000","message":"This test is mech-driver level test. I would like to suggest splitting ML2 plugin level tests and ODL driver level test. If so, we can avoid to run this test three times and it makes it easier to maintain the test.","commit_id":"7a7cf4960c18c290d10bc8f863395a79abb06f33"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1a0372421872077ee87036cadcccf2af12479f4a","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        config.cfg.CONF.set_override(\u0027mechanism_drivers\u0027,"},{"line_number":33,"context_line":"                                     [\u0027logger\u0027, \u0027opendaylight\u0027],"},{"line_number":34,"context_line":"                                     \u0027ml2\u0027)"},{"line_number":35,"context_line":"        self.addCleanup(config.cfg.CONF.reset)"},{"line_number":36,"context_line":"        super(OpenDaylightTestCase, self).setUp(PLUGIN_NAME)"},{"line_number":37,"context_line":"        self.port_create_status \u003d \u0027DOWN\u0027"},{"line_number":38,"context_line":"        self.segment \u003d {\u0027api.NETWORK_TYPE\u0027: \"\"}"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9nJA%3D","line":35,"updated":"2014-02-05 17:21:42.000000000","message":"It is unnecessay. it is registered in BaseTestCase already.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        config.cfg.CONF.set_override(\u0027mechanism_drivers\u0027,"},{"line_number":33,"context_line":"                                     [\u0027logger\u0027, \u0027opendaylight\u0027],"},{"line_number":34,"context_line":"                                     \u0027ml2\u0027)"},{"line_number":35,"context_line":"        self.addCleanup(config.cfg.CONF.reset)"},{"line_number":36,"context_line":"        super(OpenDaylightTestCase, self).setUp(PLUGIN_NAME)"},{"line_number":37,"context_line":"        self.port_create_status \u003d \u0027DOWN\u0027"},{"line_number":38,"context_line":"        self.segment \u003d {\u0027api.NETWORK_TYPE\u0027: \"\"}"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F6Bk%3D","line":35,"in_reply_to":"AAAAUH%2F9nJA%3D","updated":"2014-02-10 16:50:58.000000000","message":"Done","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c5dcf7de02ee498a55adef265170d8001feac452","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        self.assertFalse(self.mech.check_segment(self.segment))"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class OpenDaylightMechanismTestBasicGet(test_plugin.TestBasicGet,"},{"line_number":64,"context_line":"                                        OpenDaylightTestCase):"},{"line_number":65,"context_line":"    pass"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F9pLs%3D","line":63,"updated":"2014-02-05 12:00:41.000000000","message":"Do any of these inherited test cases check the syncing operations, which contain the most complexity in the change set?","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"89caa9fd3b552cec76107083ee88dca85433790a","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        self.assertFalse(self.mech.check_segment(self.segment))"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class OpenDaylightMechanismTestBasicGet(test_plugin.TestBasicGet,"},{"line_number":64,"context_line":"                                        OpenDaylightTestCase):"},{"line_number":65,"context_line":"    pass"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUX%2F%2F6BY%3D","line":63,"in_reply_to":"AAAAUH%2F9pLs%3D","updated":"2014-02-10 16:50:58.000000000","message":"No, I will add some additional unit tests to cover that.","commit_id":"06990aec961733063109f4528b925df1504b109f"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"58da182a017a818bc9567f9eed12454fbe30ef48","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"class OpenDaylightMechanismTestNetworksV2(test_plugin.TestNetworksV2,"},{"line_number":68,"context_line":"                                          OpenDaylightTestCase):"},{"line_number":69,"context_line":"    pass"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"class OpenDaylightMechanismTestPortsV2(test_plugin.TestPortsV2,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FXYk%3D","line":69,"updated":"2014-02-13 17:47:02.000000000","message":"ODL MD has operations for subnets. It is better to cover subnet testcase.","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"1fdef27e2469b7d88f7f7d6bc96ee16c4ba3ec27","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"class OpenDaylightMechanismTestNetworksV2(test_plugin.TestNetworksV2,"},{"line_number":68,"context_line":"                                          OpenDaylightTestCase):"},{"line_number":69,"context_line":"    pass"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"class OpenDaylightMechanismTestPortsV2(test_plugin.TestPortsV2,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FWjE%3D","line":69,"in_reply_to":"AAAAUX%2F%2FXYk%3D","updated":"2014-02-13 20:01:27.000000000","message":"Done","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"35876c27c224d44485a5b101d36a79aa5ffecf01","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        mechanism_odl.OpenDaylightMechanismDriver.sendjson \u003d ("},{"line_number":40,"context_line":"            self.check_sendjson)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def check_sendjson(self, method, urlpath, obj, ignorecodes\u003d[None]):"},{"line_number":43,"context_line":"        self.assertFalse(urlpath.startswith(\"http://\"))"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def test_check_segment(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FuSI%3D","line":42,"updated":"2014-02-25 04:37:41.000000000","message":"ignorecodes\u003d[]","commit_id":"88ac61cd6144024d9ad925166c97c216e51c52eb"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"c1237398391ad5900455a095616814780f41582e","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        mechanism_odl.OpenDaylightMechanismDriver.sendjson \u003d ("},{"line_number":40,"context_line":"            self.check_sendjson)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def check_sendjson(self, method, urlpath, obj, ignorecodes\u003d[None]):"},{"line_number":43,"context_line":"        self.assertFalse(urlpath.startswith(\"http://\"))"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def test_check_segment(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FpNA%3D","line":42,"in_reply_to":"AAAAU3%2F%2FuSI%3D","updated":"2014-02-25 14:06:20.000000000","message":"Done","commit_id":"88ac61cd6144024d9ad925166c97c216e51c52eb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"69d3f25ef3143273163d4407ffbb64de59a4647f","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        self.segment \u003d {\u0027api.NETWORK_TYPE\u0027: \"\"}"},{"line_number":38,"context_line":"        self.mech \u003d mechanism_odl.OpenDaylightMechanismDriver()"},{"line_number":39,"context_line":"        mechanism_odl.OpenDaylightMechanismDriver.sendjson \u003d ("},{"line_number":40,"context_line":"            self.check_sendjson)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def check_sendjson(self, method, urlpath, obj, ignorecodes\u003d[]):"},{"line_number":43,"context_line":"        self.assertFalse(urlpath.startswith(\"http://\"))"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAU3%2F%2FnNU%3D","line":40,"updated":"2014-02-25 17:25:53.000000000","message":"Nit: replacing the original object is not a good idea because it is not restored after a test. Please use mock instead. I think the following should work.\n\n  self.addCleanup(mock.patch.stopall)\n  mock.patch.object(\n      mechanism_odl.OpenDaylightMechanismDriver,\n      \u0027sendjson\u0027,\n      new\u003dself.check_sendjson).start()","commit_id":"6f1ce9330683e287a94cd84fe8f5fbab3db1647f"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"3731ae047fb06072014c8ed78e26bb1114e8c25d","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        self.segment \u003d {\u0027api.NETWORK_TYPE\u0027: \"\"}"},{"line_number":38,"context_line":"        self.mech \u003d mechanism_odl.OpenDaylightMechanismDriver()"},{"line_number":39,"context_line":"        mechanism_odl.OpenDaylightMechanismDriver.sendjson \u003d ("},{"line_number":40,"context_line":"            self.check_sendjson)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def check_sendjson(self, method, urlpath, obj, ignorecodes\u003d[]):"},{"line_number":43,"context_line":"        self.assertFalse(urlpath.startswith(\"http://\"))"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAU3%2F%2Flo8%3D","line":40,"in_reply_to":"AAAAU3%2F%2FnNU%3D","updated":"2014-02-25 19:29:23.000000000","message":"That makes sense to me Akihiro, thanks!","commit_id":"6f1ce9330683e287a94cd84fe8f5fbab3db1647f"}],"setup.cfg":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"58da182a017a818bc9567f9eed12454fbe30ef48","unresolved":false,"context_lines":[{"line_number":149,"context_line":"    gre \u003d neutron.plugins.ml2.drivers.type_gre:GreTypeDriver"},{"line_number":150,"context_line":"    vxlan \u003d neutron.plugins.ml2.drivers.type_vxlan:VxlanTypeDriver"},{"line_number":151,"context_line":"neutron.ml2.mechanism_drivers \u003d"},{"line_number":152,"context_line":"    opendaylight \u003d neutron.plugins.ml2.drivers.mechanism_odl:OpenDaylightMechanismDriver"},{"line_number":153,"context_line":"    logger \u003d neutron.tests.unit.ml2.drivers.mechanism_logger:LoggerMechanismDriver"},{"line_number":154,"context_line":"    test \u003d neutron.tests.unit.ml2.drivers.mechanism_test:TestMechanismDriver"},{"line_number":155,"context_line":"    bulkless \u003d neutron.tests.unit.ml2.drivers.mechanism_bulkless:BulklessMechanismDriver"}],"source_content_type":"text/x-ttcn-cfg","patch_set":5,"id":"AAAAUX%2F%2FXXg%3D","line":152,"updated":"2014-02-13 17:47:02.000000000","message":"(question) Is there any order convention for ML2 driver definitions?","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"1fdef27e2469b7d88f7f7d6bc96ee16c4ba3ec27","unresolved":false,"context_lines":[{"line_number":149,"context_line":"    gre \u003d neutron.plugins.ml2.drivers.type_gre:GreTypeDriver"},{"line_number":150,"context_line":"    vxlan \u003d neutron.plugins.ml2.drivers.type_vxlan:VxlanTypeDriver"},{"line_number":151,"context_line":"neutron.ml2.mechanism_drivers \u003d"},{"line_number":152,"context_line":"    opendaylight \u003d neutron.plugins.ml2.drivers.mechanism_odl:OpenDaylightMechanismDriver"},{"line_number":153,"context_line":"    logger \u003d neutron.tests.unit.ml2.drivers.mechanism_logger:LoggerMechanismDriver"},{"line_number":154,"context_line":"    test \u003d neutron.tests.unit.ml2.drivers.mechanism_test:TestMechanismDriver"},{"line_number":155,"context_line":"    bulkless \u003d neutron.tests.unit.ml2.drivers.mechanism_bulkless:BulklessMechanismDriver"}],"source_content_type":"text/x-ttcn-cfg","patch_set":5,"id":"AAAAUX%2F%2FWi4%3D","line":152,"in_reply_to":"AAAAUX%2F%2FXXg%3D","updated":"2014-02-13 20:01:27.000000000","message":"None so far that I am aware of.","commit_id":"77fe4c17d7ea7ca335d064934da78af1e11785e2"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"edbd6f0c2ed95e90375a8b29a8d6a452004a27bb","unresolved":false,"context_lines":[{"line_number":149,"context_line":"    vlan \u003d neutron.plugins.ml2.drivers.type_vlan:VlanTypeDriver"},{"line_number":150,"context_line":"    gre \u003d neutron.plugins.ml2.drivers.type_gre:GreTypeDriver"},{"line_number":151,"context_line":"    vxlan \u003d neutron.plugins.ml2.drivers.type_vxlan:VxlanTypeDriver"},{"line_number":152,"context_line":"neutron.ml2.mechanism_drivers \u003d"},{"line_number":153,"context_line":"    opendaylight \u003d neutron.plugins.ml2.drivers.mechanism_odl:OpenDaylightMechanismDriver"},{"line_number":154,"context_line":"    logger \u003d neutron.tests.unit.ml2.drivers.mechanism_logger:LoggerMechanismDriver"},{"line_number":155,"context_line":"    test \u003d neutron.tests.unit.ml2.drivers.mechanism_test:TestMechanismDriver"}],"source_content_type":"text/x-ttcn-cfg","patch_set":9,"id":"AAAAUX%2F%2B06w%3D","line":152,"updated":"2014-02-18 19:13:51.000000000","message":"do you need to add your *.ini to the data_files section above?","commit_id":"86bb44fe339bbc364e2503bddcb37478de928536"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"138cc814d53429d23d203037dde179474701296d","unresolved":false,"context_lines":[{"line_number":149,"context_line":"    vlan \u003d neutron.plugins.ml2.drivers.type_vlan:VlanTypeDriver"},{"line_number":150,"context_line":"    gre \u003d neutron.plugins.ml2.drivers.type_gre:GreTypeDriver"},{"line_number":151,"context_line":"    vxlan \u003d neutron.plugins.ml2.drivers.type_vxlan:VxlanTypeDriver"},{"line_number":152,"context_line":"neutron.ml2.mechanism_drivers \u003d"},{"line_number":153,"context_line":"    opendaylight \u003d neutron.plugins.ml2.drivers.mechanism_odl:OpenDaylightMechanismDriver"},{"line_number":154,"context_line":"    logger \u003d neutron.tests.unit.ml2.drivers.mechanism_logger:LoggerMechanismDriver"},{"line_number":155,"context_line":"    test \u003d neutron.tests.unit.ml2.drivers.mechanism_test:TestMechanismDriver"}],"source_content_type":"text/x-ttcn-cfg","patch_set":9,"id":"AAAAUX%2F%2Bups%3D","line":152,"in_reply_to":"AAAAUX%2F%2B06w%3D","updated":"2014-02-19 14:36:12.000000000","message":"Done","commit_id":"86bb44fe339bbc364e2503bddcb37478de928536"}]}
