)]}'
{"bin/quantum-dhcp-agent":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import os"},{"line_number":20,"context_line":"import sys"},{"line_number":21,"context_line":"sys.path.insert(0, os.getcwd())"},{"line_number":22,"context_line":"from quantum.agent.dhcp_agent import main"},{"line_number":23,"context_line":"main(sys.argv)"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAAI3%2F%2F62A%3D","line":21,"updated":"2012-06-28 01:41:44.000000000","message":"I\u0027ve seen this in the other quantum scripts - why is it necessary?  Shouldn\u0027t quantum be in the python path?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import sys"},{"line_number":20,"context_line":"from quantum.agent.dhcp_agent import main"},{"line_number":21,"context_line":"main(sys.argv)"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAAJ3%2F%2F%2FxM%3D","line":21,"updated":"2012-07-02 05:36:40.000000000","message":"do you envision this having its own config file, or using quantum.conf?  Is there an example config somewhere?  We\u0027ve done that so far, though I guess its not technically necessary.\n\nWe\u0027ll need to get devstack support for this asap though.","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import sys"},{"line_number":20,"context_line":"from quantum.agent.dhcp_agent import main"},{"line_number":21,"context_line":"main(sys.argv)"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"AAAAJ3%2F%2F9kw%3D","line":21,"updated":"2012-07-04 07:51:12.000000000","message":"When running the agent I get the following:\nopenstack@openstack:/opt/stack/quantum$ sudo quantum-dhcp-agent etc/dhcp_agent.ini \nTraceback (most recent call last):\n  File \"/usr/local/bin/quantum-dhcp-agent\", line 10, in \u003cmodule\u003e\n    load_entry_point(\u0027quantum\u003d\u003d2012.2\u0027, \u0027console_scripts\u0027, \u0027quantum-dhcp-agent\u0027)()\nTypeError: main() takes exactly 1 argument (0 given)\nopenstack@openstack:/opt/stack/quantum$ \n\nYou should maybe condsider doing (and please look at dhcp-agent.py)\nimport os\nimport sys\nsys.path.insert(0, os.getcwd())\nfrom quantum.agent.dhcp_agent import main\nmain()","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import sys"},{"line_number":20,"context_line":"from quantum.agent.dhcp_agent import main"},{"line_number":21,"context_line":"main(sys.argv)"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"AAAAKH%2F%2F%2FsE%3D","line":21,"in_reply_to":"AAAAJ3%2F%2F9kw%3D","updated":"2012-07-05 11:17:25.000000000","message":"Please ignore this comment. It is not relevant.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"}],"etc/dhcp_agent.ini":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":1,"context_line":"[DEFAULT]"},{"line_number":2,"context_line":"state_path \u003d /tmp/quantum"},{"line_number":3,"context_line":"db_connection \u003d mysql://root:password@localhost/ovs_quantum?charset\u003dutf8"},{"line_number":4,"context_line":"interface_driver \u003d quantum.agent.linux.interface.OVSInterfaceDriver"},{"line_number":5,"context_line":"dhcp_driver \u003d quantum.agent.linux.dhcp.Dnsmasq"},{"line_number":6,"context_line":"debug \u003d true"},{"line_number":7,"context_line":""}],"source_content_type":"text/x-properties","patch_set":4,"id":"AAAAJ3%2F%2F%2BBA%3D","line":4,"updated":"2012-07-03 21:07:18.000000000","message":"would be good if we could make it clear that these fields need to be changed depending on your plugin (maybe even have example configs for OVS + LB)?","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":4,"context_line":""},{"line_number":5,"context_line":"# Where to store dnsmasq state files.  This directory must be writable by the"},{"line_number":6,"context_line":"# user executing the agent."},{"line_number":7,"context_line":"state_path \u003d /tmp/quantum"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"# The DHCP requires that an inteface driver be set.  Choose the one that best "}],"source_content_type":"text/x-properties","patch_set":5,"id":"AAAAJ3%2F%2F9mI%3D","line":7,"updated":"2012-07-04 07:11:14.000000000","message":"Please take a look at http://0pointer.de/blog/projects/tmp.html. It is an interesting read.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":7,"context_line":"state_path \u003d /tmp/quantum"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"# The DHCP requires that an inteface driver be set.  Choose the one that best "},{"line_number":11,"context_line":"# matches you plugin."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"# OVS"}],"source_content_type":"text/x-properties","patch_set":5,"id":"AAAAJ3%2F%2F9rI%3D","line":10,"updated":"2012-07-04 02:43:43.000000000","message":"remove the trailing space.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":7,"context_line":"state_path \u003d /tmp/quantum"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"# The DHCP requires that an inteface driver be set.  Choose the one that best "},{"line_number":11,"context_line":"# matches you plugin."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"# OVS"}],"source_content_type":"text/x-properties","patch_set":5,"id":"AAAAKH%2F%2F%2FgY%3D","line":10,"in_reply_to":"AAAAJ3%2F%2F9rI%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"# The DHCP requires that an inteface driver be set.  Choose the one that best "},{"line_number":11,"context_line":"# matches you plugin."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"# OVS"},{"line_number":14,"context_line":"interface_driver \u003d quantum.agent.linux.interface.OVSInterfaceDriver"}],"source_content_type":"text/x-properties","patch_set":5,"id":"AAAAKH%2F%2F%2B98%3D","line":11,"updated":"2012-07-05 23:12:49.000000000","message":"(optional comment - nit pickery) \"your plugin\"","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"# The agent can use other DHCP drivers.  Dnsmasq is the simplest and requires"},{"line_number":19,"context_line":"# no additional setup of the DHCP server."},{"line_number":20,"context_line":"dhcp_driver \u003d quantum.agent.linux.dhcp.Dnsmasq"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"#"},{"line_number":23,"context_line":"# Temporary F2 variables until the Agent \u003c\u003e Quantum Server is reworked in F3"}],"source_content_type":"text/x-properties","patch_set":5,"id":"AAAAKH%2F%2F%2B9Y%3D","line":20,"updated":"2012-07-05 23:12:49.000000000","message":"(just an observation) Did you consider whether this should be regarded as a plugin rather than a driver?","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"# The agent can use other DHCP drivers.  Dnsmasq is the simplest and requires"},{"line_number":19,"context_line":"# no additional setup of the DHCP server."},{"line_number":20,"context_line":"dhcp_driver \u003d quantum.agent.linux.dhcp.Dnsmasq"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"#"},{"line_number":23,"context_line":"# Temporary F2 variables until the Agent \u003c\u003e Quantum Server is reworked in F3"}],"source_content_type":"text/x-properties","patch_set":5,"id":"AAAAKH%2F%2F%2BpI%3D","line":20,"in_reply_to":"AAAAKH%2F%2F%2B9Y%3D","updated":"2012-07-06 18:26:19.000000000","message":"I considered it.  I was afraid if I called it a plugin then it would be confusing with the implementation plug-ins.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":30,"context_line":"auth_region \u003d RegionOne"},{"line_number":31,"context_line":"admin_tenant_name \u003d service"},{"line_number":32,"context_line":"admin_user \u003d quantum"},{"line_number":33,"context_line":"admin_password \u003d password"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-properties","patch_set":5,"id":"AAAAJ3%2F%2F9rE%3D","line":33,"updated":"2012-07-04 02:43:43.000000000","message":"I think we can group the options in the file so that it will look better. Such as QuantumServer, Driver, or others","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":30,"context_line":"auth_region \u003d RegionOne"},{"line_number":31,"context_line":"admin_tenant_name \u003d service"},{"line_number":32,"context_line":"admin_user \u003d quantum"},{"line_number":33,"context_line":"admin_password \u003d password"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-properties","patch_set":5,"id":"AAAAKH%2F%2F%2B9M%3D","line":33,"updated":"2012-07-05 23:12:49.000000000","message":"Ok - but maybe we could benefit by replacing their values with %SERVICE_USER% %SERVICE_PASSWORD% and so on.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":30,"context_line":"auth_region \u003d RegionOne"},{"line_number":31,"context_line":"admin_tenant_name \u003d service"},{"line_number":32,"context_line":"admin_user \u003d quantum"},{"line_number":33,"context_line":"admin_password \u003d password"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-properties","patch_set":5,"id":"AAAAJ3%2F%2F9lw%3D","line":33,"in_reply_to":"AAAAJ3%2F%2F9rE%3D","updated":"2012-07-04 07:11:15.000000000","message":"based on the comment about, some of these variables at least are likely to change when this is reworked in F3.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":3,"context_line":"# debug \u003d true"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"# Where to store dnsmasq state files.  This directory must be writable by the"},{"line_number":6,"context_line":"# user executing the agent. The value below is compatible with devstack\u0027s "},{"line_number":7,"context_line":"# default"},{"line_number":8,"context_line":"state_path \u003d /opt/stack/data"},{"line_number":9,"context_line":""}],"source_content_type":"text/x-properties","patch_set":8,"id":"AAAAKX%2F%2F%2F6I%3D","line":6,"updated":"2012-07-08 05:55:31.000000000","message":"white space at end of line","commit_id":"a3f33d4a0be0b6ff650bf3cb658515adbd2aef34"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":3,"context_line":"# debug \u003d true"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"# Where to store dnsmasq state files.  This directory must be writable by the"},{"line_number":6,"context_line":"# user executing the agent. The value below is compatible with devstack\u0027s "},{"line_number":7,"context_line":"# default"},{"line_number":8,"context_line":"state_path \u003d /opt/stack/data"},{"line_number":9,"context_line":""}],"source_content_type":"text/x-properties","patch_set":8,"id":"AAAAKX%2F%2F%2F1A%3D","line":6,"in_reply_to":"AAAAKX%2F%2F%2F6I%3D","updated":"2012-07-08 18:55:02.000000000","message":"Done","commit_id":"a3f33d4a0be0b6ff650bf3cb658515adbd2aef34"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# OVS"},{"line_number":15,"context_line":"interface_driver \u003d quantum.agent.linux.interface.OVSInterfaceDriver"},{"line_number":16,"context_line":"# LinuxBridge"},{"line_number":17,"context_line":"#interface_driver \u003d quantum.agent.linux.interface.BridgeInterfaceDriver"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"# The agent can use other DHCP drivers.  Dnsmasq is the simplest and requires"},{"line_number":20,"context_line":"# no additional setup of the DHCP server."}],"source_content_type":"text/x-properties","patch_set":9,"id":"AAAAKX%2F%2F%2Fyw%3D","line":17,"updated":"2012-07-09 00:21:56.000000000","message":"Add one space after #.","commit_id":"43960ee4486925bff2b4da3af5db963b389f7dc2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":27,"context_line":"db_connection \u003d mysql://root:password@localhost/ovs_quantum?charset\u003dutf8"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"# The database used by the LinuxBridge Quantum plugin"},{"line_number":30,"context_line":"#db_connection \u003d mysql://root:password@localhost/quantum_linux_bridge"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# The Quantum user information for accessing the Quantum API."},{"line_number":33,"context_line":"auth_url \u003d http://localhost:35357/v2.0"}],"source_content_type":"text/x-properties","patch_set":9,"id":"AAAAKX%2F%2F%2Fys%3D","line":30,"updated":"2012-07-09 00:21:56.000000000","message":"One space after #.","commit_id":"43960ee4486925bff2b4da3af5db963b389f7dc2"}],"quantum/agent/common/config.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright 2011 OpenStack LLC"},{"line_number":4,"context_line":"# All Rights Reserved."},{"line_number":5,"context_line":"#"},{"line_number":6,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F61k%3D","line":3,"updated":"2012-06-28 01:41:44.000000000","message":"Should be 2012","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":29,"context_line":"def setup_conf():"},{"line_number":30,"context_line":"    bind_opts \u003d ["},{"line_number":31,"context_line":"        cfg.StrOpt(\u0027state_path\u0027,"},{"line_number":32,"context_line":"                   default\u003dos.path.join(os.path.dirname(__file__), \u0027../\u0027),"},{"line_number":33,"context_line":"                   help\u003d\u0027Top-level directory for maintaining dhcp state\u0027),"},{"line_number":34,"context_line":"    ]"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6wo%3D","line":32,"updated":"2012-06-28 01:41:44.000000000","message":"Consider setting the default to a location outside the code path.  /var is probably appropriate for a production system.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":38,"context_line":"    return conf"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def setup_logging(conf):"},{"line_number":42,"context_line":"    root_logger \u003d logging.root"},{"line_number":43,"context_line":"    if conf.debug:"},{"line_number":44,"context_line":"        root_logger.setLevel(logging.DEBUG)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6kw%3D","line":41,"updated":"2012-06-28 12:32:01.000000000","message":"I have two comments here:\n1. Would it be possible to have the logiing in a seperate file under agents/common. This would enable the other agenst to leverage it (https://blueprints.launchpad.net/quantum/+spec/agent-logging)\n2. Why do you not use the common configuration logging parameters (please look at the way that this is implemented in common/config.py","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2350,"name":"Willian Molinari","email":"pothix@pothix.com","username":"pothix"},"change_message_id":"2f0309bd57c2e91cc66d5db56996b2472984aeb9","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    return conf"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def setup_logging(conf):"},{"line_number":42,"context_line":"    root_logger \u003d logging.root"},{"line_number":43,"context_line":"    if conf.debug:"},{"line_number":44,"context_line":"        root_logger.setLevel(logging.DEBUG)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJn%2F%2F%2FdE%3D","line":41,"in_reply_to":"AAAAI3%2F%2F6kw%3D","updated":"2012-06-29 23:13:53.000000000","message":"garyk, I don\u0027t know if we\u0027ll have everything from common into the agents. Any idea?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def setup_logging(conf):"},{"line_number":42,"context_line":"    root_logger \u003d logging.root"},{"line_number":43,"context_line":"    if conf.debug:"},{"line_number":44,"context_line":"        root_logger.setLevel(logging.DEBUG)"},{"line_number":45,"context_line":"    elif conf.verbose:"},{"line_number":46,"context_line":"        root_logger.setLevel(logging.INFO)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F61o%3D","line":43,"updated":"2012-06-28 01:41:44.000000000","message":"Consider determining the logging level separate from setting it.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":30,"context_line":"def setup_conf():"},{"line_number":31,"context_line":"    bind_opts \u003d ["},{"line_number":32,"context_line":"        cfg.StrOpt(\u0027state_path\u0027,"},{"line_number":33,"context_line":"                   default\u003dos.path.join(os.path.dirname(__file__), \u0027/var\u0027),"},{"line_number":34,"context_line":"                   help\u003d\u0027Top-level directory for maintaining dhcp state\u0027),"},{"line_number":35,"context_line":"    ]"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2Fm0%3D","line":33,"updated":"2012-07-02 15:50:44.000000000","message":"I apologize for not being explicit - I meant that the state path should be rooted at /var, not stored directly there. Attempting to write to /var as a non-root user will inevitably fail.","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":18,"context_line":"import logging"},{"line_number":19,"context_line":"import os"},{"line_number":20,"context_line":"import sys"},{"line_number":21,"context_line":"import time"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from quantum.common import config"},{"line_number":24,"context_line":"from quantum.openstack.common import cfg"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9rY%3D","line":21,"updated":"2012-07-04 02:43:43.000000000","message":"Remove all unused imports.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":18,"context_line":"import logging"},{"line_number":19,"context_line":"import os"},{"line_number":20,"context_line":"import sys"},{"line_number":21,"context_line":"import time"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from quantum.common import config"},{"line_number":24,"context_line":"from quantum.openstack.common import cfg"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2FfI%3D","line":21,"in_reply_to":"AAAAJ3%2F%2F9rY%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    bind_opts \u003d ["},{"line_number":32,"context_line":"        cfg.StrOpt(\u0027state_path\u0027,"},{"line_number":33,"context_line":"                   default\u003dos.path.join(os.path.dirname(__file__),"},{"line_number":34,"context_line":"                                        \u0027../../\u0027),"},{"line_number":35,"context_line":"                   help\u003d\u0027Top-level directory for maintaining dhcp state\u0027),"},{"line_number":36,"context_line":"    ]"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9rM%3D","line":34,"updated":"2012-07-04 02:43:43.000000000","message":"Are you trying to keep the state in a file in a python lib dir? I think this file will be updated frequently.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":31,"context_line":"    bind_opts \u003d ["},{"line_number":32,"context_line":"        cfg.StrOpt(\u0027state_path\u0027,"},{"line_number":33,"context_line":"                   default\u003dos.path.join(os.path.dirname(__file__),"},{"line_number":34,"context_line":"                                        \u0027../../\u0027),"},{"line_number":35,"context_line":"                   help\u003d\u0027Top-level directory for maintaining dhcp state\u0027),"},{"line_number":36,"context_line":"    ]"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2BpE%3D","line":34,"in_reply_to":"AAAAJ3%2F%2F9rM%3D","updated":"2012-07-06 18:26:19.000000000","message":"No.  Nova kept state there.  I\u0027ll change it back to /var/lib/quantum.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"}],"quantum/agent/dhcp_agent.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from quantum.openstack.common import cfg"},{"line_number":29,"context_line":"from quantum.openstack.common import importutils"},{"line_number":30,"context_line":"from quantum.version import version_string"},{"line_number":31,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"try:"},{"line_number":34,"context_line":"    from quantumclient.v2_0 import client"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F61g%3D","line":31,"updated":"2012-06-28 01:41:44.000000000","message":"This line should be separated from the imports.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":33,"context_line":"try:"},{"line_number":34,"context_line":"    from quantumclient.v2_0 import client"},{"line_number":35,"context_line":"except ImportError:"},{"line_number":36,"context_line":"    LOG.error(_(\u0027quantumclient is not installed\u0027))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class Dhcp(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F61I%3D","line":36,"updated":"2012-06-28 01:41:44.000000000","message":"Fail-fast - It might make sense to log this condition, but is there a good reason to not have the error propagate?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":33,"context_line":"try:"},{"line_number":34,"context_line":"    from quantumclient.v2_0 import client"},{"line_number":35,"context_line":"except ImportError:"},{"line_number":36,"context_line":"    LOG.error(_(\u0027quantumclient is not installed\u0027))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class Dhcp(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F3E%3D","line":36,"in_reply_to":"AAAAI3%2F%2F61I%3D","updated":"2012-06-28 22:04:35.000000000","message":"agreed","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    LOG.error(_(\u0027quantumclient is not installed\u0027))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class Dhcp(object):"},{"line_number":40,"context_line":"    def __init__(self, dhcp_driver, db_connection_url,"},{"line_number":41,"context_line":"                 root_helper, dev_helper):"},{"line_number":42,"context_line":"        self.dhcp_driver_cls \u003d importutils.import_class(dhcp_driver)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F600%3D","line":39,"updated":"2012-06-28 01:41:44.000000000","message":"Consider a more descriptive class name, e.g. DhcpAgent","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2350,"name":"Willian Molinari","email":"pothix@pothix.com","username":"pothix"},"change_message_id":"2f0309bd57c2e91cc66d5db56996b2472984aeb9","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    LOG.error(_(\u0027quantumclient is not installed\u0027))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class Dhcp(object):"},{"line_number":40,"context_line":"    def __init__(self, dhcp_driver, db_connection_url,"},{"line_number":41,"context_line":"                 root_helper, dev_helper):"},{"line_number":42,"context_line":"        self.dhcp_driver_cls \u003d importutils.import_class(dhcp_driver)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJn%2F%2F%2FdA%3D","line":39,"in_reply_to":"AAAAI3%2F%2F600%3D","updated":"2012-06-29 23:13:53.000000000","message":"Agreed.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self.root_helper \u003d root_helper"},{"line_number":45,"context_line":"        self.dev_helper \u003d dev_helper"},{"line_number":46,"context_line":"        self.db \u003d None"},{"line_number":47,"context_line":"        self.polling_interval \u003d 3"},{"line_number":48,"context_line":"        self.reconnect_interval \u003d 5"},{"line_number":49,"context_line":"        self._run \u003d True"},{"line_number":50,"context_line":"        self.prev_state \u003d dict(networks\u003dset(),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F61E%3D","line":47,"updated":"2012-06-28 01:41:44.000000000","message":"The polling and reconnect intervals should be configurable, as with the other agents.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    def daemon_loop(self):"},{"line_number":55,"context_line":"        while self._run:"},{"line_number":56,"context_line":"            delta \u003d self.get_network_state_delta()"},{"line_number":57,"context_line":"            if delta is None:"},{"line_number":58,"context_line":"                continue"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"            for network in delta.get(\u0027new\u0027, []):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F61A%3D","line":57,"updated":"2012-06-28 01:41:44.000000000","message":"Consider using implicit boolean conversion.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"            time.sleep(self.polling_interval)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def _state_builder(self):"},{"line_number":70,"context_line":"        try:"},{"line_number":71,"context_line":"            if self.db is None:"},{"line_number":72,"context_line":"                time.sleep(self.reconnect_interval)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F60w%3D","line":69,"updated":"2012-06-28 01:41:44.000000000","message":"What is being attempted in this function?  Lines 80-89 aren\u0027t really clear to me.  I recommend documenting the intent in a docstring.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def _state_builder(self):"},{"line_number":70,"context_line":"        try:"},{"line_number":71,"context_line":"            if self.db is None:"},{"line_number":72,"context_line":"                time.sleep(self.reconnect_interval)"},{"line_number":73,"context_line":"                self.db \u003d sqlsoup.SqlSoup(self.db_connection_url)"},{"line_number":74,"context_line":"                LOG.info(\"Connecting to database \\\"%s\\\" on %s\" %"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F608%3D","line":71,"updated":"2012-06-28 01:41:44.000000000","message":"Consider using implicit boolean conversion.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                time.sleep(self.reconnect_interval)"},{"line_number":73,"context_line":"                self.db \u003d sqlsoup.SqlSoup(self.db_connection_url)"},{"line_number":74,"context_line":"                LOG.info(\"Connecting to database \\\"%s\\\" on %s\" %"},{"line_number":75,"context_line":"                        (self.db.engine.url.database, self.db.engine.url.host))"},{"line_number":76,"context_line":"            else:"},{"line_number":77,"context_line":"                # we have to commit to get the latest view"},{"line_number":78,"context_line":"                self.db.commit()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F604%3D","line":75,"updated":"2012-06-28 01:41:44.000000000","message":"PEP8 - vertical alignment","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        delta[\u0027deleted\u0027] \u003d self.prev_state[\u0027networks\u0027] - state[\u0027networks\u0027]"},{"line_number":109,"context_line":"        delta[\u0027new\u0027] \u003d state[\u0027networks\u0027] - self.prev_state[\u0027networks\u0027]"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        # change candidates is the net_id portion of the symmetric diff"},{"line_number":112,"context_line":"        # between the sets of (subnet_hash,net_id)"},{"line_number":113,"context_line":"        candidates \u003d set("},{"line_number":114,"context_line":"            [h[1] for h in"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F60s%3D","line":111,"updated":"2012-06-28 01:41:44.000000000","message":"is \u003d\u003e are","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                (state[\u0027subnet_hashes\u0027] ^ self.prev_state[\u0027subnet_hashes\u0027])]"},{"line_number":116,"context_line":"        )"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        # change candidates is the net_id portion of the symmetric diff"},{"line_number":119,"context_line":"        # between the sets of (alloc_hash,net_id)"},{"line_number":120,"context_line":"        candidates.update("},{"line_number":121,"context_line":"            [h[1] for h in"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F60c%3D","line":118,"updated":"2012-06-28 01:41:44.000000000","message":"is \u003d\u003e are","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                (state[\u0027ipalloc_hashes\u0027] ^ self.prev_state[\u0027ipalloc_hashes\u0027])]"},{"line_number":123,"context_line":"        )"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        # since new appear as updates subtract them"},{"line_number":126,"context_line":"        delta[\u0027updated\u0027] \u003d candidates - delta[\u0027new\u0027] - delta[\u0027deleted\u0027]"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        # save state"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F60Y%3D","line":125,"updated":"2012-06-28 01:41:44.000000000","message":"Consider rephrasing this comment for clarity","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def call_driver(self, action, network):"},{"line_number":134,"context_line":"        try:"},{"line_number":135,"context_line":"            print \u0027%s some dhcp for %s\u0027 % (action, network)"},{"line_number":136,"context_line":"            network \u003d AugmentingMapper("},{"line_number":137,"context_line":"                self.db.networks.filter_by(id\u003dnetwork).one(),"},{"line_number":138,"context_line":"                self.db"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F60U%3D","line":135,"updated":"2012-06-28 01:41:44.000000000","message":"Is there a good reason to output to stdout instead of logging?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    def call_driver(self, action, network):"},{"line_number":134,"context_line":"        try:"},{"line_number":135,"context_line":"            print \u0027%s some dhcp for %s\u0027 % (action, network)"},{"line_number":136,"context_line":"            network \u003d AugmentingMapper("},{"line_number":137,"context_line":"                self.db.networks.filter_by(id\u003dnetwork).one(),"},{"line_number":138,"context_line":"                self.db"},{"line_number":139,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F60M%3D","line":136,"updated":"2012-06-28 01:41:44.000000000","message":"What is the intent of this statement?  The use of and assignment to the \u0027network\u0027 variable is confusing.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":133,"context_line":"    def call_driver(self, action, network):"},{"line_number":134,"context_line":"        try:"},{"line_number":135,"context_line":"            print \u0027%s some dhcp for %s\u0027 % (action, network)"},{"line_number":136,"context_line":"            network \u003d AugmentingMapper("},{"line_number":137,"context_line":"                self.db.networks.filter_by(id\u003dnetwork).one(),"},{"line_number":138,"context_line":"                self.db"},{"line_number":139,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F4Y%3D","line":136,"in_reply_to":"AAAAI3%2F%2F60M%3D","updated":"2012-06-28 22:04:35.000000000","message":"Yes, I found this logic and class confusing as well.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":143,"context_line":"            getattr(driver, action)()"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"        except Exception, e:"},{"line_number":146,"context_line":"            raise"},{"line_number":147,"context_line":"            LOG.warn(\u0027Unable to %s dhcp. Exception: %s\u0027 % (action, e))"},{"line_number":148,"context_line":"            # remove the network so that it gets refreshed next time"},{"line_number":149,"context_line":"            if action !\u003d \u0027disable\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F60E%3D","line":146,"updated":"2012-06-28 01:41:44.000000000","message":"This raise statement ensures that the subsequent lines will never be reached.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":150,"context_line":"                self.prev_state[\u0027networks\u0027].remove(network)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"class DevHelper(object):"},{"line_number":154,"context_line":"    OPTS \u003d ["},{"line_number":155,"context_line":"        cfg.StrOpt(\u0027admin_user\u0027),"},{"line_number":156,"context_line":"        cfg.StrOpt(\u0027admin_password\u0027),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F60A%3D","line":153,"updated":"2012-06-28 01:41:44.000000000","message":"The intent of this class is not clear from its name.  Consider using a more descriptive name and/or providing a class-level docstring.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":150,"context_line":"                self.prev_state[\u0027networks\u0027].remove(network)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"class DevHelper(object):"},{"line_number":154,"context_line":"    OPTS \u003d ["},{"line_number":155,"context_line":"        cfg.StrOpt(\u0027admin_user\u0027),"},{"line_number":156,"context_line":"        cfg.StrOpt(\u0027admin_password\u0027),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F53w%3D","line":153,"in_reply_to":"AAAAI3%2F%2F60A%3D","updated":"2012-06-28 22:04:35.000000000","message":"I was confused as well initially.  After reading the rest of the patch, I now believe that \"Dev\" reference to a linux device used by dnsmasq and connected to a bridge.  Its confusing that most of the config options here seem more related to being able to use the quantumclient lib to contact the quantum API.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        cfg.StrOpt(\u0027auth_strategy\u0027, default\u003d\u0027keystone\u0027),"},{"line_number":160,"context_line":"        cfg.StrOpt(\u0027auth_region\u0027),"},{"line_number":161,"context_line":"        cfg.StrOpt(\u0027interface_driver\u0027,"},{"line_number":162,"context_line":"                   default\u003d\u0027\u0027,"},{"line_number":163,"context_line":"                   help\u003d\"The driver used to manage DHCP\")"},{"line_number":164,"context_line":"    ]"},{"line_number":165,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6z8%3D","line":162,"updated":"2012-06-28 01:41:44.000000000","message":"Why is it desirable to provide an empty string as the default?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":171,"context_line":"                                                root_helper)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def setup(self, network):"},{"line_number":174,"context_line":"        dev \u003d \u0027tap\u0027 + network.id[:11]"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        # allocate port in Quantum"},{"line_number":177,"context_line":"        quantum \u003d client.Client("}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6z4%3D","line":174,"updated":"2012-06-28 01:41:44.000000000","message":"Prefer named constants to magic numbers - why 11?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":171,"context_line":"                                                root_helper)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def setup(self, network):"},{"line_number":174,"context_line":"        dev \u003d \u0027tap\u0027 + network.id[:11]"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        # allocate port in Quantum"},{"line_number":177,"context_line":"        quantum \u003d client.Client("}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F3c%3D","line":174,"in_reply_to":"AAAAI3%2F%2F6z4%3D","updated":"2012-06-28 22:04:35.000000000","message":"this is replicating what the NOVA code did, though, yeah, we should probably do something like: \n\ndev \u003d (\u0027tap\u0027 + network.id)[:NET_DEV_NAME_LEN]","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":189,"context_line":"            network_id\u003dnetwork.id,"},{"line_number":190,"context_line":"            tenant_id\u003dnetwork.tenant_id"},{"line_number":191,"context_line":"        )"},{"line_number":192,"context_line":"        port \u003d quantum.create_port(body)"},{"line_number":193,"context_line":"        self.driver.plug(network.id,"},{"line_number":194,"context_line":"                         dev,"},{"line_number":195,"context_line":"                         port[\u0027mac_address\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F4c%3D","line":192,"updated":"2012-06-28 22:04:35.000000000","message":"It seems a bit asymmetric that we directly access the database to learn about allocations, but then require the quantumclient to create a port.  If direct access to the DB is OK, then why not just create the port directly via the DB, thereby removing the dependence on the quantumclient library?\n\nPerhaps the idea was that in the future we wouldn\u0027t directly access the database to learn about new allocations?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"class AugmentingMapper(object):"},{"line_number":205,"context_line":"    \"\"\" an augmenting wrapping to allow object access for drivers \"\"\""},{"line_number":206,"context_line":"    MAPPING \u003d {"},{"line_number":207,"context_line":"        \u0027networks\u0027: {\u0027subnets\u0027: \u0027subnets\u0027, \u0027ports\u0027: \u0027ports\u0027},"},{"line_number":208,"context_line":"        \u0027subnets\u0027: {\u0027allocations\u0027: \u0027ipallocations\u0027}"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6zw%3D","line":205,"updated":"2012-06-28 01:41:44.000000000","message":"HACKING - docstrings - capitalize the sentence and end with a period.  No leading or trailing spaces.\n\nAlso, what is \u0027object access\u0027?  The purpose of this class to the uninitiated will likely not be clear from either the name or the docstring.  Is it a helper for accessing SQLAlchemy models?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"class AugmentingMapper(object):"},{"line_number":205,"context_line":"    \"\"\" an augmenting wrapping to allow object access for drivers \"\"\""},{"line_number":206,"context_line":"    MAPPING \u003d {"},{"line_number":207,"context_line":"        \u0027networks\u0027: {\u0027subnets\u0027: \u0027subnets\u0027, \u0027ports\u0027: \u0027ports\u0027},"},{"line_number":208,"context_line":"        \u0027subnets\u0027: {\u0027allocations\u0027: \u0027ipallocations\u0027}"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F54I%3D","line":205,"in_reply_to":"AAAAI3%2F%2F6zw%3D","updated":"2012-06-28 22:04:35.000000000","message":"I agree.  This class definitely merits some kind of explanation.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":205,"context_line":"    \"\"\" an augmenting wrapping to allow object access for drivers \"\"\""},{"line_number":206,"context_line":"    MAPPING \u003d {"},{"line_number":207,"context_line":"        \u0027networks\u0027: {\u0027subnets\u0027: \u0027subnets\u0027, \u0027ports\u0027: \u0027ports\u0027},"},{"line_number":208,"context_line":"        \u0027subnets\u0027: {\u0027allocations\u0027: \u0027ipallocations\u0027}"},{"line_number":209,"context_line":"    }"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def __init__(self, obj, db):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6zo%3D","line":208,"updated":"2012-06-28 01:41:44.000000000","message":"HACKING - dict formatting - separate every entry in a multiline dict with a comma.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":241,"context_line":"        raise AttributeError"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"def main(args):"},{"line_number":245,"context_line":"    opts \u003d ["},{"line_number":246,"context_line":"        cfg.StrOpt(\u0027db_connection\u0027, default\u003d\u0027sqlite://\u0027),"},{"line_number":247,"context_line":"        cfg.StrOpt(\u0027root_helper\u0027, default\u003d\u0027sudo\u0027),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F40%3D","line":244,"updated":"2012-06-28 22:04:35.000000000","message":"This model is slightly different from what I was originally expecting.  I was thinking that we would have a library for DHCP functionality and a common set of config options, such that any of the *-agent.py binaries could easily add DHCP capability.  This code runs DHCP has its own agent.  This approach is fine as well, but I\u0027d suggest structuring the code more as a library with a small agent file that uses the library.  This way, either approach would be viable.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":241,"context_line":"        raise AttributeError"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"def main(args):"},{"line_number":245,"context_line":"    opts \u003d ["},{"line_number":246,"context_line":"        cfg.StrOpt(\u0027db_connection\u0027, default\u003d\u0027sqlite://\u0027),"},{"line_number":247,"context_line":"        cfg.StrOpt(\u0027root_helper\u0027, default\u003d\u0027sudo\u0027),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJn%2F%2F%2F60%3D","line":244,"in_reply_to":"AAAAJX%2F%2F%2F40%3D","updated":"2012-06-29 14:01:48.000000000","message":"I have the same concern, I was expecting the same thing as Dan.\nFrom what I gathered from messages on the mailing list, this is a temporary measure for Folsom-2, and it will improve, possibly in the way suggested by Dan, in Folsom-3, is this correct?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":262,"context_line":"               conf.root_helper,"},{"line_number":263,"context_line":"               DevHelper(conf, conf.root_helper))"},{"line_number":264,"context_line":"    mgr.daemon_loop()"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"},{"line_number":267,"context_line":"    main(sys.argv)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6zk%3D","line":265,"updated":"2012-06-28 01:41:44.000000000","message":"PEP8 - need an extra line here","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":67,"context_line":"            delta \u003d self.get_network_state_delta()"},{"line_number":68,"context_line":"            if delta is None:"},{"line_number":69,"context_line":"                continue"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"            for network in delta.get(\u0027new\u0027, []):"},{"line_number":72,"context_line":"                self.call_driver(\u0027enable\u0027, network)"},{"line_number":73,"context_line":"            for network in delta.get(\u0027updated\u0027, []):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2Fxw%3D","line":70,"updated":"2012-07-02 05:36:40.000000000","message":"Given that a network can have multiple subnets, should we actually be tracking changed subnets, not changed networks?  Presumably we actually need a different instance of the driver (dnsmasq) for each unique subnet, since it would need to have an IP address in that subnet.  Or am I missing something?","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":136,"context_line":"        candidates \u003d set("},{"line_number":137,"context_line":"            [h[1] for h in"},{"line_number":138,"context_line":"                (state.subnet_hashes ^ self.prev_state.subnet_hashes)]"},{"line_number":139,"context_line":"        )"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        # change candidates are the net_id portion of the symmetric diff"},{"line_number":142,"context_line":"        # between the sets of (alloc_hash,net_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2Fxs%3D","line":139,"updated":"2012-07-02 05:36:40.000000000","message":"I\u0027m trying to figure out what is included in this set that will not later be subtracted out below with delta[\u0027new\u0027] and delta[\u0027deleted\u0027].  Is it that there could be a network that adds or loses a subnet?  If so, would be good to describe that in the comment.","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":171,"context_line":"        except Exception, e:"},{"line_number":172,"context_line":"            LOG.warn(\u0027Unable to %s dhcp. Exception: %s\u0027 % (action, e))"},{"line_number":173,"context_line":"            # remove the network so that it gets refreshed next time"},{"line_number":174,"context_line":"            if action !\u003d \u0027disable\u0027:"},{"line_number":175,"context_line":"                self.prev_state.networks.remove(network)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2FxA%3D","line":174,"updated":"2012-07-02 05:36:40.000000000","message":"does this mean that if there\u0027s an exception for a remove, we can permanently fail to disable DHCP on that network?  If this was a remove, would the right move be to add the network to prev_state.networks?","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":195,"context_line":"        self.driver \u003d importutils.import_object(conf.interface_driver, conf)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def setup(self, network):"},{"line_number":198,"context_line":"        dev \u003d (\u0027tap\u0027 + network.id)[:self.driver.DEV_NAME_LEN]"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        # allocate port in Quantum"},{"line_number":201,"context_line":"        quantum \u003d client.Client("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2Fwo%3D","line":198,"updated":"2012-07-02 05:36:40.000000000","message":"similar question as before.  If you have multiple subnets per network, wouldn\u0027t we have to listen on multiple IPs.  Would we bind each of these IPs to a single interface, or give them each their own port? This seems to assume there is only a single device per network.  However, below, I think this port will only get an allocation in one v4 and one v6 subnet below, as we don\u0027t specify all subnets.  We would also have to think about handling when a new subnet is added to a network.  Alternately, we could say that for now, DHCP only supports one v4 and one v6 subnet per network, unless I\u0027m missing something.","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":209,"context_line":""},{"line_number":210,"context_line":"        body \u003d dict("},{"line_number":211,"context_line":"            admin_state_up\u003dTrue,"},{"line_number":212,"context_line":"            device_id\u003ddev,"},{"line_number":213,"context_line":"            network_id\u003dnetwork.id,"},{"line_number":214,"context_line":"            tenant_id\u003dnetwork.tenant_id"},{"line_number":215,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2Fws%3D","line":212,"updated":"2012-07-02 05:36:40.000000000","message":"the device-id field is actually intended to indicate the \u0027instance\u0027 that is plugged in here (for example, for a port that is a nova VM, it is the instance uuid).  Here perhaps it could be dhcp-\u003csubnet-id\u003e or dhcp-\u003cnetwork-id\u003e.","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":270,"context_line":"    opts \u003d ["},{"line_number":271,"context_line":"    ]"},{"line_number":272,"context_line":"    conf \u003d config.setup_conf()"},{"line_number":273,"context_line":"    conf.register_opts(opts)"},{"line_number":274,"context_line":"    conf.register_opts(DhcpAgent.OPTS)"},{"line_number":275,"context_line":"    conf.register_opts(DevHelper.OPTS)"},{"line_number":276,"context_line":"    conf.register_opts(dhcp.OPTS)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2FxU%3D","line":273,"updated":"2012-07-02 05:36:40.000000000","message":"if opts is always empty, is this needed?","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":56,"context_line":"        self.conf \u003d conf"},{"line_number":57,"context_line":"        self.dhcp_driver_cls \u003d importutils.import_class(conf.dhcp_driver)"},{"line_number":58,"context_line":"        self.db \u003d None"},{"line_number":59,"context_line":"        self.polling_interval \u003d 3"},{"line_number":60,"context_line":"        self.reconnect_interval \u003d 5"},{"line_number":61,"context_line":"        self._run \u003d True"},{"line_number":62,"context_line":"        self.prev_state \u003d State(set(), set(), set())"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAJ3%2F%2F%2BnU%3D","line":59,"updated":"2012-07-03 12:16:43.000000000","message":"Should be from the conf data structure","commit_id":"daf271899ec2b3d7adfc055be01ee40810db5a9d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":57,"context_line":"        self.dhcp_driver_cls \u003d importutils.import_class(conf.dhcp_driver)"},{"line_number":58,"context_line":"        self.db \u003d None"},{"line_number":59,"context_line":"        self.polling_interval \u003d 3"},{"line_number":60,"context_line":"        self.reconnect_interval \u003d 5"},{"line_number":61,"context_line":"        self._run \u003d True"},{"line_number":62,"context_line":"        self.prev_state \u003d State(set(), set(), set())"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAJ3%2F%2F%2BnQ%3D","line":60,"updated":"2012-07-03 12:16:43.000000000","message":"Should be from the conf data structure","commit_id":"daf271899ec2b3d7adfc055be01ee40810db5a9d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":92,"context_line":"        try:"},{"line_number":93,"context_line":"            if self.db is None:"},{"line_number":94,"context_line":"                time.sleep(self.reconnect_interval)"},{"line_number":95,"context_line":"                self.db \u003d sqlsoup.SqlSoup(conf.db_connection)"},{"line_number":96,"context_line":"                LOG.info(\"Connecting to database \\\"%s\\\" on %s\" %"},{"line_number":97,"context_line":"                         (self.db.engine.url.database,"},{"line_number":98,"context_line":"                          self.db.engine.url.host))"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAJ3%2F%2F%2BsI%3D","line":95,"updated":"2012-07-03 10:08:08.000000000","message":"self.db \u003d sqlsoup.SqlSoup(self.conf.db_connection)","commit_id":"daf271899ec2b3d7adfc055be01ee40810db5a9d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":191,"context_line":"        cfg.StrOpt(\u0027auth_url\u0027),"},{"line_number":192,"context_line":"        cfg.StrOpt(\u0027auth_strategy\u0027, default\u003d\u0027keystone\u0027),"},{"line_number":193,"context_line":"        cfg.StrOpt(\u0027auth_region\u0027),"},{"line_number":194,"context_line":"        cfg.StrOpt(\u0027interface_driver\u0027,"},{"line_number":195,"context_line":"                   help\u003d\"The driver used to manage the virtual interface.\")"},{"line_number":196,"context_line":"    ]"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAJ3%2F%2F%2BsA%3D","line":194,"updated":"2012-07-03 10:08:08.000000000","message":"Please provide default values.\nNot 100% sure- I set this as quantum.agent.linux.interface.OVSInterfaceDriver for testing - should this be used if the OVS is the plugin?","commit_id":"daf271899ec2b3d7adfc055be01ee40810db5a9d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self.prev_state \u003d State(set(), set(), set())"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def daemon_loop(self):"},{"line_number":65,"context_line":"        \"\"\"The DhcpAgent daemon runloop.\"\"\""},{"line_number":66,"context_line":"        while self._run:"},{"line_number":67,"context_line":"            delta \u003d self.get_network_state_delta()"},{"line_number":68,"context_line":"            if delta is None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BBM%3D","line":65,"updated":"2012-07-03 20:49:58.000000000","message":"Unnecessary docstring","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self.prev_state \u003d State(set(), set(), set())"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def daemon_loop(self):"},{"line_number":65,"context_line":"        \"\"\"The DhcpAgent daemon runloop.\"\"\""},{"line_number":66,"context_line":"        while self._run:"},{"line_number":67,"context_line":"            delta \u003d self.get_network_state_delta()"},{"line_number":68,"context_line":"            if delta is None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F98s%3D","line":65,"in_reply_to":"AAAAJ3%2F%2F%2BBM%3D","updated":"2012-07-03 21:40:17.000000000","message":"More documentation rather than less. I always prefer to have docstrings, even if they declare something obvious.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self.prev_state \u003d State(set(), set(), set())"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def daemon_loop(self):"},{"line_number":65,"context_line":"        \"\"\"The DhcpAgent daemon runloop.\"\"\""},{"line_number":66,"context_line":"        while self._run:"},{"line_number":67,"context_line":"            delta \u003d self.get_network_state_delta()"},{"line_number":68,"context_line":"            if delta is None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F91Y%3D","line":65,"in_reply_to":"AAAAJ3%2F%2F98s%3D","updated":"2012-07-03 23:31:49.000000000","message":"If the docstring or comment do not convey information that is not obvious from the code, I see that as being cause for removal as per DRY.  Duplicated information requires duplicative maintenance effort, and needlessly clutters the code (lessoning one of python\u0027s key pluses - succinctness).","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":78,"context_line":"            time.sleep(self.polling_interval)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def _state_builder(self):"},{"line_number":81,"context_line":"        \"\"\"This method polls the Quantum database and returns a represenation"},{"line_number":82,"context_line":"        of the network state."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        The value returned is a State tuple that contains three sets:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BBI%3D","line":81,"updated":"2012-07-03 20:49:58.000000000","message":"PEP257 - prescribe rather than describe","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":78,"context_line":"            time.sleep(self.polling_interval)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def _state_builder(self):"},{"line_number":81,"context_line":"        \"\"\"This method polls the Quantum database and returns a represenation"},{"line_number":82,"context_line":"        of the network state."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        The value returned is a State tuple that contains three sets:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F98c%3D","line":81,"in_reply_to":"AAAAJ3%2F%2F%2BBI%3D","updated":"2012-07-03 21:40:17.000000000","message":"Really? This seems perfectly fine to me, according to the HACKING.rst file. Even if it\u0027s not *perfect* it\u0027s readable and explanatory.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":78,"context_line":"            time.sleep(self.polling_interval)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def _state_builder(self):"},{"line_number":81,"context_line":"        \"\"\"This method polls the Quantum database and returns a represenation"},{"line_number":82,"context_line":"        of the network state."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        The value returned is a State tuple that contains three sets:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F90A%3D","line":81,"in_reply_to":"AAAAJ3%2F%2F98c%3D","updated":"2012-07-03 23:31:49.000000000","message":"My intent in pointing to that particular PEP257 dictate was to encourage language consistency in docstrings.  As per our email exchange, PEP257 comments can be considered suggestion only.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def _state_builder(self):"},{"line_number":81,"context_line":"        \"\"\"This method polls the Quantum database and returns a represenation"},{"line_number":82,"context_line":"        of the network state."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        The value returned is a State tuple that contains three sets:"},{"line_number":85,"context_line":"        networks, subnet_hashes, and ipalloc_hashes."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F95o%3D","line":82,"updated":"2012-07-03 21:50:58.000000000","message":"IMO, this method should be done via Quantum V2 api. quantum agent should not touch db directly. In addition, prev_state will be cleared when we restart dhcp_agent only, then  multiple dhcp server for same network will be launched.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":119,"context_line":"            return None"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def get_network_state_delta(self):"},{"line_number":122,"context_line":"        \"\"\"Returns a dict containing the sets of networks that are new,"},{"line_number":123,"context_line":"           updated, and deleted.\"\"\""},{"line_number":124,"context_line":"        delta \u003d {}"},{"line_number":125,"context_line":"        state \u003d self._state_builder()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BBE%3D","line":122,"updated":"2012-07-03 20:49:58.000000000","message":"PEP257","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":119,"context_line":"            return None"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def get_network_state_delta(self):"},{"line_number":122,"context_line":"        \"\"\"Returns a dict containing the sets of networks that are new,"},{"line_number":123,"context_line":"           updated, and deleted.\"\"\""},{"line_number":124,"context_line":"        delta \u003d {}"},{"line_number":125,"context_line":"        state \u003d self._state_builder()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F98Y%3D","line":122,"in_reply_to":"AAAAJ3%2F%2F%2BBE%3D","updated":"2012-07-03 21:40:17.000000000","message":"This comment is not constructive. Maru, if you have an objection, could be please be more explicit that simply referencing a PEP number?\n\nThanks.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":119,"context_line":"            return None"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def get_network_state_delta(self):"},{"line_number":122,"context_line":"        \"\"\"Returns a dict containing the sets of networks that are new,"},{"line_number":123,"context_line":"           updated, and deleted.\"\"\""},{"line_number":124,"context_line":"        delta \u003d {}"},{"line_number":125,"context_line":"        state \u003d self._state_builder()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F91E%3D","line":122,"in_reply_to":"AAAAJ3%2F%2F98Y%3D","updated":"2012-07-03 23:31:49.000000000","message":"Apologies.  I wrongly assumed that all PEP257 comments past the initial one would be understood to be addressing the same concern.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"unresolved":false,"context_lines":[{"line_number":127,"context_line":"        if state is None:"},{"line_number":128,"context_line":"            return None"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        # determine the new/deleted networks"},{"line_number":131,"context_line":"        delta[\u0027deleted\u0027] \u003d self.prev_state.networks - state.networks"},{"line_number":132,"context_line":"        delta[\u0027new\u0027] \u003d state.networks - self.prev_state.networks"},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F95Y%3D","line":130,"updated":"2012-07-03 21:50:58.000000000","message":"Current state should be based on current dnsmasq process status and configuration in order to manage some failure case including spawn process failure.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":131,"context_line":"        delta[\u0027deleted\u0027] \u003d self.prev_state.networks - state.networks"},{"line_number":132,"context_line":"        delta[\u0027new\u0027] \u003d state.networks - self.prev_state.networks"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        # We\u0027ll first get the networks that have subnets added or deleted."},{"line_number":135,"context_line":"        # The change candidates are the net_id portion of the symmetric diff"},{"line_number":136,"context_line":"        # between the sets of (subnet_hash,net_id)"},{"line_number":137,"context_line":"        candidates \u003d set("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BA8%3D","line":134,"updated":"2012-07-03 20:49:58.000000000","message":"Avoid use of personal pronouns in docstrings:\n\nWe\u0027ll first get \u003d\u003e Get","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":131,"context_line":"        delta[\u0027deleted\u0027] \u003d self.prev_state.networks - state.networks"},{"line_number":132,"context_line":"        delta[\u0027new\u0027] \u003d state.networks - self.prev_state.networks"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        # We\u0027ll first get the networks that have subnets added or deleted."},{"line_number":135,"context_line":"        # The change candidates are the net_id portion of the symmetric diff"},{"line_number":136,"context_line":"        # between the sets of (subnet_hash,net_id)"},{"line_number":137,"context_line":"        candidates \u003d set("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F98U%3D","line":134,"in_reply_to":"AAAAJ3%2F%2F%2BA8%3D","updated":"2012-07-03 21:40:17.000000000","message":"Okay, so first, this is a comment -- an *informal* form of documentation.\n\nComplaining about preposition use like this seems a waste of time and not supportive of any coding effort or improvement in readability. *Especially* give the informal nature of code comments.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":131,"context_line":"        delta[\u0027deleted\u0027] \u003d self.prev_state.networks - state.networks"},{"line_number":132,"context_line":"        delta[\u0027new\u0027] \u003d state.networks - self.prev_state.networks"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        # We\u0027ll first get the networks that have subnets added or deleted."},{"line_number":135,"context_line":"        # The change candidates are the net_id portion of the symmetric diff"},{"line_number":136,"context_line":"        # between the sets of (subnet_hash,net_id)"},{"line_number":137,"context_line":"        candidates \u003d set("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9z0%3D","line":134,"in_reply_to":"AAAAJ3%2F%2F98U%3D","updated":"2012-07-03 23:31:49.000000000","message":"I don\u0027t agree that comments deserve less care and attention than docstrings, but I\u0027m happy to agree to disagree.  As per the email exchange, comments like this one should be considered suggestion only.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":139,"context_line":"                (state.subnet_hashes ^ self.prev_state.subnet_hashes)]"},{"line_number":140,"context_line":"        )"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        # Now update with the networks that have had allocations added/deleted."},{"line_number":143,"context_line":"        # change candidates are the net_id portion of the symmetric diff"},{"line_number":144,"context_line":"        # between the sets of (alloc_hash,net_id)"},{"line_number":145,"context_line":"        candidates.update("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAw%3D","line":142,"updated":"2012-07-03 20:49:58.000000000","message":"Now update \u003d\u003e Update","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":139,"context_line":"                (state.subnet_hashes ^ self.prev_state.subnet_hashes)]"},{"line_number":140,"context_line":"        )"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        # Now update with the networks that have had allocations added/deleted."},{"line_number":143,"context_line":"        # change candidates are the net_id portion of the symmetric diff"},{"line_number":144,"context_line":"        # between the sets of (alloc_hash,net_id)"},{"line_number":145,"context_line":"        candidates.update("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F98M%3D","line":142,"in_reply_to":"AAAAJ3%2F%2F%2BAw%3D","updated":"2012-07-03 21:40:17.000000000","message":"See comment above.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":140,"context_line":"        )"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        # Now update with the networks that have had allocations added/deleted."},{"line_number":143,"context_line":"        # change candidates are the net_id portion of the symmetric diff"},{"line_number":144,"context_line":"        # between the sets of (alloc_hash,net_id)"},{"line_number":145,"context_line":"        candidates.update("},{"line_number":146,"context_line":"            [h[1] for h in"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAs%3D","line":143,"updated":"2012-07-03 20:49:58.000000000","message":"change \u003d\u003e Change","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":140,"context_line":"        )"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        # Now update with the networks that have had allocations added/deleted."},{"line_number":143,"context_line":"        # change candidates are the net_id portion of the symmetric diff"},{"line_number":144,"context_line":"        # between the sets of (alloc_hash,net_id)"},{"line_number":145,"context_line":"        candidates.update("},{"line_number":146,"context_line":"            [h[1] for h in"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F98I%3D","line":143,"in_reply_to":"AAAAJ3%2F%2F%2BAs%3D","updated":"2012-07-03 21:40:17.000000000","message":"See comment above.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":155,"context_line":"        return delta"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def call_driver(self, action, network_id):"},{"line_number":158,"context_line":"        \"\"\"This method will invoke an action on a DHCP driver instance.\"\"\""},{"line_number":159,"context_line":"        try:"},{"line_number":160,"context_line":"            # the Driver expects something that is duck typed similar to"},{"line_number":161,"context_line":"            # the base models.  Augmenting will add support to the SqlSoup"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAo%3D","line":158,"updated":"2012-07-03 20:49:58.000000000","message":"PEP257","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":155,"context_line":"        return delta"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def call_driver(self, action, network_id):"},{"line_number":158,"context_line":"        \"\"\"This method will invoke an action on a DHCP driver instance.\"\"\""},{"line_number":159,"context_line":"        try:"},{"line_number":160,"context_line":"            # the Driver expects something that is duck typed similar to"},{"line_number":161,"context_line":"            # the base models.  Augmenting will add support to the SqlSoup"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F98E%3D","line":158,"in_reply_to":"AAAAJ3%2F%2F%2BAo%3D","updated":"2012-07-03 21:40:17.000000000","message":"See comment above.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":174,"context_line":"        except Exception, e:"},{"line_number":175,"context_line":"            LOG.warn(\u0027Unable to %s dhcp. Exception: %s\u0027 % (action, e))"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"            # We need to manipulate the state so the action will be"},{"line_number":178,"context_line":"            # attempted on next loop iteration"},{"line_number":179,"context_line":"            if action \u003d\u003d \u0027disable\u0027:"},{"line_number":180,"context_line":"                # adding to prev state means we\u0027ll try to delete it next time"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAk%3D","line":177,"updated":"2012-07-03 20:49:58.000000000","message":"We need to manipulate \u003d\u003e Manipulate","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":174,"context_line":"        except Exception, e:"},{"line_number":175,"context_line":"            LOG.warn(\u0027Unable to %s dhcp. Exception: %s\u0027 % (action, e))"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"            # We need to manipulate the state so the action will be"},{"line_number":178,"context_line":"            # attempted on next loop iteration"},{"line_number":179,"context_line":"            if action \u003d\u003d \u0027disable\u0027:"},{"line_number":180,"context_line":"                # adding to prev state means we\u0027ll try to delete it next time"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F978%3D","line":177,"in_reply_to":"AAAAJ3%2F%2F%2BAk%3D","updated":"2012-07-03 21:40:17.000000000","message":"See comment above.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":177,"context_line":"            # We need to manipulate the state so the action will be"},{"line_number":178,"context_line":"            # attempted on next loop iteration"},{"line_number":179,"context_line":"            if action \u003d\u003d \u0027disable\u0027:"},{"line_number":180,"context_line":"                # adding to prev state means we\u0027ll try to delete it next time"},{"line_number":181,"context_line":"                self.prev_state.networks.add(network_id)"},{"line_number":182,"context_line":"            else:"},{"line_number":183,"context_line":"                # removing means it will look like new next time"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAg%3D","line":180,"updated":"2012-07-03 20:49:58.000000000","message":"\u003d\u003e Indicate that removal is required","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":177,"context_line":"            # We need to manipulate the state so the action will be"},{"line_number":178,"context_line":"            # attempted on next loop iteration"},{"line_number":179,"context_line":"            if action \u003d\u003d \u0027disable\u0027:"},{"line_number":180,"context_line":"                # adding to prev state means we\u0027ll try to delete it next time"},{"line_number":181,"context_line":"                self.prev_state.networks.add(network_id)"},{"line_number":182,"context_line":"            else:"},{"line_number":183,"context_line":"                # removing means it will look like new next time"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F974%3D","line":180,"in_reply_to":"AAAAJ3%2F%2F%2BAg%3D","updated":"2012-07-03 21:40:17.000000000","message":"See comment above.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":180,"context_line":"                # adding to prev state means we\u0027ll try to delete it next time"},{"line_number":181,"context_line":"                self.prev_state.networks.add(network_id)"},{"line_number":182,"context_line":"            else:"},{"line_number":183,"context_line":"                # removing means it will look like new next time"},{"line_number":184,"context_line":"                self.prev_state.networks.remove(network_id)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAc%3D","line":183,"updated":"2012-07-03 20:49:58.000000000","message":"\u003d\u003e Indicate that addition is required","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":180,"context_line":"                # adding to prev state means we\u0027ll try to delete it next time"},{"line_number":181,"context_line":"                self.prev_state.networks.add(network_id)"},{"line_number":182,"context_line":"            else:"},{"line_number":183,"context_line":"                # removing means it will look like new next time"},{"line_number":184,"context_line":"                self.prev_state.networks.remove(network_id)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F970%3D","line":183,"in_reply_to":"AAAAJ3%2F%2F%2BAc%3D","updated":"2012-07-03 21:40:17.000000000","message":"See comment above.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":201,"context_line":"        self.db \u003d db"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        if not conf.interface_driver:"},{"line_number":204,"context_line":"            LOG.error(_(\u0027You must specify an interface driver\u0027))"},{"line_number":205,"context_line":"        self.driver \u003d importutils.import_object(conf.interface_driver, conf)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def setup(self, network):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAY%3D","line":204,"updated":"2012-07-03 20:49:58.000000000","message":"Should an error be raised here, or is it desirable for the subsequent line to fail?","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":250,"context_line":""},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"class AugmentingWrapper(object):"},{"line_number":253,"context_line":"    \"\"\"A wrapper that augments Sqlsoup results so that they look like the"},{"line_number":254,"context_line":"        base v2 db model.\"\"\""},{"line_number":255,"context_line":"    MAPPING \u003d {"},{"line_number":256,"context_line":"        \u0027networks\u0027: {\u0027subnets\u0027: \u0027subnets\u0027, \u0027ports\u0027: \u0027ports\u0027},"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAU%3D","line":253,"updated":"2012-07-03 20:49:58.000000000","message":"HACKING - multiline docstring formatting","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":252,"context_line":"class AugmentingWrapper(object):"},{"line_number":253,"context_line":"    \"\"\"A wrapper that augments Sqlsoup results so that they look like the"},{"line_number":254,"context_line":"        base v2 db model.\"\"\""},{"line_number":255,"context_line":"    MAPPING \u003d {"},{"line_number":256,"context_line":"        \u0027networks\u0027: {\u0027subnets\u0027: \u0027subnets\u0027, \u0027ports\u0027: \u0027ports\u0027},"},{"line_number":257,"context_line":"        \u0027subnets\u0027: {\u0027allocations\u0027: \u0027ipallocations\u0027},"},{"line_number":258,"context_line":"        \u0027ports\u0027: {\u0027fixed_ips\u0027: \u0027ipallocations\u0027},"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAQ%3D","line":255,"updated":"2012-07-03 20:49:58.000000000","message":"Blank line required before this one","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import collections"},{"line_number":19,"context_line":"import logging"},{"line_number":20,"context_line":"import os"},{"line_number":21,"context_line":"import sys"},{"line_number":22,"context_line":"import time"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9r8%3D","line":20,"updated":"2012-07-04 02:43:43.000000000","message":"not used.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from quantum.agent.linux import interface"},{"line_number":29,"context_line":"from quantum.openstack.common import cfg"},{"line_number":30,"context_line":"from quantum.openstack.common import importutils"},{"line_number":31,"context_line":"from quantum.version import version_string"},{"line_number":32,"context_line":"from quantumclient.v2_0 import client"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9r4%3D","line":31,"updated":"2012-07-04 02:43:43.000000000","message":"not used","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":28,"context_line":"from quantum.agent.linux import interface"},{"line_number":29,"context_line":"from quantum.openstack.common import cfg"},{"line_number":30,"context_line":"from quantum.openstack.common import importutils"},{"line_number":31,"context_line":"from quantum.version import version_string"},{"line_number":32,"context_line":"from quantumclient.v2_0 import client"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2BpA%3D","line":31,"in_reply_to":"AAAAJ3%2F%2F9r4%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from quantum.openstack.common import cfg"},{"line_number":30,"context_line":"from quantum.openstack.common import importutils"},{"line_number":31,"context_line":"from quantum.version import version_string"},{"line_number":32,"context_line":"from quantumclient.v2_0 import client"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9r0%3D","line":32,"updated":"2012-07-04 02:43:43.000000000","message":"move it after quantum.agent.linux?","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class DhcpAgent(object):"},{"line_number":41,"context_line":"    OPTS \u003d ["},{"line_number":42,"context_line":"        cfg.StrOpt(\u0027db_connection\u0027, default\u003d\u0027sqlite://\u0027),"},{"line_number":43,"context_line":"        cfg.StrOpt(\u0027root_helper\u0027, default\u003d\u0027sudo\u0027),"},{"line_number":44,"context_line":"        cfg.StrOpt(\u0027dhcp_driver\u0027,"},{"line_number":45,"context_line":"                   default\u003d\u0027quantum.agent.linux.dhcp.Dnsmasq\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9mA%3D","line":42,"updated":"2012-07-04 07:11:14.000000000","message":"Suggest having this as the default in the ini file.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class DhcpAgent(object):"},{"line_number":41,"context_line":"    OPTS \u003d ["},{"line_number":42,"context_line":"        cfg.StrOpt(\u0027db_connection\u0027, default\u003d\u0027sqlite://\u0027),"},{"line_number":43,"context_line":"        cfg.StrOpt(\u0027root_helper\u0027, default\u003d\u0027sudo\u0027),"},{"line_number":44,"context_line":"        cfg.StrOpt(\u0027dhcp_driver\u0027,"},{"line_number":45,"context_line":"                   default\u003d\u0027quantum.agent.linux.dhcp.Dnsmasq\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2Bo8%3D","line":42,"in_reply_to":"AAAAJ3%2F%2F9lE%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class DhcpAgent(object):"},{"line_number":41,"context_line":"    OPTS \u003d ["},{"line_number":42,"context_line":"        cfg.StrOpt(\u0027db_connection\u0027, default\u003d\u0027sqlite://\u0027),"},{"line_number":43,"context_line":"        cfg.StrOpt(\u0027root_helper\u0027, default\u003d\u0027sudo\u0027),"},{"line_number":44,"context_line":"        cfg.StrOpt(\u0027dhcp_driver\u0027,"},{"line_number":45,"context_line":"                   default\u003d\u0027quantum.agent.linux.dhcp.Dnsmasq\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9k4%3D","line":42,"in_reply_to":"AAAAJ3%2F%2F9lE%3D","updated":"2012-07-04 07:51:12.000000000","message":"ok\ni guess that this will also be dropped when we move tot he rpc support","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class DhcpAgent(object):"},{"line_number":41,"context_line":"    OPTS \u003d ["},{"line_number":42,"context_line":"        cfg.StrOpt(\u0027db_connection\u0027, default\u003d\u0027sqlite://\u0027),"},{"line_number":43,"context_line":"        cfg.StrOpt(\u0027root_helper\u0027, default\u003d\u0027sudo\u0027),"},{"line_number":44,"context_line":"        cfg.StrOpt(\u0027dhcp_driver\u0027,"},{"line_number":45,"context_line":"                   default\u003d\u0027quantum.agent.linux.dhcp.Dnsmasq\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9lE%3D","line":42,"in_reply_to":"AAAAJ3%2F%2F9mA%3D","updated":"2012-07-04 07:23:36.000000000","message":"unfortunately, this doesn\u0027t really make sense as a default, as the whole point of the DB is to be accessing the same DB as the quantum plugin, and that will never be the case with an in-memory sqlite db.  I would like to make sure the ini file has an example of the standard sqlalchemy strings for both the OVS + LB plugin.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            time.sleep(self.polling_interval)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def _state_builder(self):"},{"line_number":80,"context_line":"        \"\"\"Polls the Quantum database and returns a represenation"},{"line_number":81,"context_line":"        of the network state."},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        The value returned is a State tuple that contains three sets:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9ro%3D","line":80,"updated":"2012-07-04 02:43:43.000000000","message":"Use Poll, not Polls. Poll means command.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":77,"context_line":"            time.sleep(self.polling_interval)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def _state_builder(self):"},{"line_number":80,"context_line":"        \"\"\"Polls the Quantum database and returns a represenation"},{"line_number":81,"context_line":"        of the network state."},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        The value returned is a State tuple that contains three sets:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9lo%3D","line":80,"in_reply_to":"AAAAJ3%2F%2F9ro%3D","updated":"2012-07-04 07:11:15.000000000","message":"Not sure I following... I think the comment is clear as is.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":99,"context_line":"                # we have to commit to get the latest view"},{"line_number":100,"context_line":"                self.db.commit()"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"            subnets \u003d {}"},{"line_number":103,"context_line":"            subnet_hashes \u003d set()"},{"line_number":104,"context_line":"            for subnet in self.db.subnets.all():"},{"line_number":105,"context_line":"                subnet_hashes.add((hash(str(subnet)), subnet.network_id))"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2B7Y%3D","line":102,"updated":"2012-07-05 23:12:49.000000000","message":"better call this dict networks or something else that helps understanding that it\u0027s going to store network ids","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":102,"context_line":"            subnets \u003d {}"},{"line_number":103,"context_line":"            subnet_hashes \u003d set()"},{"line_number":104,"context_line":"            for subnet in self.db.subnets.all():"},{"line_number":105,"context_line":"                subnet_hashes.add((hash(str(subnet)), subnet.network_id))"},{"line_number":106,"context_line":"                subnets[subnet.id] \u003d subnet.network_id"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"            ipalloc_hashes \u003d set([(hash(str(a)), subnets[a.subnet_id])"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2B8Q%3D","line":105,"updated":"2012-07-05 23:12:49.000000000","message":"Maybe we can calculate the hash just using subnet.id. not the whole object. This should make the computation of the hash less expensive.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":102,"context_line":"            subnets \u003d {}"},{"line_number":103,"context_line":"            subnet_hashes \u003d set()"},{"line_number":104,"context_line":"            for subnet in self.db.subnets.all():"},{"line_number":105,"context_line":"                subnet_hashes.add((hash(str(subnet)), subnet.network_id))"},{"line_number":106,"context_line":"                subnets[subnet.id] \u003d subnet.network_id"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"            ipalloc_hashes \u003d set([(hash(str(a)), subnets[a.subnet_id])"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2Bo0%3D","line":105,"in_reply_to":"AAAAKH%2F%2F%2B8Q%3D","updated":"2012-07-06 18:26:19.000000000","message":"I tried hashing id at first, but then subnet metadata changes aren\u0027t detected.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":105,"context_line":"                subnet_hashes.add((hash(str(subnet)), subnet.network_id))"},{"line_number":106,"context_line":"                subnets[subnet.id] \u003d subnet.network_id"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"            ipalloc_hashes \u003d set([(hash(str(a)), subnets[a.subnet_id])"},{"line_number":109,"context_line":"                                 for a in self.db.ipallocations.all()])"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"            networks \u003d set(subnets.itervalues())"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2B8A%3D","line":108,"updated":"2012-07-05 23:12:49.000000000","message":"As IPAllocation does not have a UUID, here it makes sense using the whole object for generating the hash","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def get_network_state_delta(self):"},{"line_number":121,"context_line":"        \"\"\"Returns a dict containing the sets of networks that are new,"},{"line_number":122,"context_line":"           updated, and deleted.\"\"\""},{"line_number":123,"context_line":"        delta \u003d {}"},{"line_number":124,"context_line":"        state \u003d self._state_builder()"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9rk%3D","line":122,"updated":"2012-07-04 02:43:43.000000000","message":"Return not Returns. Also align the second line to the open \u0027\u0027\u0027\u0027, not the first letter.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def get_network_state_delta(self):"},{"line_number":121,"context_line":"        \"\"\"Returns a dict containing the sets of networks that are new,"},{"line_number":122,"context_line":"           updated, and deleted.\"\"\""},{"line_number":123,"context_line":"        delta \u003d {}"},{"line_number":124,"context_line":"        state \u003d self._state_builder()"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2Boo%3D","line":122,"in_reply_to":"AAAAJ3%2F%2F9rk%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":147,"context_line":"        )"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        # the updated set will contain new and deleted networks, so remove them"},{"line_number":150,"context_line":"        delta[\u0027updated\u0027] \u003d candidates - delta[\u0027new\u0027] - delta[\u0027deleted\u0027]"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        self.prev_state \u003d state"},{"line_number":153,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2B68%3D","line":150,"updated":"2012-07-05 23:12:49.000000000","message":"I find the way in which the deltas are calculated to be very clever. I might add that since candidates is poised to be a much larger set than delta[\u0027new\u0027] and delta[\u0027deleted\u0027] you might want to consider the following formula:\n\ndelta[\u0027updated\u0027] \u003d candidates.difference_update(delta[new] | delta[\u0027deleted\u0027])","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        return delta"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def call_driver(self, action, network_id):"},{"line_number":157,"context_line":"        \"\"\"This method will invoke an action on a DHCP driver instance.\"\"\""},{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            # the Driver expects something that is duck typed similar to"},{"line_number":160,"context_line":"            # the base models.  Augmenting will add support to the SqlSoup"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9rg%3D","line":157,"updated":"2012-07-04 02:43:43.000000000","message":"Use \"Invoke an action ....\"","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":154,"context_line":"        return delta"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def call_driver(self, action, network_id):"},{"line_number":157,"context_line":"        \"\"\"This method will invoke an action on a DHCP driver instance.\"\"\""},{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            # the Driver expects something that is duck typed similar to"},{"line_number":160,"context_line":"            # the base models.  Augmenting will add support to the SqlSoup"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2Bok%3D","line":157,"in_reply_to":"AAAAJ3%2F%2F9rg%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":174,"context_line":"            LOG.warn(\u0027Unable to %s dhcp. Exception: %s\u0027 % (action, e))"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"            # Manipulate the state so the action will be attempted on next"},{"line_number":177,"context_line":"            # loop iteration."},{"line_number":178,"context_line":"            if action \u003d\u003d \u0027disable\u0027:"},{"line_number":179,"context_line":"                # adding to prev state means we\u0027ll try to delete it next time"},{"line_number":180,"context_line":"                self.prev_state.networks.add(network_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2B5s%3D","line":177,"updated":"2012-07-05 23:12:49.000000000","message":"what if the failure occurs while action is \u0027reload_allocations\u0027?","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":174,"context_line":"            LOG.warn(\u0027Unable to %s dhcp. Exception: %s\u0027 % (action, e))"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"            # Manipulate the state so the action will be attempted on next"},{"line_number":177,"context_line":"            # loop iteration."},{"line_number":178,"context_line":"            if action \u003d\u003d \u0027disable\u0027:"},{"line_number":179,"context_line":"                # adding to prev state means we\u0027ll try to delete it next time"},{"line_number":180,"context_line":"                self.prev_state.networks.add(network_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2BoY%3D","line":177,"in_reply_to":"AAAAKH%2F%2F%2B5s%3D","updated":"2012-07-06 18:26:19.000000000","message":"The network will be removed from the known state.  On the network iteration, the network will look new and be reloaded.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                self.prev_state.networks.remove(network_id)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"class DevHelper(object):"},{"line_number":187,"context_line":"    OPTS \u003d ["},{"line_number":188,"context_line":"        cfg.StrOpt(\u0027admin_user\u0027),"},{"line_number":189,"context_line":"        cfg.StrOpt(\u0027admin_password\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9mg%3D","line":186,"updated":"2012-07-04 06:57:20.000000000","message":"I think this class is just for plugin gate way interface, So we can modify the class name to make it more meaningful.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":183,"context_line":"                self.prev_state.networks.remove(network_id)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"class DevHelper(object):"},{"line_number":187,"context_line":"    OPTS \u003d ["},{"line_number":188,"context_line":"        cfg.StrOpt(\u0027admin_user\u0027),"},{"line_number":189,"context_line":"        cfg.StrOpt(\u0027admin_password\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2BoU%3D","line":186,"in_reply_to":"AAAAJ3%2F%2F9lk%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":183,"context_line":"                self.prev_state.networks.remove(network_id)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"class DevHelper(object):"},{"line_number":187,"context_line":"    OPTS \u003d ["},{"line_number":188,"context_line":"        cfg.StrOpt(\u0027admin_user\u0027),"},{"line_number":189,"context_line":"        cfg.StrOpt(\u0027admin_password\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9lk%3D","line":186,"in_reply_to":"AAAAJ3%2F%2F9mg%3D","updated":"2012-07-04 07:11:15.000000000","message":"I tend to agree here that the name could be more meaningful.  Dev just means too many different things, and when I first reviewed the patch I was confused as well.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        self.driver \u003d importutils.import_object(conf.interface_driver, conf)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def setup(self, network):"},{"line_number":207,"context_line":"        dev \u003d (\u0027tap\u0027 + network.id)[:self.driver.DEV_NAME_LEN]"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # allocate port in Quantum"},{"line_number":210,"context_line":"        quantum \u003d client.Client("}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9mw%3D","line":207,"updated":"2012-07-04 06:57:20.000000000","message":"I think you are creating gateway, so it should be \u0027gw-\u0027, not \u0027tap\u0027","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":204,"context_line":"        self.driver \u003d importutils.import_object(conf.interface_driver, conf)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def setup(self, network):"},{"line_number":207,"context_line":"        dev \u003d (\u0027tap\u0027 + network.id)[:self.driver.DEV_NAME_LEN]"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # allocate port in Quantum"},{"line_number":210,"context_line":"        quantum \u003d client.Client("}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2BoQ%3D","line":207,"in_reply_to":"AAAAJ3%2F%2F9mw%3D","updated":"2012-07-06 18:26:19.000000000","message":"Since the DHCP agent is not a gateway I did not want to use \u0027gw\u0027.  Some of the agents look for only \u0027gw\u0027 or \u0027tap\u0027 prefixes.  I\u0027d prefer to use different prefix in the device name. I figure we can handle that in a bug report after this lands.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":204,"context_line":"        self.driver \u003d importutils.import_object(conf.interface_driver, conf)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def setup(self, network):"},{"line_number":207,"context_line":"        dev \u003d (\u0027tap\u0027 + network.id)[:self.driver.DEV_NAME_LEN]"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # allocate port in Quantum"},{"line_number":210,"context_line":"        quantum \u003d client.Client("}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9lg%3D","line":207,"in_reply_to":"AAAAJ3%2F%2F9mw%3D","updated":"2012-07-04 07:11:15.000000000","message":"that is a convention we followed in the nova-network code, but there\u0027s no strict requirement for it here.  I did mention to Mark that we\u0027ll want some way to identify a port as a DHCP port.  The \u0027device_id\u0027 attribute of a quantum port is one option.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":221,"context_line":"            device_id\u003d\u0027dhcp-%s\u0027 % network.id,"},{"line_number":222,"context_line":"            network_id\u003dnetwork.id,"},{"line_number":223,"context_line":"            tenant_id\u003dnetwork.tenant_id,"},{"line_number":224,"context_line":"            fixed_ips\u003d[dict(subnet_id\u003ds.id) for s in network.subnets]))"},{"line_number":225,"context_line":"        port_dict \u003d quantum.create_port(body)[\u0027port\u0027]"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        # we have to call commit since the port was created in outside of"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9l8%3D","line":224,"updated":"2012-07-04 06:57:20.000000000","message":"we must specify the ip_address for dnsmasq to listen on. For dhcp-server, it is should be the first one of the subnet. for example, 10.0.1.0/24, it should be 10.0.1.1. We cannot get a random ip for this purpose.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":221,"context_line":"            device_id\u003d\u0027dhcp-%s\u0027 % network.id,"},{"line_number":222,"context_line":"            network_id\u003dnetwork.id,"},{"line_number":223,"context_line":"            tenant_id\u003dnetwork.tenant_id,"},{"line_number":224,"context_line":"            fixed_ips\u003d[dict(subnet_id\u003ds.id) for s in network.subnets]))"},{"line_number":225,"context_line":"        port_dict \u003d quantum.create_port(body)[\u0027port\u0027]"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        # we have to call commit since the port was created in outside of"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9lY%3D","line":224,"in_reply_to":"AAAAJ3%2F%2F9l8%3D","updated":"2012-07-04 07:11:15.000000000","message":"we talked about this on the list a while back.  This approach of allocating a random IP from each subnet makes sense to me. There\u0027s no requirement that DHCP be on a particular IP, and this gives us the flexibility to have a DHCP service that is decoupled from the L3 gateway service, which is nice.  Is there a requirement you were thinking about that I\u0027m missing?","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":221,"context_line":"            device_id\u003d\u0027dhcp-%s\u0027 % network.id,"},{"line_number":222,"context_line":"            network_id\u003dnetwork.id,"},{"line_number":223,"context_line":"            tenant_id\u003dnetwork.tenant_id,"},{"line_number":224,"context_line":"            fixed_ips\u003d[dict(subnet_id\u003ds.id) for s in network.subnets]))"},{"line_number":225,"context_line":"        port_dict \u003d quantum.create_port(body)[\u0027port\u0027]"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        # we have to call commit since the port was created in outside of"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2Fw8%3D","line":224,"in_reply_to":"AAAAJ3%2F%2F9lY%3D","updated":"2012-07-04 23:48:43.000000000","message":"nova API get-instance-nw-info() needs the gateway/dhcp server information. Currently we return the gateway ip from subnet. So we must use it as dnsmasq\u0027s listening port. Otherwise nova-compute\u0027s iptables rules will not work.\nI have no idea how the nova use the different gateway IP and dchp IP. You know when we are in multi-host env, we cannot use gateway in subnet as instance\u0027s gateway.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        # we have to call commit since the port was created in outside of"},{"line_number":228,"context_line":"        # our current transaction"},{"line_number":229,"context_line":"        self.db.commit()"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"        port \u003d AugmentingWrapper("},{"line_number":232,"context_line":"            self.db.ports.filter_by(id\u003dport_dict[\u0027id\u0027]).one(),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2B6E%3D","line":229,"updated":"2012-07-05 23:12:49.000000000","message":"I would like to understand a little bit more what\u0027s the logic here. We are using the quantum client to create a port that the dnsmasq interface will use, which makes sense to me.\n\nBut then (see below) we retrieve it accessing the db locally. I reckon that there must be a very good reason for doing so, but it should be clarified in a comment.\n\n(not important) consider also using prune instead of commit","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        # we have to call commit since the port was created in outside of"},{"line_number":228,"context_line":"        # our current transaction"},{"line_number":229,"context_line":"        self.db.commit()"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"        port \u003d AugmentingWrapper("},{"line_number":232,"context_line":"            self.db.ports.filter_by(id\u003dport_dict[\u0027id\u0027]).one(),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2Bn8%3D","line":229,"in_reply_to":"AAAAKH%2F%2F%2B6E%3D","updated":"2012-07-06 18:26:19.000000000","message":"I\u0027ve added a comment in the code.  The asymmetric access to the db is because we need an internal RPC service for agents.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":268,"context_line":"    def __repr__(self):"},{"line_number":269,"context_line":"        return repr(self.obj)"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    def __getattr__(self, name):"},{"line_number":272,"context_line":"        try:"},{"line_number":273,"context_line":"            return getattr(self.obj, name)"},{"line_number":274,"context_line":"        except:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2B6g%3D","line":271,"updated":"2012-07-05 23:12:49.000000000","message":"I don\u0027t find easy understanding the logic implemented by this method - would it be possible to add a docstring?","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":268,"context_line":"    def __repr__(self):"},{"line_number":269,"context_line":"        return repr(self.obj)"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    def __getattr__(self, name):"},{"line_number":272,"context_line":"        try:"},{"line_number":273,"context_line":"            return getattr(self.obj, name)"},{"line_number":274,"context_line":"        except:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2Bng%3D","line":271,"in_reply_to":"AAAAKH%2F%2F%2B6g%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":293,"context_line":""},{"line_number":294,"context_line":"        raise AttributeError"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"def main(args):"},{"line_number":298,"context_line":"    conf \u003d config.setup_conf()"},{"line_number":299,"context_line":"    conf.register_opts(DhcpAgent.OPTS)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9kE%3D","line":296,"updated":"2012-07-04 08:39:11.000000000","message":"I think that all of the work with the configuration file is problematic. I sueggest that in the mean time we take the same approach to that of the other agents (which will be treated better in F3).\n1. The agent will have the configuration file as input\n    conf \u003d cfg.ConfigOpts()\n    conf(args\u003d[], default_config_files\u003d[config_file])\nIn this case the config_file is the argv[1]\n2. Logging - use simple logging as the OVS agent. There is a BP to do common logging for all agents.\n\nSorry for all of the piece meal comments - I am testing with devstack and running into issues along the way.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":293,"context_line":""},{"line_number":294,"context_line":"        raise AttributeError"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"def main(args):"},{"line_number":298,"context_line":"    conf \u003d config.setup_conf()"},{"line_number":299,"context_line":"    conf.register_opts(DhcpAgent.OPTS)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2FsA%3D","line":296,"updated":"2012-07-05 11:17:25.000000000","message":"Please ignore all of my comments below - they are not relevant. I was passing incorrect parameters","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":294,"context_line":"        raise AttributeError"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"def main(args):"},{"line_number":298,"context_line":"    conf \u003d config.setup_conf()"},{"line_number":299,"context_line":"    conf.register_opts(DhcpAgent.OPTS)"},{"line_number":300,"context_line":"    conf.register_opts(DevHelper.OPTS)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9ks%3D","line":297,"updated":"2012-07-04 07:51:12.000000000","message":"you do not need the args","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":295,"context_line":""},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"def main(args):"},{"line_number":298,"context_line":"    conf \u003d config.setup_conf()"},{"line_number":299,"context_line":"    conf.register_opts(DhcpAgent.OPTS)"},{"line_number":300,"context_line":"    conf.register_opts(DevHelper.OPTS)"},{"line_number":301,"context_line":"    conf.register_opts(dhcp.OPTS)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9rc%3D","line":298,"updated":"2012-07-04 02:43:43.000000000","message":"I see alss options will go to command line, please use the same way we do in all plugin agents.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":295,"context_line":""},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"def main(args):"},{"line_number":298,"context_line":"    conf \u003d config.setup_conf()"},{"line_number":299,"context_line":"    conf.register_opts(DhcpAgent.OPTS)"},{"line_number":300,"context_line":"    conf.register_opts(DevHelper.OPTS)"},{"line_number":301,"context_line":"    conf.register_opts(dhcp.OPTS)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2Fw4%3D","line":298,"in_reply_to":"AAAAJ3%2F%2F9lU%3D","updated":"2012-07-04 23:48:43.000000000","message":"[root@robinlinux bin]# ./quantum-openvswitch-agent -h\nUsage: quantum-openvswitch-agent [OPTIONS] \u003cconfig file\u003e\n\nOptions:\n  -h, --help     show this help message and exit\n  -v, --verbose  turn on verbose logging\n[root@robinlinux bin]# ./quantum-linuxbridge-agent -h\nUsage: quantum-linuxbridge-agent [OPTIONS] \u003cconfig file\u003e\n\nOptions:\n  -h, --help     show this help message and exit\n  -v, --verbose  turn on verbose logging\n[root@robinlinux bin]# ./quantum-dhcp-agent -h\nUsage: quantum-dhcp-agent [options]\n\nOptions:\n  -h, --help            show this help message and exit\n  --dnsmasq_dns_server\u003dDNSMASQ_DNS_SERVER\n                        Use DNS another server before any in /etc/resolv.conf.\n  -v, --verbose         Print more verbose output\n  --noverbose           The inverse of --verbose\n  --interface_driver\u003dINTERFACE_DRIVER\n                        The driver used to manage the virtual interface.\n  --root_helper\u003dROOT_HELPER\n  --ovs_integration_bridge\u003dOVS_INTEGRATION_BRIDGE\n                        Name of Open vSwitch bridge to use\n  --dnsmasq_config_file\u003dDNSMASQ_CONFIG_FILE\n                        Override the default dnsmasq settings with this file\n  --config-dir\u003dDIR      Path to a config directory to pull *.conf files from.\n                        This file set is sorted, so as to provide a\n                        predictable parse order if individual options are\n                        over-ridden. The set is parsed after the file(s), if\n                        any, specified via --config-file, hence over-ridden\n                        options in the directory take precedence.\n  --log-config\u003dPATH     If this option is specified, the logging configuration\n                        file specified is used and overrides any other logging\n                        options specified. Please see the Python logging\n                        module documentation for details on logging\n                        configuration files.\n  --log-date-format\u003dDATE_FORMAT\n                        Format string for %(asctime)s in log records. Default:\n                        none\n  --network_device_mtu\u003dNETWORK_DEVICE_MTU\n                        MTU setting for device.\n  --admin_tenant_name\u003dADMIN_TENANT_NAME\n  --use-syslog          Use syslog for logging.\n  --nouse-syslog        The inverse of --use-syslog\n  --auth_region\u003dAUTH_REGION\n  --log-dir\u003dLOG_DIR     (Optional) The directory to keep log files in (will be\n                        prepended to --logfile)\n  --polling_interval\u003dPOLLING_INTERVAL\n                        The time in seconds between state poll requests.\n  --auth_strategy\u003dAUTH_STRATEGY\n  --db_connection\u003dDB_CONNECTION\n  --admin_user\u003dADMIN_USER\n  --config-file\u003dPATH    Path to a config file to use. Multiple config files\n                        can be specified, with values in later files taking\n                        precedence. The default files  used are: []\n  --admin_password\u003dADMIN_PASSWORD\n  --dhcp_domain\u003dDHCP_DOMAIN\n                        Domain to use for building the hostnames\n  --dhcp_driver\u003dDHCP_DRIVER\n                        The driver used to manage the DHCP server.\n  --syslog-log-facility\u003dSYSLOG_LOG_FACILITY\n                        syslog facility to receive log lines\n  --dhcp_lease_time\u003dDHCP_LEASE_TIME\n                        Lifetime of a DHCP lease in seconds\n  --state_path\u003dSTATE_PATH\n                        Top-level directory for maintaining dhcp state\n  --reconnect_interval\u003dRECONNECT_INTERVAL\n                        The time in seconds between db reconnect attempts.\n  --dhcp_confs\u003dDHCP_CONFS\n                        Location to store DHCP server config files\n  -d, --debug           Print debugging output\n  --nodebug             The inverse of --debug\n  --auth_url\u003dAUTH_URL   \n  --log-format\u003dFORMAT   A logging.Formatter log message format string which\n                        may use any of the available logging.LogRecord\n                        attributes. Default: none\n  --log-file\u003dPATH       (Optional) Name of log file to output to. If not set,\n                        logging will go to stdout.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":295,"context_line":""},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"def main(args):"},{"line_number":298,"context_line":"    conf \u003d config.setup_conf()"},{"line_number":299,"context_line":"    conf.register_opts(DhcpAgent.OPTS)"},{"line_number":300,"context_line":"    conf.register_opts(DevHelper.OPTS)"},{"line_number":301,"context_line":"    conf.register_opts(dhcp.OPTS)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9lU%3D","line":298,"in_reply_to":"AAAAJ3%2F%2F9rc%3D","updated":"2012-07-04 07:11:15.000000000","message":"can you clarify?  is concern that config options could be set via command line, or via conf file and that this is inconsistent with how ovs + lb agents work?","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":295,"context_line":""},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"def main(args):"},{"line_number":298,"context_line":"    conf \u003d config.setup_conf()"},{"line_number":299,"context_line":"    conf.register_opts(DhcpAgent.OPTS)"},{"line_number":300,"context_line":"    conf.register_opts(DevHelper.OPTS)"},{"line_number":301,"context_line":"    conf.register_opts(dhcp.OPTS)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2Fr8%3D","line":298,"in_reply_to":"AAAAKH%2F%2F%2Fw4%3D","updated":"2012-07-05 11:17:25.000000000","message":"The way that it is done in the DHCP is better. The quantum agents should adopt this method too.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":300,"context_line":"    conf.register_opts(DevHelper.OPTS)"},{"line_number":301,"context_line":"    conf.register_opts(dhcp.OPTS)"},{"line_number":302,"context_line":"    conf.register_opts(interface.OPTS)"},{"line_number":303,"context_line":"    conf(args)"},{"line_number":304,"context_line":"    config.setup_logging(conf)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    mgr \u003d DhcpAgent(conf)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9ko%3D","line":303,"updated":"2012-07-04 07:51:12.000000000","message":"change this to sys.argv","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":308,"context_line":""},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"},{"line_number":311,"context_line":"    main(sys.argv)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9kk%3D","line":311,"updated":"2012-07-04 07:51:12.000000000","message":"you do not need the parameter here","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":217,"context_line":"        return \u0027dhcp%s-%s\u0027 % (host_uuid, network.id)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def setup(self, network, reuse_existing\u003dFalse):"},{"line_number":220,"context_line":"        interface_name \u003d self.get_interface_name(network)"},{"line_number":221,"context_line":"        port \u003d self._get_or_create_port(network)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        if ip_lib.device_exists(interface_name):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAKX%2F%2F%2F44%3D","line":220,"updated":"2012-07-08 07:29:25.000000000","message":"I think that the interface_name should be taken from the port id and not the network id. \nIf the interface name is created from the network id then it does not work with the linux bridge agent - the logic there is that a device created from the network id should have a prefix \"gw-\".","commit_id":"a3f33d4a0be0b6ff650bf3cb658515adbd2aef34"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        return \u0027dhcp%s-%s\u0027 % (host_uuid, network.id)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def setup(self, network, reuse_existing\u003dFalse):"},{"line_number":220,"context_line":"        interface_name \u003d self.get_interface_name(network)"},{"line_number":221,"context_line":"        port \u003d self._get_or_create_port(network)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        if ip_lib.device_exists(interface_name):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAKX%2F%2F%2Fyo%3D","line":220,"in_reply_to":"AAAAKX%2F%2F%2F44%3D","updated":"2012-07-09 00:09:04.000000000","message":"I have a similar comment before, but no ...","commit_id":"a3f33d4a0be0b6ff650bf3cb658515adbd2aef34"},{"author":{"_account_id":1731,"name":"Yusuke Muraoka","email":"yusuke@nttmcl.com","username":"yusuke"},"unresolved":false,"context_lines":[{"line_number":105,"context_line":"            subnets \u003d {}"},{"line_number":106,"context_line":"            subnet_hashes \u003d set()"},{"line_number":107,"context_line":"            for subnet in self.db.subnets.all():"},{"line_number":108,"context_line":"                subnet_hashes.add((hash(str(subnet)), subnet.network_id))"},{"line_number":109,"context_line":"                subnets[subnet.id] \u003d subnet.network_id"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"            ipalloc_hashes \u003d set([(hash(str(a)), subnets[a.subnet_id])"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAKX%2F%2F%2B7o%3D","line":108,"updated":"2012-07-10 10:46:24.000000000","message":"Can hash(str()) be replaced with the subnet themself or their id?","commit_id":"43960ee4486925bff2b4da3af5db963b389f7dc2"},{"author":{"_account_id":1731,"name":"Yusuke Muraoka","email":"yusuke@nttmcl.com","username":"yusuke"},"unresolved":false,"context_lines":[{"line_number":108,"context_line":"                subnet_hashes.add((hash(str(subnet)), subnet.network_id))"},{"line_number":109,"context_line":"                subnets[subnet.id] \u003d subnet.network_id"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"            ipalloc_hashes \u003d set([(hash(str(a)), subnets[a.subnet_id])"},{"line_number":112,"context_line":"                                 for a in self.db.ipallocations.all()])"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"            networks \u003d set(subnets.itervalues())"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAKX%2F%2F%2B7k%3D","line":111,"updated":"2012-07-10 10:46:24.000000000","message":"Can hash(str()) be replaced with the \"a\" themself or their id?","commit_id":"43960ee4486925bff2b4da3af5db963b389f7dc2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        self.driver \u003d importutils.import_object(conf.interface_driver, conf)"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    def get_interface_name(self, network):"},{"line_number":210,"context_line":"        return (\u0027tap\u0027 + network.id)[:self.driver.DEV_NAME_LEN]"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    def get_device_id(self, network):"},{"line_number":213,"context_line":"        # There could be more than one dhcp server per network, so create"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAKX%2F%2F%2Fyc%3D","line":210,"updated":"2012-07-09 00:21:56.000000000","message":"Change it to \u0027gw-\u0027 ?","commit_id":"43960ee4486925bff2b4da3af5db963b389f7dc2"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":207,"context_line":"        self.driver \u003d importutils.import_object(conf.interface_driver, conf)"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    def get_interface_name(self, network):"},{"line_number":210,"context_line":"        return (\u0027tap\u0027 + network.id)[:self.driver.DEV_NAME_LEN]"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    def get_device_id(self, network):"},{"line_number":213,"context_line":"        # There could be more than one dhcp server per network, so create"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAKX%2F%2F%2FyA%3D","line":210,"in_reply_to":"AAAAKX%2F%2F%2Fyc%3D","updated":"2012-07-09 01:42:42.000000000","message":"I don\u0027t think that\u0027s really necessary, though garyk\u0027s email does point out reasons why I think the right general approach here is actually to base the interface on port-id.","commit_id":"43960ee4486925bff2b4da3af5db963b389f7dc2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":268,"context_line":"            network_id\u003dnetwork.id,"},{"line_number":269,"context_line":"            tenant_id\u003dnetwork.tenant_id,"},{"line_number":270,"context_line":"            fixed_ips\u003d[dict(subnet_id\u003ds.id) for s in network.subnets]))"},{"line_number":271,"context_line":"        port_dict \u003d quantum.create_port(body)[\u0027port\u0027]"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        # we have to call commit since the port was created in outside of"},{"line_number":274,"context_line":"        # our current transaction"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAKX%2F%2F%2Fyg%3D","line":271,"updated":"2012-07-09 00:21:56.000000000","message":"Help! Do you all think the IP randomly allocated to gateway and for dhcp server to listen on works for nova? \n\nThese are iptables rules for one instance from nova-compute:\n\n-A nova-compute-inst-12 -m state --state INVALID -j DROP \n\n-A nova-compute-inst-12 -m state --state RELATED,ESTABLISHED -j ACCEPT \n\n-A nova-compute-inst-12 -j nova-compute-provider \n\n-A nova-compute-inst-12 -s 10.0.1.1/32 -p udp -m udp --sport 67 --dport 68 -j ACCEPT \n\n-A nova-compute-inst-12 -s 10.0.1.0/24 -j ACCEPT \n\n-A nova-compute-inst-12 -j nova-compute-sg-fallback\n\n\nOnly the dhcp package from 10.0.1.1/32 can reach at the VM.\n\nIs my observation right?","commit_id":"43960ee4486925bff2b4da3af5db963b389f7dc2"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":268,"context_line":"            network_id\u003dnetwork.id,"},{"line_number":269,"context_line":"            tenant_id\u003dnetwork.tenant_id,"},{"line_number":270,"context_line":"            fixed_ips\u003d[dict(subnet_id\u003ds.id) for s in network.subnets]))"},{"line_number":271,"context_line":"        port_dict \u003d quantum.create_port(body)[\u0027port\u0027]"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        # we have to call commit since the port was created in outside of"},{"line_number":274,"context_line":"        # our current transaction"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAKX%2F%2F%2Fxo%3D","line":271,"in_reply_to":"AAAAKX%2F%2F%2Fyg%3D","updated":"2012-07-09 01:42:42.000000000","message":"I think randomly choosing an IP is fine.  To me the real issue is whether the IP chosen can be communicated to whoever is pushing down filters (nova now, or quantum in the future).  For example, in nova, there\u0027s the \u0027dhcp_server\u0027 attribute of a network.  It may make sense to add something like this to a Quantum subnet, either as part of the core API or as an extension (I assume the nova/quantum integration code turns each Quantum subnet into a nova network, is that correct?).  \n\nThat way, this code could allocate an IP, then modify the \u0027dhcp_server\u0027 property on the subnet.  In theory, we could even allow someone to use the dhcp_server attribute to tell what they thought the DHCP IP should be on the subnet.  \n\nI don\u0027t view this as a blocker to merge though.  In particular, most of us have been testing with LIBVIRT_FIREWALL_DRIVER\u003dnova.virt.firewall.NoopFirewallDriver which is mentioned here, http://wiki.openstack.org/RunningQuantumV2Api (or using OVS).  But it might make sense to add that flag to devstack for Quantum by default in the mean time, as you point out.","commit_id":"43960ee4486925bff2b4da3af5db963b389f7dc2"}],"quantum/agent/linux/dhcp.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":35,"context_line":"OPTS \u003d ["},{"line_number":36,"context_line":"    cfg.StrOpt(\u0027dhcp_confs\u0027,"},{"line_number":37,"context_line":"               default\u003d\u0027$state_path/dhcp\u0027,"},{"line_number":38,"context_line":"               help\u003d\u0027location to keep the config files\u0027),"},{"line_number":39,"context_line":"    cfg.IntOpt(\u0027dhcp_lease_time\u0027,"},{"line_number":40,"context_line":"               default\u003d120,"},{"line_number":41,"context_line":"               help\u003d\u0027Lifetime of a DHCP lease in seconds\u0027),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6zY%3D","line":38,"updated":"2012-06-28 01:41:44.000000000","message":"Please be consistent in formatting config help messages.  The convention seems to be capitalizing the first word.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":43,"context_line":"               default\u003d\u0027openstacklocal\u0027,"},{"line_number":44,"context_line":"               help\u003d\u0027domain to use for building the hostnames\u0027),"},{"line_number":45,"context_line":"    cfg.StrOpt(\u0027dnsmasq_config_file\u0027,"},{"line_number":46,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":47,"context_line":"               help\u003d\u0027Override the default dnsmasq settings with this file\u0027),"},{"line_number":48,"context_line":"    cfg.StrOpt(\u0027dnsmasq_dns_server\u0027,"},{"line_number":49,"context_line":"               default\u003dNone,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6zc%3D","line":46,"updated":"2012-06-28 01:41:44.000000000","message":"Why should the default be an empty string?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":46,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":47,"context_line":"               help\u003d\u0027Override the default dnsmasq settings with this file\u0027),"},{"line_number":48,"context_line":"    cfg.StrOpt(\u0027dnsmasq_dns_server\u0027,"},{"line_number":49,"context_line":"               default\u003dNone,"},{"line_number":50,"context_line":"               help\u003d\u0027if set, uses specific dns server for dnsmasq\u0027),"},{"line_number":51,"context_line":"]"},{"line_number":52,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6zg%3D","line":49,"updated":"2012-06-28 01:41:44.000000000","message":"Since the default value is already None, this line is unnecessary.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    @abc.abstractmethod"},{"line_number":64,"context_line":"    def enable(self):"},{"line_number":65,"context_line":"        \"\"\"enables dhcp for this network\"\"\""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    @abc.abstractmethod"},{"line_number":68,"context_line":"    def disable(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6zU%3D","line":65,"updated":"2012-06-28 01:41:44.000000000","message":"HACKING - docstring formatting (applies to all methods in this class)","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        self.enable()"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    @abc.abstractproperty"},{"line_number":79,"context_line":"    def active(self):"},{"line_number":80,"context_line":"        \"\"\" returns whether the dhcp is active \"\"\""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6yA%3D","line":79,"updated":"2012-06-28 01:41:44.000000000","message":"Consider using a question statement to name boolean properties such as this one, e.g. is_active.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":104,"context_line":"        pid \u003d self.pid"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        if self.active:"},{"line_number":107,"context_line":"            utils.execute([\u0027kill\u0027, \u0027-9\u0027, pid], self.root_helper)"},{"line_number":108,"context_line":"            self.dev_helper.destroy(self.dev)"},{"line_number":109,"context_line":"        elif pid:"},{"line_number":110,"context_line":"            LOG.debug(_(\u0027DHCP for %s pid %d is stale, ignoring command\u0027) %"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F8U%3D","line":107,"updated":"2012-06-28 22:04:35.000000000","message":"We\u0027ll need to update quantum/rootwrap for DHCP.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        else:"},{"line_number":113,"context_line":"            LOG.debug(_(\u0027No DHCP started for %s\u0027) % self.network.id)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def conf_file_name(self, kind, ensure_conf_dir\u003dFalse):"},{"line_number":116,"context_line":"        confs_dir \u003d os.path.abspath(os.path.normpath(self.conf.dhcp_confs))"},{"line_number":117,"context_line":"        conf_dir \u003d os.path.join(confs_dir, self.network.id)"},{"line_number":118,"context_line":"        if ensure_conf_dir:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6zE%3D","line":115,"updated":"2012-06-28 01:41:44.000000000","message":"Consider changing this method name to reflect it\u0027s purpose - retrieving a conf file name (e.g. get_conf_file_name).  conf_file_name is more suited to an attribute or property than a method.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        conf_dir \u003d os.path.join(confs_dir, self.network.id)"},{"line_number":118,"context_line":"        if ensure_conf_dir:"},{"line_number":119,"context_line":"            if not os.path.isdir(conf_dir):"},{"line_number":120,"context_line":"                os.makedirs(conf_dir)"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        return os.path.join(conf_dir, kind)"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6ys%3D","line":120,"updated":"2012-06-28 01:41:44.000000000","message":"The default mode for makedirs is 777.  Consider setting it to something more restrictive.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        try:"},{"line_number":128,"context_line":"            with open(pid_file, \u0027r\u0027) as f:"},{"line_number":129,"context_line":"                return int(f.read())"},{"line_number":130,"context_line":"        except:"},{"line_number":131,"context_line":"            return None"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6yo%3D","line":130,"updated":"2012-06-28 01:41:44.000000000","message":"Consider using a more specific except clause.  If the file is unreadable due to permissions problem, a log message would aid in debugging.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":134,"context_line":"    def active(self):"},{"line_number":135,"context_line":"        pid \u003d self.pid"},{"line_number":136,"context_line":"        cmd \u003d [\u0027cat\u0027, \u0027/proc/%s/cmdline\u0027 % pid]"},{"line_number":137,"context_line":"        out \u003d utils.execute(cmd, self.root_helper, check_exit_code\u003dFalse)"},{"line_number":138,"context_line":"        if self.network.id in out:"},{"line_number":139,"context_line":"            return True"},{"line_number":140,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6yY%3D","line":137,"updated":"2012-06-28 01:41:44.000000000","message":"Why is it desirable to ignore the exit code?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        pid \u003d self.pid"},{"line_number":136,"context_line":"        cmd \u003d [\u0027cat\u0027, \u0027/proc/%s/cmdline\u0027 % pid]"},{"line_number":137,"context_line":"        out \u003d utils.execute(cmd, self.root_helper, check_exit_code\u003dFalse)"},{"line_number":138,"context_line":"        if self.network.id in out:"},{"line_number":139,"context_line":"            return True"},{"line_number":140,"context_line":"        else:"},{"line_number":141,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6yg%3D","line":138,"updated":"2012-06-28 01:41:44.000000000","message":"Consider replacing these 4 lines with:\n\nreturn (self.network.id in out)","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":140,"context_line":"        else:"},{"line_number":141,"context_line":"            return False"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def add_accept_rules(self):"},{"line_number":144,"context_line":"        \"\"\" allow DHCP and DNS traffic through dnsmasq \"\"\""},{"line_number":145,"context_line":"        tpl \u003d \u0027-i %(dev)s -p %(proto)s -m %(proto)s --dport %(port)s -j ACCEPT\u0027"},{"line_number":146,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F6s%3D","line":143,"updated":"2012-06-28 22:04:35.000000000","message":"This impl is very specific to how nova does filtering using IPtables.  It wouldn\u0027t work for plugins that use other types of filtering.  This seems more like something the plugin agent itself should be doing (i.e., the same agent that would be implementing firewall/security group policies).","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            return False"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def add_accept_rules(self):"},{"line_number":144,"context_line":"        \"\"\" allow DHCP and DNS traffic through dnsmasq \"\"\""},{"line_number":145,"context_line":"        tpl \u003d \u0027-i %(dev)s -p %(proto)s -m %(proto)s --dport %(port)s -j ACCEPT\u0027"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        protos \u003d [\u0027udp\u0027, \u0027tcp\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6yU%3D","line":144,"updated":"2012-06-28 01:41:44.000000000","message":"HACKING - docstring formatting","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def add_accept_rules(self):"},{"line_number":144,"context_line":"        \"\"\" allow DHCP and DNS traffic through dnsmasq \"\"\""},{"line_number":145,"context_line":"        tpl \u003d \u0027-i %(dev)s -p %(proto)s -m %(proto)s --dport %(port)s -j ACCEPT\u0027"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        protos \u003d [\u0027udp\u0027, \u0027tcp\u0027]"},{"line_number":148,"context_line":"        ipt_mgr \u003d iptables_manager.IptablesManager()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6yE%3D","line":145,"updated":"2012-06-28 01:41:44.000000000","message":"Prefer descriptive names to short-forms where possible.  tpl is much less clear than template.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        ipt_mgr \u003d iptables_manager.IptablesManager()"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        for version in set([s.ip_version for s in self.network.subnets]):"},{"line_number":151,"context_line":"            table \u003d getattr(ipt_mgr, \u0027ipv%d\u0027 % version, {})[\u0027filter\u0027]"},{"line_number":152,"context_line":"            ports \u003d self.PORTS.get(version, [])"},{"line_number":153,"context_line":"            for port, proto in itertools.product(ports, protos):"},{"line_number":154,"context_line":"                args \u003d dict(dev\u003dself.dev, proto\u003dproto, port\u003dport)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6yQ%3D","line":151,"updated":"2012-06-28 01:41:44.000000000","message":"If the attribute does not exists and getattr returns {} by default, the subsequent attempt to access the \u0027filter\u0027 key will fail.  Will the attribute always exist (in which case the default should be removed), or should the value for \u0027filter\u0027 be retrieved with get() instead?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        ipt_mgr.apply()"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    @property"},{"line_number":159,"context_line":"    def dev(self):"},{"line_number":160,"context_line":"        pid_file \u003d self.conf_file_name(\u0027dev\u0027)"},{"line_number":161,"context_line":"        try:"},{"line_number":162,"context_line":"            with open(pid_file, \u0027r\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6x8%3D","line":159,"updated":"2012-06-28 01:41:44.000000000","message":"What is dev?  Device id?  Interface id?  Interface name?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        try:"},{"line_number":162,"context_line":"            with open(pid_file, \u0027r\u0027) as f:"},{"line_number":163,"context_line":"                return f.read()"},{"line_number":164,"context_line":"        except:"},{"line_number":165,"context_line":"            return None"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6x4%3D","line":164,"updated":"2012-06-28 01:41:44.000000000","message":"Consider using a more specific except clause","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"class Dnsmasq(DhcpLocalProcess):"},{"line_number":173,"context_line":"    PORTS \u003d {4: (53, 67), 6: (53, 467)}"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def spawn_process(self):"},{"line_number":176,"context_line":"        \"\"\" start a dnsmasq process for the network the dev \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6x0%3D","line":173,"updated":"2012-06-28 01:41:44.000000000","message":"Consider using named constants instead of magic numbers.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    PORTS \u003d {4: (53, 67), 6: (53, 467)}"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def spawn_process(self):"},{"line_number":176,"context_line":"        \"\"\" start a dnsmasq process for the network the dev \"\"\""},{"line_number":177,"context_line":"        cmd \u003d ["},{"line_number":178,"context_line":"            \u0027NETWORK_ID\u003d%s\u0027 % self.network.id,"},{"line_number":179,"context_line":"            \u0027dnsmasq\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6xw%3D","line":176,"updated":"2012-06-28 01:41:44.000000000","message":"HACKING - docstring formatting","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def spawn_process(self):"},{"line_number":176,"context_line":"        \"\"\" start a dnsmasq process for the network the dev \"\"\""},{"line_number":177,"context_line":"        cmd \u003d ["},{"line_number":178,"context_line":"            \u0027NETWORK_ID\u003d%s\u0027 % self.network.id,"},{"line_number":179,"context_line":"            \u0027dnsmasq\u0027,"},{"line_number":180,"context_line":"            \u0027--no-hosts\u0027,"},{"line_number":181,"context_line":"            \u0027--no-resolv\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F6g%3D","line":178,"updated":"2012-06-28 22:04:35.000000000","message":"is NETWORK_ID used?  I believe that was required in nova because nova had the nova-dhcpbridge script.  Do we have an equivalent in this implementation? \n\nnova-dhcpbridge was used as a callback to tell Nova that the DHCP server has released an IP.  We\u0027ll probably need to talk about how that information is reported back to Quantum, to make sure Quantum does not recycle an IP before the DHCP server is ready to hand it out again.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":188,"context_line":"            #TODO (mark): calculate value from cidr (defaults to 150)"},{"line_number":189,"context_line":"            #\u0027--dhcp-lease-max\u003d%s\u0027 % ?,"},{"line_number":190,"context_line":"            \u0027--dhcp-hostfile\u003d%s\u0027 % self.conf_file_name(\u0027host\u0027),"},{"line_number":191,"context_line":"            \u0027--dhcp-optsfile\u003d%s\u0027 % self._output_opts_file(),"},{"line_number":192,"context_line":"            \u0027--leasefile-ro\u0027,"},{"line_number":193,"context_line":"        ]"},{"line_number":194,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F6I%3D","line":191,"updated":"2012-06-28 22:04:35.000000000","message":"last we talked, dnsmasq was going to be able to use an IP other than the gateway IP.  I definitely think that should be the case, and if so, then we need to support dnsmasq passing back dhcp-option\u003doption:router with the the correct gateway IP.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        ]"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        for subnet in self.network.subnets:"},{"line_number":196,"context_line":"            if subnet.ip_version \u003d\u003d 4:"},{"line_number":197,"context_line":"                mode \u003d \u0027static\u0027"},{"line_number":198,"context_line":"            else:"},{"line_number":199,"context_line":"                mode \u003d \u0027static\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6xs%3D","line":196,"updated":"2012-06-28 01:41:44.000000000","message":"Should mode be set to \u0027static\u0027 for both ipv4 and 6?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":196,"context_line":"            if subnet.ip_version \u003d\u003d 4:"},{"line_number":197,"context_line":"                mode \u003d \u0027static\u0027"},{"line_number":198,"context_line":"            else:"},{"line_number":199,"context_line":"                mode \u003d \u0027static\u0027"},{"line_number":200,"context_line":"            cmd.append(\u0027--dhcp-range\u003d%s,%s,%ss\u0027 %"},{"line_number":201,"context_line":"                       (netaddr.IPNetwork(subnet.cidr).network,"},{"line_number":202,"context_line":"                       mode,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F54%3D","line":199,"updated":"2012-06-28 22:04:35.000000000","message":"yes, unclear why if/else is needed here.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":205,"context_line":"        if self.conf.dnsmasq_config_file:"},{"line_number":206,"context_line":"            cmd.append(\u0027--conf-file\u003d%s\u0027 % self.conf.dnsmasq_config_file)"},{"line_number":207,"context_line":"        if self.conf.dnsmasq_dns_server:"},{"line_number":208,"context_line":"            cmd.append(\u0027--server\u003d%s\u0027 % self.conf.dnsmasq_dns_server)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"        out \u003d utils.execute(cmd, self.root_helper)"},{"line_number":211,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F%2Fg%3D","line":208,"updated":"2012-06-28 22:04:35.000000000","message":"we should use the DNS servers defined for the subnet, right?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        if self.conf.dnsmasq_dns_server:"},{"line_number":208,"context_line":"            cmd.append(\u0027--server\u003d%s\u0027 % self.conf.dnsmasq_dns_server)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"        out \u003d utils.execute(cmd, self.root_helper)"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    def reload_allocations(self):"},{"line_number":213,"context_line":"        r \u003d re.compile(\u0027[:.]\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6xo%3D","line":210,"updated":"2012-06-28 01:41:44.000000000","message":"Why is out being assigned to if it is not being used?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":214,"context_line":"        buf \u003d StringIO.StringIO()"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        for port in self.network.ports:"},{"line_number":217,"context_line":"            if port.admin_state_up is False:"},{"line_number":218,"context_line":"                continue"},{"line_number":219,"context_line":"            for alloc in port.fixed_ips:"},{"line_number":220,"context_line":"                name \u003d \u0027%s.%s\u0027 % (r.sub(\u0027-\u0027, alloc.address),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6xk%3D","line":217,"updated":"2012-06-28 01:41:44.000000000","message":"Consider using implicit boolean conversion.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        utils.execute([\u0027kill\u0027, \u0027-HUP\u0027, self.pid], self.root_helper)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def _output_opts_file(self):"},{"line_number":229,"context_line":"        \"\"\" output a dnsmasq compatible options file \"\"\""},{"line_number":230,"context_line":"        # TODO (mark): add support for nameservers"},{"line_number":231,"context_line":"        options \u003d []"},{"line_number":232,"context_line":"        for subnet in self.network.subnets:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6xg%3D","line":229,"updated":"2012-06-28 01:41:44.000000000","message":"HACKING - docstring formatting","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":235,"context_line":"            else:"},{"line_number":236,"context_line":"                options.append((\u0027route\u0027, subnet.gateway_ip))"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"        name \u003d self.conf_file_name(\u0027opts\u0027, True)"},{"line_number":239,"context_line":"        safe_file(name, \u0027\\n\u0027.join([\u0027%s,%s\u0027 % o for o in options]))"},{"line_number":240,"context_line":"        return name"},{"line_number":241,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6xY%3D","line":238,"updated":"2012-06-28 01:41:44.000000000","message":"Consider naming the optional parameter.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        return name"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"def safe_file(file_name, data):"},{"line_number":244,"context_line":"    \"\"\" safely write file data"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"    We first write to a temp file and then rename. Since POSIX renames are"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6y8%3D","line":243,"updated":"2012-06-28 01:41:44.000000000","message":"safe_file is insufficiently descriptive - consider renaming to something like atomic_write_to_file.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":241,"context_line":""},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"def safe_file(file_name, data):"},{"line_number":244,"context_line":"    \"\"\" safely write file data"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"    We first write to a temp file and then rename. Since POSIX renames are"},{"line_number":247,"context_line":"    atomic, file is unlikely to be corrupted by competing writes."}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6y4%3D","line":244,"updated":"2012-06-28 01:41:44.000000000","message":"HACKING - docstring formatting","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":243,"context_line":"def safe_file(file_name, data):"},{"line_number":244,"context_line":"    \"\"\" safely write file data"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"    We first write to a temp file and then rename. Since POSIX renames are"},{"line_number":247,"context_line":"    atomic, file is unlikely to be corrupted by competing writes."},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    We create the tempfile on the same device to ensure that it can be renamed."}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6y0%3D","line":246,"updated":"2012-06-28 01:41:44.000000000","message":"PEP257 - Prescribes the function or method\u0027s effect as a command (\"Do this\", \"Return that\"), not as a description; e.g. don\u0027t write \"Returns the pathname ...\".","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":39,"context_line":"               help\u003d\u0027Location to store DHCP server config files\u0027),"},{"line_number":40,"context_line":"    cfg.IntOpt(\u0027dhcp_lease_time\u0027,"},{"line_number":41,"context_line":"               default\u003d120,"},{"line_number":42,"context_line":"               help\u003d\u0027Lifetime of a DHCP lease in seconds\u0027),"},{"line_number":43,"context_line":"    cfg.StrOpt(\u0027dhcp_domain\u0027,"},{"line_number":44,"context_line":"               default\u003d\u0027openstacklocal\u0027,"},{"line_number":45,"context_line":"               help\u003d\u0027Domain to use for building the hostnames\u0027),"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2Fw8%3D","line":42,"updated":"2012-07-02 05:36:40.000000000","message":"There\u0027s a tricky interaction between the dhcp_lease_time and the IPAM allocation in logic within Quantum.  If a port is torn-down, and the IP is recycled by quantum and handed to another port right away, dnsmasq will not accept a new IP+mac pair.  \n\nNova has a pretty tight coupling between the DHCP logic and the IP allocation to prevent this from happening.  We should figure out what we want to do in Quantum.  Once option would just be giving the Quantum IP allocation logic a similar \"recycle_delay\" parameter.","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":155,"context_line":"    def active(self):"},{"line_number":156,"context_line":"        pid \u003d self.pid"},{"line_number":157,"context_line":"        cmd \u003d [\u0027cat\u0027, \u0027/proc/%s/cmdline\u0027 % pid]"},{"line_number":158,"context_line":"        out \u003d utils.execute(cmd, self.root_helper, check_exit_code\u003dFalse)"},{"line_number":159,"context_line":"        return self.network.id in out"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2FhY%3D","line":158,"updated":"2012-07-02 15:50:44.000000000","message":"Why is it desirable to ignore the exit code?","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":174,"context_line":"class Dnsmasq(DhcpLocalProcess):"},{"line_number":175,"context_line":"    PORTS \u003d {IPV4: [(UDP, DNS_PORT), (TCP, DNS_PORT), (UDP, DHCPV4_PORT)],"},{"line_number":176,"context_line":"             IPV6: [(UDP, DNS_PORT), (TCP, DNS_PORT), (UDP, DHCPV6_PORT)],"},{"line_number":177,"context_line":"             }"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    def spawn_process(self):"},{"line_number":180,"context_line":"        \"\"\" Spawns a Dnsmasq process for the network. \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2FwA%3D","line":177,"updated":"2012-07-02 05:36:40.000000000","message":"no longer used?  or is the idea that this would be used by another class when deciding what ports to open up in a security policy?  If so, perhaps add a comment?","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        for port in self.network.ports:"},{"line_number":226,"context_line":"            if not port.admin_state_up:"},{"line_number":227,"context_line":"                continue"},{"line_number":228,"context_line":"            for alloc in port.fixed_ips:"},{"line_number":229,"context_line":"                name \u003d \u0027%s.%s\u0027 % (r.sub(\u0027-\u0027, alloc.address),"},{"line_number":230,"context_line":"                                  self.conf.dhcp_domain)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2FwQ%3D","line":227,"updated":"2012-07-02 05:36:40.000000000","message":"why not include these allocations?  Its one less thing that would require us reload dnsmasq.","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"class Dnsmasq(DhcpLocalProcess):"},{"line_number":175,"context_line":"    # Tthe ports that need to be opened when security policies are active"},{"line_number":176,"context_line":"    # on the Quantum port used for DHCP.  These are provided as a convenience"},{"line_number":177,"context_line":"    # for users of this class."},{"line_number":178,"context_line":"    PORTS \u003d {IPV4: [(UDP, DNS_PORT), (TCP, DNS_PORT), (UDP, DHCPV4_PORT)],"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAJ3%2F%2F%2Bnk%3D","line":175,"updated":"2012-07-03 12:16:43.000000000","message":"Typo \"Tthe\"","commit_id":"daf271899ec2b3d7adfc055be01ee40810db5a9d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":180,"context_line":"             }"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    _TAG_PREFIX \u003d \u0027tag%d\u0027"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def spawn_process(self):"},{"line_number":185,"context_line":"        \"\"\"Spawns a Dnsmasq process for the network.\"\"\""},{"line_number":186,"context_line":"        cmd \u003d ["}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAJ3%2F%2F%2BnM%3D","line":183,"updated":"2012-07-03 12:16:43.000000000","message":"enable and disable methods are missing","commit_id":"daf271899ec2b3d7adfc055be01ee40810db5a9d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":180,"context_line":"             }"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    _TAG_PREFIX \u003d \u0027tag%d\u0027"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def spawn_process(self):"},{"line_number":185,"context_line":"        \"\"\"Spawns a Dnsmasq process for the network.\"\"\""},{"line_number":186,"context_line":"        cmd \u003d ["}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAJ3%2F%2F%2Bm4%3D","line":183,"in_reply_to":"AAAAJ3%2F%2F%2BnM%3D","updated":"2012-07-03 12:21:43.000000000","message":"When I run the code I get Unable to enable dhcp. Exception:","commit_id":"daf271899ec2b3d7adfc055be01ee40810db5a9d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @abc.abstractmethod"},{"line_number":71,"context_line":"    def enable(self):"},{"line_number":72,"context_line":"        \"\"\"Enables DHCP for this network.\"\"\""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    @abc.abstractmethod"},{"line_number":75,"context_line":"    def disable(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAM%3D","line":72,"updated":"2012-07-03 20:49:58.000000000","message":"PEP257","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @abc.abstractmethod"},{"line_number":71,"context_line":"    def enable(self):"},{"line_number":72,"context_line":"        \"\"\"Enables DHCP for this network.\"\"\""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    @abc.abstractmethod"},{"line_number":75,"context_line":"    def disable(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F97M%3D","line":72,"in_reply_to":"AAAAJ3%2F%2F%2BAM%3D","updated":"2012-07-03 21:40:17.000000000","message":"Completely unhelpful comment. Please be more specific about your objections.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":76,"context_line":"        \"\"\"Disable dhcp for this network.\"\"\""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def restart(self):"},{"line_number":79,"context_line":"        \"\"\"A convenince method to restart the dhcp service for the network.\"\"\""},{"line_number":80,"context_line":"        self.disable()"},{"line_number":81,"context_line":"        self.enable()"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAI%3D","line":79,"updated":"2012-07-03 20:49:58.000000000","message":"PEP257","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":76,"context_line":"        \"\"\"Disable dhcp for this network.\"\"\""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def restart(self):"},{"line_number":79,"context_line":"        \"\"\"A convenince method to restart the dhcp service for the network.\"\"\""},{"line_number":80,"context_line":"        self.disable()"},{"line_number":81,"context_line":"        self.enable()"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F97A%3D","line":79,"in_reply_to":"AAAAJ3%2F%2F%2BAI%3D","updated":"2012-07-03 21:40:17.000000000","message":"Completely unhelpful comment. Please be more specific about your objections.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":93,"context_line":"    PORTS \u003d []"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def enable(self):"},{"line_number":96,"context_line":"        \"\"\"Enables DHCP for this network by spawning a local process.\"\"\""},{"line_number":97,"context_line":"        if self.active:"},{"line_number":98,"context_line":"            self.reload_allocations()"},{"line_number":99,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAE%3D","line":96,"updated":"2012-07-03 20:49:58.000000000","message":"PEP257","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":93,"context_line":"    PORTS \u003d []"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def enable(self):"},{"line_number":96,"context_line":"        \"\"\"Enables DHCP for this network by spawning a local process.\"\"\""},{"line_number":97,"context_line":"        if self.active:"},{"line_number":98,"context_line":"            self.reload_allocations()"},{"line_number":99,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F968%3D","line":96,"in_reply_to":"AAAAJ3%2F%2F%2BAE%3D","updated":"2012-07-03 21:40:17.000000000","message":"Completely unhelpful comment. Please be more specific about your objections.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":105,"context_line":"        self.spawn_process()"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def disable(self):"},{"line_number":108,"context_line":"        \"\"\"Enables DHCP for this network by spawning a local process.\"\"\""},{"line_number":109,"context_line":"        pid \u003d self.pid"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        if self.active:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F%2BAA%3D","line":108,"updated":"2012-07-03 20:49:58.000000000","message":"PEP257","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":105,"context_line":"        self.spawn_process()"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def disable(self):"},{"line_number":108,"context_line":"        \"\"\"Enables DHCP for this network by spawning a local process.\"\"\""},{"line_number":109,"context_line":"        pid \u003d self.pid"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        if self.active:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F960%3D","line":108,"in_reply_to":"AAAAJ3%2F%2F%2BAA%3D","updated":"2012-07-03 21:40:17.000000000","message":"Completely unhelpful comment. Please be more specific about your objections.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":142,"context_line":"            msg \u003d _(\u0027Unable to access %s\u0027)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        LOG.debug(msg % file_name)"},{"line_number":145,"context_line":"        return None"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    @property"},{"line_number":148,"context_line":"    def pid(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2F8%3D","line":145,"updated":"2012-07-03 20:49:58.000000000","message":"Remove this line","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    @property"},{"line_number":162,"context_line":"    def interface_name(self):"},{"line_number":163,"context_line":"        \"\"\"A convenient way to get the interface name.\"\"\""},{"line_number":164,"context_line":"        if not getattr(self, \u0027_interface_name\u0027, None):"},{"line_number":165,"context_line":"            # try reading it from the file"},{"line_number":166,"context_line":"            self._interface_name \u003d self._get_value_from_conf_file(\u0027interface\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2F4%3D","line":163,"updated":"2012-07-03 20:49:58.000000000","message":"Unnecessary docstring","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    @property"},{"line_number":162,"context_line":"    def interface_name(self):"},{"line_number":163,"context_line":"        \"\"\"A convenient way to get the interface name.\"\"\""},{"line_number":164,"context_line":"        if not getattr(self, \u0027_interface_name\u0027, None):"},{"line_number":165,"context_line":"            # try reading it from the file"},{"line_number":166,"context_line":"            self._interface_name \u003d self._get_value_from_conf_file(\u0027interface\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F96w%3D","line":163,"in_reply_to":"AAAAJ3%2F%2F9%2F4%3D","updated":"2012-07-03 21:40:17.000000000","message":"This shouldn\u0027t be the cause for blocking a change.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    @property"},{"line_number":162,"context_line":"    def interface_name(self):"},{"line_number":163,"context_line":"        \"\"\"A convenient way to get the interface name.\"\"\""},{"line_number":164,"context_line":"        if not getattr(self, \u0027_interface_name\u0027, None):"},{"line_number":165,"context_line":"            # try reading it from the file"},{"line_number":166,"context_line":"            self._interface_name \u003d self._get_value_from_conf_file(\u0027interface\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9zo%3D","line":163,"in_reply_to":"AAAAJ3%2F%2F96w%3D","updated":"2012-07-03 23:31:49.000000000","message":"Noted.  However, assert_bridge_exists needs work before this change can land.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":162,"context_line":"    def interface_name(self):"},{"line_number":163,"context_line":"        \"\"\"A convenient way to get the interface name.\"\"\""},{"line_number":164,"context_line":"        if not getattr(self, \u0027_interface_name\u0027, None):"},{"line_number":165,"context_line":"            # try reading it from the file"},{"line_number":166,"context_line":"            self._interface_name \u003d self._get_value_from_conf_file(\u0027interface\u0027)"},{"line_number":167,"context_line":"        return self._interface_name"},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2F0%3D","line":165,"updated":"2012-07-03 20:49:58.000000000","message":"Unnecessary comment","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":162,"context_line":"    def interface_name(self):"},{"line_number":163,"context_line":"        \"\"\"A convenient way to get the interface name.\"\"\""},{"line_number":164,"context_line":"        if not getattr(self, \u0027_interface_name\u0027, None):"},{"line_number":165,"context_line":"            # try reading it from the file"},{"line_number":166,"context_line":"            self._interface_name \u003d self._get_value_from_conf_file(\u0027interface\u0027)"},{"line_number":167,"context_line":"        return self._interface_name"},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F96s%3D","line":165,"in_reply_to":"AAAAJ3%2F%2F9%2F0%3D","updated":"2012-07-03 21:40:17.000000000","message":"This shouldn\u0027t be the cause for blocking a change.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":182,"context_line":"    _TAG_PREFIX \u003d \u0027tag%d\u0027"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def spawn_process(self):"},{"line_number":185,"context_line":"        \"\"\"Spawns a Dnsmasq process for the network.\"\"\""},{"line_number":186,"context_line":"        cmd \u003d ["},{"line_number":187,"context_line":"            \u0027NETWORK_ID\u003d%s\u0027 % self.network.id,"},{"line_number":188,"context_line":"            # TODO (mark): this is dhcpbridge script we\u0027ll need to know"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2Fw%3D","line":185,"updated":"2012-07-03 20:49:58.000000000","message":"PEP257","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":182,"context_line":"    _TAG_PREFIX \u003d \u0027tag%d\u0027"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def spawn_process(self):"},{"line_number":185,"context_line":"        \"\"\"Spawns a Dnsmasq process for the network.\"\"\""},{"line_number":186,"context_line":"        cmd \u003d ["},{"line_number":187,"context_line":"            \u0027NETWORK_ID\u003d%s\u0027 % self.network.id,"},{"line_number":188,"context_line":"            # TODO (mark): this is dhcpbridge script we\u0027ll need to know"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F96o%3D","line":185,"in_reply_to":"AAAAJ3%2F%2F9%2Fw%3D","updated":"2012-07-03 21:40:17.000000000","message":"Completely unhelpful comment. Please be more specific about your objections.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":212,"context_line":"                mode \u003d \u0027static\u0027"},{"line_number":213,"context_line":"            cmd.append(\u0027--dhcp-range\u003dset:%s,%s,%s,%ss\u0027 %"},{"line_number":214,"context_line":"                       (self._TAG_PREFIX % i,"},{"line_number":215,"context_line":"                       netaddr.IPNetwork(subnet.cidr).network,"},{"line_number":216,"context_line":"                       mode,"},{"line_number":217,"context_line":"                       self.conf.dhcp_lease_time))"},{"line_number":218,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2Fs%3D","line":215,"updated":"2012-07-03 20:49:58.000000000","message":"PEP8 vertical alignment (following 2 lines as well)","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":212,"context_line":"                mode \u003d \u0027static\u0027"},{"line_number":213,"context_line":"            cmd.append(\u0027--dhcp-range\u003dset:%s,%s,%s,%ss\u0027 %"},{"line_number":214,"context_line":"                       (self._TAG_PREFIX % i,"},{"line_number":215,"context_line":"                       netaddr.IPNetwork(subnet.cidr).network,"},{"line_number":216,"context_line":"                       mode,"},{"line_number":217,"context_line":"                       self.conf.dhcp_lease_time))"},{"line_number":218,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F96k%3D","line":215,"in_reply_to":"AAAAJ3%2F%2F9%2Fs%3D","updated":"2012-07-03 21:40:17.000000000","message":"Yeah, Mark -- netattr, etc., should be aligned with \"self\" not with the left parens.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":224,"context_line":"        utils.execute(cmd, self.root_helper)"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def reload_allocations(self):"},{"line_number":227,"context_line":"        \"\"\"Rebuilds the dnsmasq config and signal the dnsmasq to reload.\"\"\""},{"line_number":228,"context_line":"        self._output_hosts_file()"},{"line_number":229,"context_line":"        utils.execute([\u0027kill\u0027, \u0027-HUP\u0027, self.pid], self.root_helper)"},{"line_number":230,"context_line":"        LOG.debug(_(\u0027Reloading allocations for network: %s\u0027) % self.network.id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2Fo%3D","line":227,"updated":"2012-07-03 20:49:58.000000000","message":"PEP257","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":224,"context_line":"        utils.execute(cmd, self.root_helper)"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def reload_allocations(self):"},{"line_number":227,"context_line":"        \"\"\"Rebuilds the dnsmasq config and signal the dnsmasq to reload.\"\"\""},{"line_number":228,"context_line":"        self._output_hosts_file()"},{"line_number":229,"context_line":"        utils.execute([\u0027kill\u0027, \u0027-HUP\u0027, self.pid], self.root_helper)"},{"line_number":230,"context_line":"        LOG.debug(_(\u0027Reloading allocations for network: %s\u0027) % self.network.id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F96g%3D","line":227,"in_reply_to":"AAAAJ3%2F%2F9%2Fo%3D","updated":"2012-07-03 21:40:17.000000000","message":"Completely unhelpful comment. Please be more specific about your objections.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":230,"context_line":"        LOG.debug(_(\u0027Reloading allocations for network: %s\u0027) % self.network.id)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def _output_hosts_file(self):"},{"line_number":233,"context_line":"        \"\"\" Writes a dnsmasq compatible hosts file.\"\"\""},{"line_number":234,"context_line":"        r \u003d re.compile(\u0027[:.]\u0027)"},{"line_number":235,"context_line":"        buf \u003d StringIO.StringIO()"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2Fk%3D","line":233,"updated":"2012-07-03 20:49:58.000000000","message":"PEP257+remove leading space","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":230,"context_line":"        LOG.debug(_(\u0027Reloading allocations for network: %s\u0027) % self.network.id)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def _output_hosts_file(self):"},{"line_number":233,"context_line":"        \"\"\" Writes a dnsmasq compatible hosts file.\"\"\""},{"line_number":234,"context_line":"        r \u003d re.compile(\u0027[:.]\u0027)"},{"line_number":235,"context_line":"        buf \u003d StringIO.StringIO()"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F96Y%3D","line":233,"in_reply_to":"AAAAJ3%2F%2F9%2Fk%3D","updated":"2012-07-03 21:40:17.000000000","message":"Please be more specific about your objections wrt PEP 257.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":254,"context_line":"                continue"},{"line_number":255,"context_line":"            else:"},{"line_number":256,"context_line":"                options.append((self._TAG_PREFIX % i,"},{"line_number":257,"context_line":"                               \u0027router\u0027,"},{"line_number":258,"context_line":"                               subnet.gateway_ip))"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"        name \u003d self.get_conf_file_name(\u0027opts\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2Fg%3D","line":257,"updated":"2012-07-03 20:49:58.000000000","message":"PEP8 vertical alignment","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"unresolved":false,"context_lines":[{"line_number":256,"context_line":"                options.append((self._TAG_PREFIX % i,"},{"line_number":257,"context_line":"                               \u0027router\u0027,"},{"line_number":258,"context_line":"                               subnet.gateway_ip))"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"        name \u003d self.get_conf_file_name(\u0027opts\u0027)"},{"line_number":261,"context_line":"        replace_file(name, \u0027\\n\u0027.join([\u0027tag:%s,%s,%s\u0027 % o for o in options]))"},{"line_number":262,"context_line":"        return name"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F93E%3D","line":259,"updated":"2012-07-03 22:17:16.000000000","message":"host_routes of port should be also specified using tag 121 http://www.networksorcery.com/enp/rfc/rfc3442.txt","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":263,"context_line":""},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"def replace_file(file_name, data):"},{"line_number":266,"context_line":"    \"\"\"Replaces the contents of file_name with data in a safe manner."},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    We first write to a temp file and then rename. Since POSIX renames are"},{"line_number":269,"context_line":"    atomic, file is unlikely to be corrupted by competing writes."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2Fc%3D","line":266,"updated":"2012-07-03 20:49:58.000000000","message":"PEP257","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":263,"context_line":""},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"def replace_file(file_name, data):"},{"line_number":266,"context_line":"    \"\"\"Replaces the contents of file_name with data in a safe manner."},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    We first write to a temp file and then rename. Since POSIX renames are"},{"line_number":269,"context_line":"    atomic, file is unlikely to be corrupted by competing writes."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F96U%3D","line":266,"in_reply_to":"AAAAJ3%2F%2F9%2Fc%3D","updated":"2012-07-03 21:40:17.000000000","message":"Completely unhelpful comment. Please be more specific about your objections.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":265,"context_line":"def replace_file(file_name, data):"},{"line_number":266,"context_line":"    \"\"\"Replaces the contents of file_name with data in a safe manner."},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    We first write to a temp file and then rename. Since POSIX renames are"},{"line_number":269,"context_line":"    atomic, file is unlikely to be corrupted by competing writes."},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    We create the tempfile on the same device to ensure that it can be renamed."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2FY%3D","line":268,"updated":"2012-07-03 20:49:58.000000000","message":"We first write \u003d\u003e Write","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":265,"context_line":"def replace_file(file_name, data):"},{"line_number":266,"context_line":"    \"\"\"Replaces the contents of file_name with data in a safe manner."},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    We first write to a temp file and then rename. Since POSIX renames are"},{"line_number":269,"context_line":"    atomic, file is unlikely to be corrupted by competing writes."},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    We create the tempfile on the same device to ensure that it can be renamed."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F96Q%3D","line":268,"in_reply_to":"AAAAJ3%2F%2F9%2FY%3D","updated":"2012-07-03 21:40:17.000000000","message":"This seems perfectly fine to me. It\u0027s not a doctoral thesis. It\u0027s a docstring.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":266,"context_line":"    \"\"\"Replaces the contents of file_name with data in a safe manner."},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    We first write to a temp file and then rename. Since POSIX renames are"},{"line_number":269,"context_line":"    atomic, file is unlikely to be corrupted by competing writes."},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    We create the tempfile on the same device to ensure that it can be renamed."},{"line_number":272,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2FU%3D","line":269,"updated":"2012-07-03 20:49:58.000000000","message":"file \u003d\u003e the file","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":268,"context_line":"    We first write to a temp file and then rename. Since POSIX renames are"},{"line_number":269,"context_line":"    atomic, file is unlikely to be corrupted by competing writes."},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    We create the tempfile on the same device to ensure that it can be renamed."},{"line_number":272,"context_line":"    \"\"\""},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"    base_dir \u003d os.path.dirname(os.path.abspath(file_name))"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2FQ%3D","line":271,"updated":"2012-07-03 20:49:58.000000000","message":"We create \u003d\u003e Create","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":268,"context_line":"    We first write to a temp file and then rename. Since POSIX renames are"},{"line_number":269,"context_line":"    atomic, file is unlikely to be corrupted by competing writes."},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    We create the tempfile on the same device to ensure that it can be renamed."},{"line_number":272,"context_line":"    \"\"\""},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"    base_dir \u003d os.path.dirname(os.path.abspath(file_name))"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F96M%3D","line":271,"in_reply_to":"AAAAJ3%2F%2F9%2FQ%3D","updated":"2012-07-03 21:40:17.000000000","message":"This seems perfectly fine to me.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import abc"},{"line_number":19,"context_line":"import errno"},{"line_number":20,"context_line":"import itertools"},{"line_number":21,"context_line":"import logging"},{"line_number":22,"context_line":"import os"},{"line_number":23,"context_line":"import re"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9q4%3D","line":20,"updated":"2012-07-04 02:43:43.000000000","message":"Remove all unused imports. It applies to all files in this change.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import abc"},{"line_number":19,"context_line":"import errno"},{"line_number":20,"context_line":"import itertools"},{"line_number":21,"context_line":"import logging"},{"line_number":22,"context_line":"import os"},{"line_number":23,"context_line":"import re"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2FV4%3D","line":20,"in_reply_to":"AAAAJ3%2F%2F9q4%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":46,"context_line":"    cfg.StrOpt(\u0027dnsmasq_config_file\u0027,"},{"line_number":47,"context_line":"               help\u003d\u0027Override the default dnsmasq settings with this file\u0027),"},{"line_number":48,"context_line":"    cfg.StrOpt(\u0027dnsmasq_dns_server\u0027,"},{"line_number":49,"context_line":"               help\u003d\u0027Use DNS another server before any in /etc/resolv.conf.\u0027),"},{"line_number":50,"context_line":"]"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"IPV4 \u003d 4"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2B4g%3D","line":49,"updated":"2012-07-05 23:12:49.000000000","message":"\"DNS another\" \u003c\u003d\u003e \"another DNS\"","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":46,"context_line":"    cfg.StrOpt(\u0027dnsmasq_config_file\u0027,"},{"line_number":47,"context_line":"               help\u003d\u0027Override the default dnsmasq settings with this file\u0027),"},{"line_number":48,"context_line":"    cfg.StrOpt(\u0027dnsmasq_dns_server\u0027,"},{"line_number":49,"context_line":"               help\u003d\u0027Use DNS another server before any in /etc/resolv.conf.\u0027),"},{"line_number":50,"context_line":"]"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"IPV4 \u003d 4"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2BnU%3D","line":49,"in_reply_to":"AAAAKH%2F%2F%2B4g%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":76,"context_line":"        \"\"\"Disable dhcp for this network.\"\"\""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def restart(self):"},{"line_number":79,"context_line":"        \"\"\"A convenince method to restart the dhcp service for the network.\"\"\""},{"line_number":80,"context_line":"        self.disable()"},{"line_number":81,"context_line":"        self.enable()"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9l0%3D","line":79,"updated":"2012-07-04 07:11:14.000000000","message":"Typo - convenince","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        \"\"\"Disable dhcp for this network.\"\"\""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def restart(self):"},{"line_number":79,"context_line":"        \"\"\"A convenince method to restart the dhcp service for the network.\"\"\""},{"line_number":80,"context_line":"        self.disable()"},{"line_number":81,"context_line":"        self.enable()"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9q8%3D","line":79,"updated":"2012-07-04 02:43:43.000000000","message":"Use \u0027Restart the dhcp service for the network.\u0027 see http://www.python.org/dev/peps/pep-0257/. It applies to all the docstring in this change.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":76,"context_line":"        \"\"\"Disable dhcp for this network.\"\"\""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def restart(self):"},{"line_number":79,"context_line":"        \"\"\"A convenince method to restart the dhcp service for the network.\"\"\""},{"line_number":80,"context_line":"        self.disable()"},{"line_number":81,"context_line":"        self.enable()"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2FVk%3D","line":79,"in_reply_to":"AAAAJ3%2F%2F9q8%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":105,"context_line":"        self.spawn_process()"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def disable(self):"},{"line_number":108,"context_line":"        \"\"\"Enables DHCP for this network by spawning a local process.\"\"\""},{"line_number":109,"context_line":"        pid \u003d self.pid"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        if self.active:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2B4o%3D","line":108,"updated":"2012-07-05 23:12:49.000000000","message":"Looks like this is not the docstring for this method","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":105,"context_line":"        self.spawn_process()"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def disable(self):"},{"line_number":108,"context_line":"        \"\"\"Enables DHCP for this network by spawning a local process.\"\"\""},{"line_number":109,"context_line":"        pid \u003d self.pid"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        if self.active:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2BnQ%3D","line":108,"in_reply_to":"AAAAKH%2F%2F%2B4o%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":141,"context_line":"        except IOError, e:"},{"line_number":142,"context_line":"            msg \u003d _(\u0027Unable to access %s\u0027)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        LOG.debug(msg % file_name)"},{"line_number":145,"context_line":"        return None"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2B4M%3D","line":144,"updated":"2012-07-05 23:12:49.000000000","message":"As we are suppressing exceptions we should probably use LOG.exception - otherwise the error condition would not be visible in the logs","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":141,"context_line":"        except IOError, e:"},{"line_number":142,"context_line":"            msg \u003d _(\u0027Unable to access %s\u0027)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        LOG.debug(msg % file_name)"},{"line_number":145,"context_line":"        return None"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2BnM%3D","line":144,"in_reply_to":"AAAAKH%2F%2F%2B4M%3D","updated":"2012-07-06 18:26:19.000000000","message":"I didn\u0027t know how noisy we wanted to make the logs.  These failures will happen regularly.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":226,"context_line":"        \"\"\"Rebuilds the dnsmasq config and signal the dnsmasq to reload.\"\"\""},{"line_number":227,"context_line":"        self._output_hosts_file()"},{"line_number":228,"context_line":"        utils.execute([\u0027kill\u0027, \u0027-HUP\u0027, self.pid], self.root_helper)"},{"line_number":229,"context_line":"        LOG.debug(_(\u0027Reloading allocations for network: %s\u0027) % self.network.id)"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    def _output_hosts_file(self):"},{"line_number":232,"context_line":"        \"\"\"Writes a dnsmasq compatible hosts file.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2B4A%3D","line":229,"updated":"2012-07-05 23:12:49.000000000","message":"Does kill -HUP reload dnsmasq eith the same PID? Otherwise we might want to re-fetch and update its value.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":226,"context_line":"        \"\"\"Rebuilds the dnsmasq config and signal the dnsmasq to reload.\"\"\""},{"line_number":227,"context_line":"        self._output_hosts_file()"},{"line_number":228,"context_line":"        utils.execute([\u0027kill\u0027, \u0027-HUP\u0027, self.pid], self.root_helper)"},{"line_number":229,"context_line":"        LOG.debug(_(\u0027Reloading allocations for network: %s\u0027) % self.network.id)"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    def _output_hosts_file(self):"},{"line_number":232,"context_line":"        \"\"\"Writes a dnsmasq compatible hosts file.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2BnE%3D","line":229,"in_reply_to":"AAAAKH%2F%2F%2B4A%3D","updated":"2012-07-06 18:26:19.000000000","message":"The signal only causes a reload of the config file.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"unresolved":false,"context_lines":[{"line_number":271,"context_line":"    \"\"\""},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"    base_dir \u003d os.path.dirname(os.path.abspath(file_name))"},{"line_number":274,"context_line":"    tmp_file \u003d tempfile.NamedTemporaryFile(\u0027w+\u0027, dir\u003dbase_dir, delete\u003dFalse)"},{"line_number":275,"context_line":"    tmp_file.write(data)"},{"line_number":276,"context_line":"    tmp_file.close()"},{"line_number":277,"context_line":"    os.rename(tmp_file.name, file_name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2Fos%3D","line":274,"updated":"2012-07-05 11:26:56.000000000","message":"NamedTemporaryFile creates a file with a permission 600.\nHowever dnsmasq is usually run as \u0027nobody\u0027 after startup.\nThis results in the situation  that unless dhcp-agent is started by \u0027nobody\u0027 or --user option is specified dnsmasq cannot read configurations files such as interface, host and so on.\nThere are some options to fix it: (1) chmod to world readable in replace_file(), (2) provide --user option when starting dnsmasq, (3) run quantum-dhcp-agent with \u0027nobody\u0027 user.\nHow do you think?","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":271,"context_line":"    \"\"\""},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"    base_dir \u003d os.path.dirname(os.path.abspath(file_name))"},{"line_number":274,"context_line":"    tmp_file \u003d tempfile.NamedTemporaryFile(\u0027w+\u0027, dir\u003dbase_dir, delete\u003dFalse)"},{"line_number":275,"context_line":"    tmp_file.write(data)"},{"line_number":276,"context_line":"    tmp_file.close()"},{"line_number":277,"context_line":"    os.rename(tmp_file.name, file_name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2FVQ%3D","line":274,"in_reply_to":"AAAAKH%2F%2F%2Fos%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":274,"context_line":"    tmp_file \u003d tempfile.NamedTemporaryFile(\u0027w+\u0027, dir\u003dbase_dir, delete\u003dFalse)"},{"line_number":275,"context_line":"    tmp_file.write(data)"},{"line_number":276,"context_line":"    tmp_file.close()"},{"line_number":277,"context_line":"    os.rename(tmp_file.name, file_name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2FgI%3D","line":277,"updated":"2012-07-05 14:55:29.000000000","message":"Following the comment above when I added the line below it all worked :)\n os.chmod(file_name, 0644)","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":274,"context_line":"    tmp_file \u003d tempfile.NamedTemporaryFile(\u0027w+\u0027, dir\u003dbase_dir, delete\u003dFalse)"},{"line_number":275,"context_line":"    tmp_file.write(data)"},{"line_number":276,"context_line":"    tmp_file.close()"},{"line_number":277,"context_line":"    os.rename(tmp_file.name, file_name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2FVU%3D","line":277,"in_reply_to":"AAAAKH%2F%2F%2FgI%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":174,"context_line":"        cmd \u003d ["},{"line_number":175,"context_line":"            \u0027NETWORK_ID\u003d%s\u0027 % self.network.id,"},{"line_number":176,"context_line":"            # TODO (mark): this is dhcpbridge script we\u0027ll need to know"},{"line_number":177,"context_line":"            # when an IP address has been released"},{"line_number":178,"context_line":"            \u0027dnsmasq\u0027,"},{"line_number":179,"context_line":"            \u0027--no-hosts\u0027,"},{"line_number":180,"context_line":"            \u0027--no-resolv\u0027,"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAKX%2F%2F%2Fxk%3D","line":177,"updated":"2012-07-09 01:42:42.000000000","message":"To my knowledge, there\u0027s still no logic yet to make sure that when a port is destroyed and the IP is again available for allocation that it is not allocated until the DHCP lease has expired.  Is that true?  If so, we should file a bug to track this.","commit_id":"43960ee4486925bff2b4da3af5db963b389f7dc2"}],"quantum/agent/linux/interface.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":31,"context_line":"               default\u003d\u0027br-int\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Name of Open vSwitch bridge to use\u0027),"},{"line_number":33,"context_line":"    cfg.StrOpt(\u0027network_device_mtu\u0027,"},{"line_number":34,"context_line":"               default\u003dNone,"},{"line_number":35,"context_line":"               help\u003d\u0027MTU setting for vlan\u0027),"},{"line_number":36,"context_line":"]"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6xQ%3D","line":34,"updated":"2012-06-28 01:41:44.000000000","message":"Since the default value is already None, this line is unnecessary.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":32,"context_line":"               help\u003d\u0027Name of Open vSwitch bridge to use\u0027),"},{"line_number":33,"context_line":"    cfg.StrOpt(\u0027network_device_mtu\u0027,"},{"line_number":34,"context_line":"               default\u003dNone,"},{"line_number":35,"context_line":"               help\u003d\u0027MTU setting for vlan\u0027),"},{"line_number":36,"context_line":"]"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F%2Bg%3D","line":35,"updated":"2012-06-28 22:04:35.000000000","message":"term \u0027vlan\u0027 here is not meaningful (probably copy and paste from nova, back when only linux-bridge + vlans were used).  I would just say \"device\".","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"            utils.execute(cmd, self.root_helper)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _device_exists(self, dev):"},{"line_number":60,"context_line":"        cmd \u003d [\u0027ip\u0027, \u0027link\u0027, \u0027show\u0027, \u0027dev\u0027, dev]"},{"line_number":61,"context_line":"        (_, err) \u003d utils.execute(cmd, self.root_helper, check_exit_code\u003dFalse,"},{"line_number":62,"context_line":"                                 return_stderr\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F9g%3D","line":59,"updated":"2012-06-28 22:04:35.000000000","message":"this device exists logic already exists in elsewhere in quantum.  I\u0027d suggest pulling it up into agent/utils.py and leveraging it there.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _device_exists(self, dev):"},{"line_number":60,"context_line":"        cmd \u003d [\u0027ip\u0027, \u0027link\u0027, \u0027show\u0027, \u0027dev\u0027, dev]"},{"line_number":61,"context_line":"        (_, err) \u003d utils.execute(cmd, self.root_helper, check_exit_code\u003dFalse,"},{"line_number":62,"context_line":"                                 return_stderr\u003dTrue)"},{"line_number":63,"context_line":"        return not err"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6xM%3D","line":61,"updated":"2012-06-28 01:41:44.000000000","message":"Why is it desirable to ignore the exit code?  What if the ip command is missing or not executable for some reason?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _device_exists(self, dev):"},{"line_number":60,"context_line":"        cmd \u003d [\u0027ip\u0027, \u0027link\u0027, \u0027show\u0027, \u0027dev\u0027, dev]"},{"line_number":61,"context_line":"        (_, err) \u003d utils.execute(cmd, self.root_helper, check_exit_code\u003dFalse,"},{"line_number":62,"context_line":"                                 return_stderr\u003dTrue)"},{"line_number":63,"context_line":"        return not err"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJn%2F%2F%2F6w%3D","line":61,"in_reply_to":"AAAAI3%2F%2F6xM%3D","updated":"2012-06-29 14:01:48.000000000","message":"I think the approach is to consider an empty stderr stream as success.\nI agree discriminating on the status code would be easier to read.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    @abc.abstractmethod"},{"line_number":66,"context_line":"    def plug(self, network_id, dev, mac_address):"},{"line_number":67,"context_line":"        \"\"\" brint the interface up \"\"\""},{"line_number":68,"context_line":"        pass"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6xI%3D","line":67,"updated":"2012-06-28 01:41:44.000000000","message":"brint \u003d\u003e bring\n\nHACKING - docstring formatting.  Please ensure that all docstrings in this module are compliant.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    @abc.abstractmethod"},{"line_number":66,"context_line":"    def plug(self, network_id, dev, mac_address):"},{"line_number":67,"context_line":"        \"\"\" brint the interface up \"\"\""},{"line_number":68,"context_line":"        pass"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @abc.abstractmethod"},{"line_number":71,"context_line":"    def unplug(self, dev\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6xE%3D","line":68,"updated":"2012-06-28 01:41:44.000000000","message":"This line is unnecessary if the method has a docstring","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    @abc.abstractmethod"},{"line_number":71,"context_line":"    def unplug(self, dev\u003dNone):"},{"line_number":72,"context_line":"        \"\"\" unplug the interface \"\"\""},{"line_number":73,"context_line":"        pass"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"class NullDriver(LinuxInterfaceDriver):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6xA%3D","line":73,"updated":"2012-06-28 01:41:44.000000000","message":"This line is unnecessary if the method has a docstring","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":80,"context_line":"    def unplug(self, dev\u003dNone):"},{"line_number":81,"context_line":"        pass"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"class OVSInterfaceDriver(LinuxInterfaceDriver):"},{"line_number":85,"context_line":"    \"\"\" plugs interface into OVS \"\"\""},{"line_number":86,"context_line":"    def plug(self, network_id, dev, mac_address):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6kg%3D","line":83,"updated":"2012-06-28 12:32:01.000000000","message":"If I understand correctly this is code that is also common to nova compute. Would it not be best to add this to openstack common?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":88,"context_line":"        bridge \u003d self.conf.ovs_integration_bridge"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        if not self._device_exists(bridge):"},{"line_number":91,"context_line":"            LOG.debug(_(\"Bridge %s does not exist on this host\") % bridge)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if not self._device_exists(dev):"},{"line_number":94,"context_line":"            utils.execute([\u0027ovs-vsctl\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F9I%3D","line":91,"updated":"2012-06-28 22:04:35.000000000","message":"If you want to keep this check, I was make it log error and raise, as the following command will clearly not work if the bridge does not exist. \n\nAlso, should we check for bridge in unplug as well?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":88,"context_line":"        bridge \u003d self.conf.ovs_integration_bridge"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        if not self._device_exists(bridge):"},{"line_number":91,"context_line":"            LOG.debug(_(\"Bridge %s does not exist on this host\") % bridge)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if not self._device_exists(dev):"},{"line_number":94,"context_line":"            utils.execute([\u0027ovs-vsctl\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJn%2F%2F%2F6s%3D","line":91,"in_reply_to":"AAAAJX%2F%2F%2F9I%3D","updated":"2012-06-29 14:01:48.000000000","message":"+1","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":148,"context_line":"    def unplug(self, dev):"},{"line_number":149,"context_line":"        \"\"\" unplug interface \"\"\""},{"line_number":150,"context_line":"        if not self._device_exists(dev):"},{"line_number":151,"context_line":"            return None"},{"line_number":152,"context_line":"        else:"},{"line_number":153,"context_line":"            try:"},{"line_number":154,"context_line":"                utils.execute([\u0027ip\u0027, \u0027link\u0027, \u0027delete\u0027, dev],"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6w0%3D","line":151,"updated":"2012-06-28 01:41:44.000000000","message":"return None \u003d\u003e return","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        \"\"\" unplug interface \"\"\""},{"line_number":150,"context_line":"        if not self._device_exists(dev):"},{"line_number":151,"context_line":"            return None"},{"line_number":152,"context_line":"        else:"},{"line_number":153,"context_line":"            try:"},{"line_number":154,"context_line":"                utils.execute([\u0027ip\u0027, \u0027link\u0027, \u0027delete\u0027, dev],"},{"line_number":155,"context_line":"                              self.root_helper)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6ww%3D","line":152,"updated":"2012-06-28 01:41:44.000000000","message":"The if statement exits the method if True, so this else statement is unnecessary.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":149,"context_line":"        \"\"\" unplug interface \"\"\""},{"line_number":150,"context_line":"        if not self._device_exists(dev):"},{"line_number":151,"context_line":"            return None"},{"line_number":152,"context_line":"        else:"},{"line_number":153,"context_line":"            try:"},{"line_number":154,"context_line":"                utils.execute([\u0027ip\u0027, \u0027link\u0027, \u0027delete\u0027, dev],"},{"line_number":155,"context_line":"                              self.root_helper)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F9A%3D","line":152,"in_reply_to":"AAAAI3%2F%2F6ww%3D","updated":"2012-06-28 22:04:35.000000000","message":"I think it would be cleaner to change the if test confirming that the device exists, with the function implicitly returning None otherwise.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        \"\"\" unplug interface \"\"\""},{"line_number":150,"context_line":"        if not self._device_exists(dev):"},{"line_number":151,"context_line":"            return None"},{"line_number":152,"context_line":"        else:"},{"line_number":153,"context_line":"            try:"},{"line_number":154,"context_line":"                utils.execute([\u0027ip\u0027, \u0027link\u0027, \u0027delete\u0027, dev],"},{"line_number":155,"context_line":"                              self.root_helper)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2Fw0%3D","line":152,"in_reply_to":"AAAAJX%2F%2F%2F9A%3D","updated":"2012-06-28 23:03:53.000000000","message":"+1","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":149,"context_line":"        \"\"\" unplug interface \"\"\""},{"line_number":150,"context_line":"        if not self._device_exists(dev):"},{"line_number":151,"context_line":"            return None"},{"line_number":152,"context_line":"        else:"},{"line_number":153,"context_line":"            try:"},{"line_number":154,"context_line":"                utils.execute([\u0027ip\u0027, \u0027link\u0027, \u0027delete\u0027, dev],"},{"line_number":155,"context_line":"                              self.root_helper)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJn%2F%2F%2F6o%3D","line":152,"in_reply_to":"AAAAJX%2F%2F%2F9A%3D","updated":"2012-06-29 14:01:48.000000000","message":"+1","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2350,"name":"Willian Molinari","email":"pothix@pothix.com","username":"pothix"},"change_message_id":"2f0309bd57c2e91cc66d5db56996b2472984aeb9","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"import netaddr"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from quantum.agent.linux import iptables_manager"},{"line_number":24,"context_line":"from quantum.agent.linux import utils"},{"line_number":25,"context_line":"from quantum.openstack.common import cfg"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2FAg%3D","line":23,"updated":"2012-07-02 22:57:08.000000000","message":"Why are we using iptables manager for DHCP? I can\u0027t see any reference to it here.","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"            utils.execute(cmd, self.conf.root_helper)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def assert_bridge_exists(self, bridge):"},{"line_number":60,"context_line":"        \"\"\"Asserts whether a bridge exists.\"\"\""},{"line_number":61,"context_line":"        if not utils.device_exists(bridge, self.conf.root_helper):"},{"line_number":62,"context_line":"            msg \u003d _(\u0027%(class_name)s: Bridge %(bridge)s does not exists on \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2FI%3D","line":59,"updated":"2012-07-03 20:49:58.000000000","message":"Assert is a test-centric name. Consider using \u0027check\u0027 instead, which is the usual naming convention for methods that raise an exception if a condition cannot be satisfied.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"            utils.execute(cmd, self.conf.root_helper)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def assert_bridge_exists(self, bridge):"},{"line_number":60,"context_line":"        \"\"\"Asserts whether a bridge exists.\"\"\""},{"line_number":61,"context_line":"        if not utils.device_exists(bridge, self.conf.root_helper):"},{"line_number":62,"context_line":"            msg \u003d _(\u0027%(class_name)s: Bridge %(bridge)s does not exists on \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F99M%3D","line":59,"in_reply_to":"AAAAJ3%2F%2F9%2FI%3D","updated":"2012-07-03 21:07:18.000000000","message":"I think the nova code that did something similar was ensure_bridge_exists, which is a bit better than \"check\" since it conveys the fact that a bridge will exist after the function is called.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"            utils.execute(cmd, self.conf.root_helper)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def assert_bridge_exists(self, bridge):"},{"line_number":60,"context_line":"        \"\"\"Asserts whether a bridge exists.\"\"\""},{"line_number":61,"context_line":"        if not utils.device_exists(bridge, self.conf.root_helper):"},{"line_number":62,"context_line":"            msg \u003d _(\u0027%(class_name)s: Bridge %(bridge)s does not exists on \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F954%3D","line":59,"in_reply_to":"AAAAJ3%2F%2F9%2FI%3D","updated":"2012-07-03 21:40:17.000000000","message":"Using a verb in a method name is perfectly fine. He\u0027s not overriding a reserved work, and, to the best of my knowledge, no PEP has been published that restricts the use of non-keyword verbs in method names. Hell, you can even use reserved words in method names with an underscore, etc. To me, this objection borders on the ludicrous.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"            utils.execute(cmd, self.conf.root_helper)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def assert_bridge_exists(self, bridge):"},{"line_number":60,"context_line":"        \"\"\"Asserts whether a bridge exists.\"\"\""},{"line_number":61,"context_line":"        if not utils.device_exists(bridge, self.conf.root_helper):"},{"line_number":62,"context_line":"            msg \u003d _(\u0027%(class_name)s: Bridge %(bridge)s does not exists on \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F90U%3D","line":59,"in_reply_to":"AAAAJ3%2F%2F954%3D","updated":"2012-07-03 23:31:49.000000000","message":"Duncan: Comments containing the word \u0027consider\u0027 are meant as suggestions.  I apologize if this was not clear.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":57,"context_line":"            utils.execute(cmd, self.conf.root_helper)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def assert_bridge_exists(self, bridge):"},{"line_number":60,"context_line":"        \"\"\"Asserts whether a bridge exists.\"\"\""},{"line_number":61,"context_line":"        if not utils.device_exists(bridge, self.conf.root_helper):"},{"line_number":62,"context_line":"            msg \u003d _(\u0027%(class_name)s: Bridge %(bridge)s does not exists on \u0027"},{"line_number":63,"context_line":"                    \u0027this host.\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2FE%3D","line":60,"updated":"2012-07-03 20:49:58.000000000","message":"PEP257","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":57,"context_line":"            utils.execute(cmd, self.conf.root_helper)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def assert_bridge_exists(self, bridge):"},{"line_number":60,"context_line":"        \"\"\"Asserts whether a bridge exists.\"\"\""},{"line_number":61,"context_line":"        if not utils.device_exists(bridge, self.conf.root_helper):"},{"line_number":62,"context_line":"            msg \u003d _(\u0027%(class_name)s: Bridge %(bridge)s does not exists on \u0027"},{"line_number":63,"context_line":"                    \u0027this host.\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F950%3D","line":60,"in_reply_to":"AAAAJ3%2F%2F9%2FE%3D","updated":"2012-07-03 21:40:17.000000000","message":"Please be specific about the nature of your objection.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":62,"context_line":"            msg \u003d _(\u0027%(class_name)s: Bridge %(bridge)s does not exists on \u0027"},{"line_number":63,"context_line":"                    \u0027this host.\u0027)"},{"line_number":64,"context_line":"            args \u003d dict(class_name\u003dself.__name__, bridge\u003dbridge)"},{"line_number":65,"context_line":"            raise AssertionError(msg % args)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    @abc.abstractmethod"},{"line_number":68,"context_line":"    def plug(self, network_id, device, mac_address):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2FA%3D","line":65,"updated":"2012-07-03 20:49:58.000000000","message":"Prefer specific error types to a generic type such as AssertionError. The use of assert in testing will raise AssertionError on failure and can be confusing if the code under test also relies upon that error type.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1801,"name":"Duncan McGreggor","email":"duncan.mcgreggor@rackspace.com","username":"oubiwann"},"unresolved":false,"context_lines":[{"line_number":62,"context_line":"            msg \u003d _(\u0027%(class_name)s: Bridge %(bridge)s does not exists on \u0027"},{"line_number":63,"context_line":"                    \u0027this host.\u0027)"},{"line_number":64,"context_line":"            args \u003d dict(class_name\u003dself.__name__, bridge\u003dbridge)"},{"line_number":65,"context_line":"            raise AssertionError(msg % args)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    @abc.abstractmethod"},{"line_number":68,"context_line":"    def plug(self, network_id, device, mac_address):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F95s%3D","line":65,"in_reply_to":"AAAAJ3%2F%2F9%2FA%3D","updated":"2012-07-03 21:40:17.000000000","message":"I asked Mark about this, and the behavior he is looking for is not an exception, but rather for the code to continue executing. I\u0027ve suggested that he create a custom Error in the exceptions module (even though it\u0027s not technically an exception...) and give a docstring describing what types of methods should utilize this Error and for what purposes.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":62,"context_line":"            msg \u003d _(\u0027%(class_name)s: Bridge %(bridge)s does not exists on \u0027"},{"line_number":63,"context_line":"                    \u0027this host.\u0027)"},{"line_number":64,"context_line":"            args \u003d dict(class_name\u003dself.__name__, bridge\u003dbridge)"},{"line_number":65,"context_line":"            raise AssertionError(msg % args)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    @abc.abstractmethod"},{"line_number":68,"context_line":"    def plug(self, network_id, device, mac_address):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F90M%3D","line":65,"in_reply_to":"AAAAJ3%2F%2F95s%3D","updated":"2012-07-03 23:31:49.000000000","message":"If the desired behaviour is not an exception, why is an exception desirable?  Wouldn\u0027t a boolean indication of device existence be preferable, and allow more flexibility on the part of clients as to how they respond to a device state?","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"class OVSInterfaceDriver(LinuxInterfaceDriver):"},{"line_number":85,"context_line":"    \"\"\"Driver for creating an OVS interface.\"\"\""},{"line_number":86,"context_line":"    def plug(self, network_id, device, mac_address):"},{"line_number":87,"context_line":"        \"\"\"Plug in the interface.\"\"\""},{"line_number":88,"context_line":"        bridge \u003d self.conf.ovs_integration_bridge"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9%2B8%3D","line":85,"updated":"2012-07-03 20:49:58.000000000","message":"Blank line required below this one","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":94,"context_line":"                           \u0027--\u0027, \u0027--may-exist\u0027, \u0027add-port\u0027, bridge, device,"},{"line_number":95,"context_line":"                           \u0027--\u0027, \u0027set\u0027, \u0027Interface\u0027, device, \u0027type\u003dinternal\u0027,"},{"line_number":96,"context_line":"                           \u0027--\u0027, \u0027set\u0027, \u0027Interface\u0027, device,"},{"line_number":97,"context_line":"                           \u0027external-ids:iface-id\u003d%s\u0027 % device,"},{"line_number":98,"context_line":"                           \u0027--\u0027, \u0027set\u0027, \u0027Interface\u0027, device,"},{"line_number":99,"context_line":"                           \u0027external-ids:iface-status\u003dactive\u0027,"},{"line_number":100,"context_line":"                           \u0027--\u0027, \u0027set\u0027, \u0027Interface\u0027, device,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAJ3%2F%2F9vQ%3D","line":97,"updated":"2012-07-04 00:25:31.000000000","message":"sorry, i must have missed this in the previous reviews.  iface-id should be set to the port-id of the quantum port.  \n\nwe should probably change the \"plug\" method to take the port-id.  Otherwise i\u0027m not sure how this could work with the v2 OVS plugin.\n\nWe\u0027ll also need to update the LB plug method below.","commit_id":"80fc83bb38a3b99d47983a9021b95e74b1976745"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"OPTS \u003d ["},{"line_number":30,"context_line":"    cfg.StrOpt(\u0027ovs_integration_bridge\u0027,"},{"line_number":31,"context_line":"               default\u003d\u0027br-int\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Name of Open vSwitch bridge to use\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9lc%3D","line":29,"updated":"2012-07-04 07:11:14.000000000","message":"Should this not be part of OVSInterfaceDriver? It is very ovs centric. I think that the init should also call the register_opts","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"OPTS \u003d ["},{"line_number":30,"context_line":"    cfg.StrOpt(\u0027ovs_integration_bridge\u0027,"},{"line_number":31,"context_line":"               default\u003d\u0027br-int\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Name of Open vSwitch bridge to use\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9k8%3D","line":29,"in_reply_to":"AAAAJ3%2F%2F9lI%3D","updated":"2012-07-04 07:51:12.000000000","message":"ok. it may make sense at some stage to move these methods to the specific agents....","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"OPTS \u003d ["},{"line_number":30,"context_line":"    cfg.StrOpt(\u0027ovs_integration_bridge\u0027,"},{"line_number":31,"context_line":"               default\u003d\u0027br-int\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Name of Open vSwitch bridge to use\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9lI%3D","line":29,"in_reply_to":"AAAAJ3%2F%2F9lc%3D","updated":"2012-07-04 07:23:36.000000000","message":"this maps to what is done in nova, i think, listing all opts at the top of the file.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"}],"quantum/agent/linux/utils.py":[{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def device_exists(device, root_helper\u003dNone):"},{"line_number":56,"context_line":"    \"\"\"Check if ethernet device exists.\"\"\""},{"line_number":57,"context_line":"    try:"},{"line_number":58,"context_line":"        execute([\u0027ip\u0027, \u0027link\u0027, \u0027show\u0027, \u0027dev\u0027, device],"},{"line_number":59,"context_line":"                root_helper\u003droot_helper)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9qs%3D","line":56,"updated":"2012-07-04 02:43:43.000000000","message":"if -\u003e if the","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def device_exists(device, root_helper\u003dNone):"},{"line_number":56,"context_line":"    \"\"\"Check if ethernet device exists.\"\"\""},{"line_number":57,"context_line":"    try:"},{"line_number":58,"context_line":"        execute([\u0027ip\u0027, \u0027link\u0027, \u0027show\u0027, \u0027dev\u0027, device],"},{"line_number":59,"context_line":"                root_helper\u003droot_helper)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2FWc%3D","line":56,"in_reply_to":"AAAAJ3%2F%2F9qs%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def device_exists(device, root_helper\u003dNone):"},{"line_number":56,"context_line":"    \"\"\"Check if ethernet device exists.\"\"\""},{"line_number":57,"context_line":"    try:"},{"line_number":58,"context_line":"        execute([\u0027ip\u0027, \u0027link\u0027, \u0027show\u0027, \u0027dev\u0027, device],"},{"line_number":59,"context_line":"                root_helper\u003droot_helper)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9ls%3D","line":56,"in_reply_to":"AAAAJ3%2F%2F9qs%3D","updated":"2012-07-04 07:11:15.000000000","message":"as discussed on list, such nits should be considered suggestions.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"}],"quantum/common/exceptions.py":[{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8ee6a014183e38b8023773a62a19e709334d1399","unresolved":false,"context_lines":[{"line_number":144,"context_line":"    message \u003d _(\"No more IP addresses available on network %(net_id)s.\")"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"class BridgeDoesNotExist(Error):"},{"line_number":148,"context_line":"    message \u003d _(\"Bridge %(bridge)s does not exist.\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAJ3%2F%2F9qo%3D","line":147,"updated":"2012-07-04 02:43:43.000000000","message":"Base to QuantumException so that we can replace the key in the message.","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":144,"context_line":"    message \u003d _(\"No more IP addresses available on network %(net_id)s.\")"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"class BridgeDoesNotExist(Error):"},{"line_number":148,"context_line":"    message \u003d _(\"Bridge %(bridge)s does not exist.\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAKH%2F%2F%2Fco%3D","line":147,"in_reply_to":"AAAAJ3%2F%2F9qo%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"class SudoRequired(QuantumException):"},{"line_number":170,"context_line":"    message \u003d _(\"Sudo priviledge is required to run this command.\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAKX%2F%2F%2FxQ%3D","line":170,"updated":"2012-07-09 01:42:42.000000000","message":"So far all of the exceptions in this file have been API-related exceptions, meant to be generated by the plugin and wrapped by the API code.  These new Exceptions are more agent exceptions.  Perhaps in the future we would want to split the file into two, but for now I think this is OK.","commit_id":"43960ee4486925bff2b4da3af5db963b389f7dc2"}],"quantum/tests/unit/test_agent_config.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":15,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from quantum.agent.common import config"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6ws%3D","line":18,"updated":"2012-06-28 01:41:44.000000000","message":"Yay mock!","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":15,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from quantum.agent.common import config"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2Fgo%3D","line":18,"updated":"2012-07-02 15:50:44.000000000","message":"Mock is no longer used.","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"}],"quantum/tests/unit/test_dhcp_agent.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def tearDown(self):"},{"line_number":48,"context_line":"        self.driver_cls_p.stop()"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def test_daemon_loop_delta_is_none(self):"},{"line_number":51,"context_line":"        def stop_loop(*args):"},{"line_number":52,"context_line":"            self.dhcp._run \u003d False"},{"line_number":53,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6wk%3D","line":50,"updated":"2012-06-28 01:41:44.000000000","message":"Consider a more descriptive test name that documents the result being sought rather than just the input, e.g. test_daemon_loop_exits.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                                              updated\u003d[\u0027updated_net\u0027],"},{"line_number":66,"context_line":"                                              deleted\u003d[\u0027deleted_net\u0027])"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"                    self.assertRaises(RuntimeError, self.dhcp.daemon_loop)"},{"line_number":69,"context_line":"                    call_driver.assert_has_calls("},{"line_number":70,"context_line":"                        [mock.call(\u0027enable\u0027, \u0027new_net\u0027),"},{"line_number":71,"context_line":"                         mock.call(\u0027reload_assignments\u0027, \u0027updated_net\u0027),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6wg%3D","line":68,"updated":"2012-06-28 01:41:44.000000000","message":"Consider using unittest2\u0027s support for:\n\nwith self.assertRaises(RuntimeError):\n    self.dhcp.daemon_loop()\n\nIt makes for much nicer test debugging.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    def test_state_builder(self):"},{"line_number":75,"context_line":"        fake_subnet \u003d ["},{"line_number":76,"context_line":"            FakeModel(1, network_id\u003d1),"},{"line_number":77,"context_line":"            FakeModel(2, network_id\u003d2)"},{"line_number":78,"context_line":"        ]"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        fake_allocation \u003d ["}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6wc%3D","line":77,"updated":"2012-06-28 01:41:44.000000000","message":"Consider always adding trailing commas on multiline set and dict definitions.  The practice makes for cleaner diffs going forward.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":206,"context_line":"    def test_setup(self):"},{"line_number":207,"context_line":"        port_dict \u003d dict(mac_address\u003d\u0027aa:bb:cc:dd:ee:ff\u0027, allocations\u003d[])"},{"line_number":208,"context_line":"        with mock.patch(\u0027quantum.agent.linux.interface.NullDriver\u0027) as dvr:"},{"line_number":209,"context_line":"            with mock.patch(\u0027quantumclient.v2_0.client.Client\u0027) as client_cls:"},{"line_number":210,"context_line":"                client_inst \u003d mock.Mock()"},{"line_number":211,"context_line":"                client_inst.create_port.return_value \u003d port_dict"},{"line_number":212,"context_line":"                client_cls.return_value \u003d client_inst"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F2k%3D","line":209,"updated":"2012-06-28 22:11:41.000000000","message":"This is causing failures in Jenkins.\nI think we might need python-quantumclient in tools/test-requires, adding the following line from nova/tools/test-requires:\n-e git+https://github.com/openstack/python-quantumclient.git#egg\u003dpython-quantumclient","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"}],"quantum/tests/unit/test_linux_dhcp.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"class TestDhcpBase(unittest.TestCase):"},{"line_number":89,"context_line":"    def test_base_abc_error(self):"},{"line_number":90,"context_line":"        self.assertRaises(TypeError, dhcp.DhcpBase, None)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def test_atomic_file(self):"},{"line_number":93,"context_line":"        # make file to replace"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6wY%3D","line":90,"updated":"2012-06-28 01:41:44.000000000","message":"Consider using unittest2\u0027s \u0027with self.assertRaises\u0027","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    def test_base_abc_error(self):"},{"line_number":90,"context_line":"        self.assertRaises(TypeError, dhcp.DhcpBase, None)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def test_atomic_file(self):"},{"line_number":93,"context_line":"        # make file to replace"},{"line_number":94,"context_line":"        with mock.patch(\u0027tempfile.NamedTemporaryFile\u0027) as ntf:"},{"line_number":95,"context_line":"            ntf.return_value.name \u003d \u0027/baz\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6wU%3D","line":92,"updated":"2012-06-28 01:41:44.000000000","message":"Why use mocks to verify this behaviour?  It should be safe to perform an actual rename against a temporary file.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def test_conf_file_name(self):"},{"line_number":188,"context_line":"        tpl \u003d \u0027/dhcp/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/dev\u0027"},{"line_number":189,"context_line":"        with mock.patch(\u0027os.path.isdir\u0027) as isdir:"},{"line_number":190,"context_line":"            isdir.return_value \u003d False"},{"line_number":191,"context_line":"            with mock.patch(\u0027os.makedirs\u0027) as makedirs:"},{"line_number":192,"context_line":"                lp \u003d LocalChild(self.conf, FakeV4Network())"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6wQ%3D","line":189,"updated":"2012-06-28 01:41:44.000000000","message":"PEP8 - prefer underscore separated variable names.  This applies to other variable names in this module.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                lp \u003d LocalChild(self.conf, FakeDualNetwork())"},{"line_number":239,"context_line":"                lp.disable()"},{"line_number":240,"context_line":"                msg \u003d log.call_args[0][0]"},{"line_number":241,"context_line":"                self.assertTrue(\u0027stale\u0027 in msg)"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    def test_disable_unknown_network(self):"},{"line_number":244,"context_line":"        attrs_to_mock \u003d dict([(a, mock.DEFAULT) for a in [\u0027active\u0027, \u0027pid\u0027]])"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6wM%3D","line":241,"updated":"2012-06-28 01:41:44.000000000","message":"Consider using unittest2\u0027s assertIn","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":281,"context_line":"            mock_open.return_value.__exit__ \u003d mock.Mock()"},{"line_number":282,"context_line":"            mock_open.return_value.read.return_value \u003d \u0027foo\u0027"},{"line_number":283,"context_line":"            lp \u003d LocalChild(self.conf, FakeDualNetwork())"},{"line_number":284,"context_line":"            self.assertIsNone(lp.pid)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def test_pid_invalid_file(self):"},{"line_number":287,"context_line":"        tf \u003d tempfile.NamedTemporaryFile()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F2Q%3D","line":284,"updated":"2012-06-28 22:11:41.000000000","message":"AssertIsNone was introduced in python 2.7\nGate jobs run python 2.6 - this is causing jenkins failures","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":281,"context_line":"            mock_open.return_value.__exit__ \u003d mock.Mock()"},{"line_number":282,"context_line":"            mock_open.return_value.read.return_value \u003d \u0027foo\u0027"},{"line_number":283,"context_line":"            lp \u003d LocalChild(self.conf, FakeDualNetwork())"},{"line_number":284,"context_line":"            self.assertIsNone(lp.pid)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def test_pid_invalid_file(self):"},{"line_number":287,"context_line":"        tf \u003d tempfile.NamedTemporaryFile()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2Fw4%3D","line":284,"in_reply_to":"AAAAJX%2F%2F%2F2Q%3D","updated":"2012-06-28 23:03:53.000000000","message":"Another reason to use unittest2 - it\u0027s a drop-in replacement for unittest, is already a quantum test dependency, and supports things like assertIsNone due to being a backport of 2.7\u0027s unittest module.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            self.assertIsNone(lp.pid)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def test_pid_invalid_file(self):"},{"line_number":287,"context_line":"        tf \u003d tempfile.NamedTemporaryFile()"},{"line_number":288,"context_line":"        tf.close()"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        with mock.patch.object(LocalChild, \u0027conf_file_name\u0027) as conf_file:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6wI%3D","line":287,"updated":"2012-06-28 01:41:44.000000000","message":"Are these two lines necessary?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":290,"context_line":"        with mock.patch.object(LocalChild, \u0027conf_file_name\u0027) as conf_file:"},{"line_number":291,"context_line":"            conf_file.return_value \u003d \u0027.doesnotexist/pid\u0027"},{"line_number":292,"context_line":"            lp \u003d LocalChild(self.conf, FakeDualNetwork())"},{"line_number":293,"context_line":"            self.assertIsNone(lp.pid)"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    def test_dev(self):"},{"line_number":296,"context_line":"        with mock.patch(\u0027__builtin__.open\u0027) as mock_open:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F2M%3D","line":293,"updated":"2012-06-28 22:11:41.000000000","message":"AssertIsNone was introduced in python 2.7\nGate jobs run python 2.6 - this is causing jenkins failures","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":301,"context_line":"            self.assertEqual(lp.dev, \u0027tap0\u0027)"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"    def test_dev_invalid_file(self):"},{"line_number":304,"context_line":"        tf \u003d tempfile.NamedTemporaryFile()"},{"line_number":305,"context_line":"        tf.close()"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        with mock.patch.object(LocalChild, \u0027conf_file_name\u0027) as conf_file:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6wE%3D","line":304,"updated":"2012-06-28 01:41:44.000000000","message":"Are these two lines necessary?","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":307,"context_line":"        with mock.patch.object(LocalChild, \u0027conf_file_name\u0027) as conf_file:"},{"line_number":308,"context_line":"            conf_file.return_value \u003d \u0027.doesnotexist/dev\u0027"},{"line_number":309,"context_line":"            lp \u003d LocalChild(self.conf, FakeDualNetwork())"},{"line_number":310,"context_line":"            self.assertIsNone(lp.dev, None)"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    def test_add_accept_rules(self):"},{"line_number":313,"context_line":"        with mock.patch.object(LocalChild, \u0027dev\u0027) as dev:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6wA%3D","line":310,"updated":"2012-06-28 01:41:44.000000000","message":"\u003d\u003e self.assertIsNone(lp.dev)","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":307,"context_line":"        with mock.patch.object(LocalChild, \u0027conf_file_name\u0027) as conf_file:"},{"line_number":308,"context_line":"            conf_file.return_value \u003d \u0027.doesnotexist/dev\u0027"},{"line_number":309,"context_line":"            lp \u003d LocalChild(self.conf, FakeDualNetwork())"},{"line_number":310,"context_line":"            self.assertIsNone(lp.dev, None)"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    def test_add_accept_rules(self):"},{"line_number":313,"context_line":"        with mock.patch.object(LocalChild, \u0027dev\u0027) as dev:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F2E%3D","line":310,"in_reply_to":"AAAAI3%2F%2F6wA%3D","updated":"2012-06-28 22:11:41.000000000","message":"AssertIsNone was introduced in python 2.7\nGate jobs run python 2.6 - this is causing jenkins failures","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"d6b9d6be5bba60722ae01b952d347d71a91dd660","unresolved":false,"context_lines":[{"line_number":320,"context_line":""},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"class TestDnsmasq(TestBase):"},{"line_number":323,"context_line":"    def _test_spawn(self, extra):"},{"line_number":324,"context_line":"        expected \u003d ["},{"line_number":325,"context_line":"            \u0027NETWORK_ID\u003dcccccccc-cccc-cccc-cccc-cccccccccccc\u0027,"},{"line_number":326,"context_line":"            \u0027dnsmasq\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAI3%2F%2F6v8%3D","line":323,"updated":"2012-06-28 01:41:44.000000000","message":"Consider using a more descriptive parameter name, e.g.:\n\nextra \u003d\u003e extra_args","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":301,"context_line":"        with mock.patch.object(LocalChild, \u0027get_conf_file_name\u0027) as conf_file:"},{"line_number":302,"context_line":"            conf_file.return_value \u003d \u0027.doesnotexist/dev\u0027"},{"line_number":303,"context_line":"            lp \u003d LocalChild(self.conf, FakeDualNetwork())"},{"line_number":304,"context_line":"            self.assertIsNone(lp.interface_name, None)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"class TestDnsmasq(TestBase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAJ3%2F%2F%2FgU%3D","line":304,"updated":"2012-07-02 15:50:44.000000000","message":", None \u003d\u003e","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"}],"quantum/tests/unit/test_linux_interface.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class FakePort(object):"},{"line_number":45,"context_line":"    allocations \u003d [FakeAllocation]"},{"line_number":46,"context_line":"    device_id \u003d \u0027tap0\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"class TestBase(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAJX%2F%2F%2F%2Bw%3D","line":46,"updated":"2012-06-28 22:04:35.000000000","message":"not sure if it matters, but the \u0027device_id\u0027 attribute on a port is actually a UUID... for example, the UUID of the Nova server that is plugged into this port.","commit_id":"e8493901925f8672fb1ee2a666c117181117392e"}],"quantum/tests/unit/test_linux_ip_lib.py":[{"author":{"_account_id":1731,"name":"Yusuke Muraoka","email":"yusuke@nttmcl.com","username":"yusuke"},"unresolved":false,"context_lines":[{"line_number":264,"context_line":"    def test_device_exists(self):"},{"line_number":265,"context_line":"        with mock.patch.object(ip_lib.IPDevice, \u0027_execute\u0027) as _execute:"},{"line_number":266,"context_line":"            _execute.return_value \u003d LINK_SAMPLE[1]"},{"line_number":267,"context_line":"            self.assertTrue(ip_lib.device_exists(\u0027eth0\u0027))"},{"line_number":268,"context_line":"            _execute.assert_called_once_with(\u0027o\u0027, \u0027link\u0027, (\u0027show\u0027, \u0027eth0\u0027))"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def test_device_does_not_exist(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAKX%2F%2F%2B7s%3D","line":267,"updated":"2012-07-10 10:46:24.000000000","message":"This doesn\u0027t test any existing of device. Even if calling with \u0027eth1\u0027, device_exists returns True in this context.\n\nBecause this test only guarantees for the execution to be called with specified parameters, no guarantees for existing device.","commit_id":"43960ee4486925bff2b4da3af5db963b389f7dc2"}],"tools/pip-requires":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":2,"context_line":"PasteDeploy\u003d\u003d1.5.0"},{"line_number":3,"context_line":"Routes\u003e\u003d1.12.3"},{"line_number":4,"context_line":"eventlet\u003e\u003d0.9.12"},{"line_number":5,"context_line":"httplib2"},{"line_number":6,"context_line":"lxml"},{"line_number":7,"context_line":"netaddr"},{"line_number":8,"context_line":"python-gflags\u003d\u003d1.3"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAAJ3%2F%2F%2Fwk%3D","line":5,"updated":"2012-07-02 05:36:40.000000000","message":"I didn\u0027t see this used.  Is it?","commit_id":"4de8ede4afb2e69378d0efcc79b3fc84ad54cefa"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":6,"context_line":"lxml"},{"line_number":7,"context_line":"netaddr"},{"line_number":8,"context_line":"python-gflags\u003d\u003d1.3"},{"line_number":9,"context_line":"-e git+https://github.com/openstack/python-quantumclient.git#egg\u003dpython-quantumclient"},{"line_number":10,"context_line":"sqlalchemy\u003e0.6.4"},{"line_number":11,"context_line":"webob\u003d\u003d1.2.0"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"AAAAKH%2F%2F%2B3w%3D","line":9,"updated":"2012-07-05 23:12:49.000000000","message":"mtaylor recently instructed to change this line with:\npython-quantumclient\u003e\u003d0.1,\u003c0.2\nin order to pull from pipy and not github","commit_id":"c3543f23879d59941d89a77b393096b47697f008"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":6,"context_line":"lxml"},{"line_number":7,"context_line":"netaddr"},{"line_number":8,"context_line":"python-gflags\u003d\u003d1.3"},{"line_number":9,"context_line":"-e git+https://github.com/openstack/python-quantumclient.git#egg\u003dpython-quantumclient"},{"line_number":10,"context_line":"sqlalchemy\u003e0.6.4"},{"line_number":11,"context_line":"webob\u003d\u003d1.2.0"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"AAAAKH%2F%2F%2Bm8%3D","line":9,"in_reply_to":"AAAAKH%2F%2F%2B3w%3D","updated":"2012-07-06 18:26:19.000000000","message":"Done","commit_id":"c3543f23879d59941d89a77b393096b47697f008"}]}
