)]}'
{"quantum/agent/dhcp_agent.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self.device_manager \u003d DeviceManager(self.conf, self.plugin_rpc)"},{"line_number":79,"context_line":"        self.lease_relay \u003d DhcpLeaseRelay(self.update_lease)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        # prepopulate the networks cache after a cold start of the DHCP-agent."},{"line_number":82,"context_line":"        # If chosen DHCP driver can not return a list of existing networks,"},{"line_number":83,"context_line":"        # just start with an empty networks cache"},{"line_number":84,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5fE%3D","line":81,"updated":"2013-03-07 05:25:07.000000000","message":"This code should really be in sync_state.","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":134,"context_line":"    def sync_state(self):"},{"line_number":135,"context_line":"        \"\"\"Sync the local DHCP state with Quantum.\"\"\""},{"line_number":136,"context_line":"        LOG.info(_(\u0027Synchronizing state\u0027))"},{"line_number":137,"context_line":"        known_networks \u003d set(self.cache.get_network_ids())"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        try:"},{"line_number":140,"context_line":"            active_networks \u003d set(self.plugin_rpc.get_active_networks())"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5e4%3D","line":137,"updated":"2013-03-07 05:25:07.000000000","message":"try:\n    preexisting_conf_ids \u003d set(self.dhcp_driver_cls.active_networks(self.conf))\nexcept NotImplementedError:\n    preexisting_conf_ids \u003d set()","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":139,"context_line":"        try:"},{"line_number":140,"context_line":"            active_networks \u003d set(self.plugin_rpc.get_active_networks())"},{"line_number":141,"context_line":"            for deleted_id in known_networks - active_networks:"},{"line_number":142,"context_line":"                self.disable_dhcp_helper(deleted_id)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"            for network_id in active_networks:"},{"line_number":145,"context_line":"                self.refresh_dhcp_helper(network_id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5ew%3D","line":142,"updated":"2013-03-07 05:25:07.000000000","message":"for stale_id in preexisting_conf_ids - active_networks:\n    self.call_driver(\u0027disable\u0027, DictModel(...))","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":387,"context_line":""},{"line_number":388,"context_line":"class NetworkCache(object):"},{"line_number":389,"context_line":"    \"\"\"Agent cache of the current network state.\"\"\""},{"line_number":390,"context_line":"    def __init__(self, existing_networks\u003dNone):"},{"line_number":391,"context_line":"        self.cache \u003d {}"},{"line_number":392,"context_line":"        self.subnet_lookup \u003d {}"},{"line_number":393,"context_line":"        self.port_lookup \u003d {}"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5f4%3D","line":390,"updated":"2013-03-07 05:25:07.000000000","message":"Consider having the parent loading this cache.  It makes the flow simpler.","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"unresolved":false,"context_lines":[{"line_number":392,"context_line":"        self.subnet_lookup \u003d {}"},{"line_number":393,"context_line":"        self.port_lookup \u003d {}"},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"        if existing_networks:"},{"line_number":396,"context_line":"            for net in existing_networks:"},{"line_number":397,"context_line":"                self.put(net)"},{"line_number":398,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5Sc%3D","line":395,"updated":"2013-03-07 09:08:01.000000000","message":"you can remove this check if use [ ] as a default parameter for existing_networks","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":94,"context_line":"                net \u003d DictModel({\"id\": net_id, \"subnets\": [], \"ports\": []})"},{"line_number":95,"context_line":"                self.cache.put(net)"},{"line_number":96,"context_line":"        except NotImplementedError:"},{"line_number":97,"context_line":"            # the chosen DHCP-driver doesn\u0027t support retrieving of a list of"},{"line_number":98,"context_line":"            # existing networks, just go ahead with an empty networks cache"},{"line_number":99,"context_line":"            pass"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2F1Zk%3D","line":97,"updated":"2013-03-12 03:10:48.000000000","message":"Minor nit... How about a LOG.debug() here?","commit_id":"83586242e7879846b3d55af5046e8ae28e2bd943"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"unresolved":false,"context_lines":[{"line_number":94,"context_line":"                net \u003d DictModel({\"id\": net_id, \"subnets\": [], \"ports\": []})"},{"line_number":95,"context_line":"                self.cache.put(net)"},{"line_number":96,"context_line":"        except NotImplementedError:"},{"line_number":97,"context_line":"            # the chosen DHCP-driver doesn\u0027t support retrieving of a list of"},{"line_number":98,"context_line":"            # existing networks, just go ahead with an empty networks cache"},{"line_number":99,"context_line":"            pass"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2Fy%2FI%3D","line":97,"in_reply_to":"AAAAN3%2F%2F1Zk%3D","updated":"2013-03-12 10:42:00.000000000","message":"Done","commit_id":"83586242e7879846b3d55af5046e8ae28e2bd943"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"unresolved":false,"context_lines":[{"line_number":97,"context_line":"            # just go ahead with an empty networks cache"},{"line_number":98,"context_line":"            LOG.debug("},{"line_number":99,"context_line":"                _(\u0027The \\\u0027%s\\\u0027 DHCP-driver does not support retrieving of a \u0027"},{"line_number":100,"context_line":"                  \u0027list of existing networks\u0027),"},{"line_number":101,"context_line":"                self.conf.dhcp_driver"},{"line_number":102,"context_line":"            )"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAN3%2F%2FyyY%3D","line":100,"updated":"2013-03-12 12:53:34.000000000","message":"Small nits, this should be \"The \u0027%s\u0027 DHCP-driver does not...\"","commit_id":"09b77fa04bc1a08338335d312e7a8b96c070d984"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"unresolved":false,"context_lines":[{"line_number":97,"context_line":"            # just go ahead with an empty networks cache"},{"line_number":98,"context_line":"            LOG.debug("},{"line_number":99,"context_line":"                _(\u0027The \\\u0027%s\\\u0027 DHCP-driver does not support retrieving of a \u0027"},{"line_number":100,"context_line":"                  \u0027list of existing networks\u0027),"},{"line_number":101,"context_line":"                self.conf.dhcp_driver"},{"line_number":102,"context_line":"            )"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAN3%2F%2FyxQ%3D","line":100,"in_reply_to":"AAAAN3%2F%2FyyY%3D","updated":"2013-03-12 13:11:58.000000000","message":"Done","commit_id":"09b77fa04bc1a08338335d312e7a8b96c070d984"}],"quantum/agent/linux/dhcp.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":93,"context_line":"    def reload_allocations(self):"},{"line_number":94,"context_line":"        \"\"\"Force the DHCP server to reload the assignment database.\"\"\""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    @staticmethod"},{"line_number":97,"context_line":"    def active_networks(conf):"},{"line_number":98,"context_line":"        \"\"\"Return the list of active networks ids (ones we have configs for)\"\"\""},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5hU%3D","line":96,"updated":"2013-03-07 05:25:07.000000000","message":"@classmethod  It will make life easier for those inheriting this class.","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":94,"context_line":"        \"\"\"Force the DHCP server to reload the assignment database.\"\"\""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    @staticmethod"},{"line_number":97,"context_line":"    def active_networks(conf):"},{"line_number":98,"context_line":"        \"\"\"Return the list of active networks ids (ones we have configs for)\"\"\""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        raise NotImplementedError"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5es%3D","line":97,"updated":"2013-03-07 05:25:07.000000000","message":"def existing_dhcp_networks(conf):","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":220,"context_line":"    QUANTUM_NETWORK_ID_KEY \u003d \u0027QUANTUM_NETWORK_ID\u0027"},{"line_number":221,"context_line":"    QUANTUM_RELAY_SOCKET_PATH_KEY \u003d \u0027QUANTUM_RELAY_SOCKET_PATH\u0027"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    @staticmethod"},{"line_number":224,"context_line":"    def active_networks(conf):"},{"line_number":225,"context_line":"        \"\"\"Return the list of active networks ids (ones we have configs for)\"\"\""},{"line_number":226,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5hM%3D","line":223,"updated":"2013-03-07 05:25:07.000000000","message":"@classmethod","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":221,"context_line":"    QUANTUM_RELAY_SOCKET_PATH_KEY \u003d \u0027QUANTUM_RELAY_SOCKET_PATH\u0027"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    @staticmethod"},{"line_number":224,"context_line":"    def active_networks(conf):"},{"line_number":225,"context_line":"        \"\"\"Return the list of active networks ids (ones we have configs for)\"\"\""},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        confs_dir \u003d os.path.abspath(os.path.normpath(conf.dhcp_confs))"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5ek%3D","line":224,"updated":"2013-03-07 05:25:07.000000000","message":"def existing_dhcp_networks(conf):","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":6975,"name":"Phani Achanta","email":"phani_achanta@dell.com","username":"phani_achanta"},"change_message_id":"cf6a822d456b4acd240580321d09ac1b36c156c1","unresolved":false,"context_lines":[{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        return ["},{"line_number":230,"context_line":"            c for c in os.listdir(confs_dir)"},{"line_number":231,"context_line":"            if os.path.isdir(os.path.join(confs_dir, c))"},{"line_number":232,"context_line":"        ]"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def spawn_process(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F6ik%3D","line":231,"updated":"2013-03-06 17:16:05.000000000","message":"need to make this check more precise.\ncheck that directory name is a valid uuid\ncan have a case where other directories exist which do not describe network.\nespecially harmful if we delete the directory assuming its network config (_remove_config_file change)","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        return ["},{"line_number":230,"context_line":"            c for c in os.listdir(confs_dir)"},{"line_number":231,"context_line":"            if os.path.isdir(os.path.join(confs_dir, c))"},{"line_number":232,"context_line":"        ]"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def spawn_process(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5hQ%3D","line":231,"in_reply_to":"AAAAN3%2F%2F6ik%3D","updated":"2013-03-07 05:25:07.000000000","message":"Agreed.  Also you should make sure that directory name is uuid like and that pid associated with the process is actually alive.  files existing !\u003d active","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        confs_dir \u003d os.path.abspath(os.path.normpath(conf.dhcp_confs))"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        def is_uuid4_like(conf):"},{"line_number":238,"context_line":"            return re.match("},{"line_number":239,"context_line":"                \"\"\"^"},{"line_number":240,"context_line":"                   [a-f0-9]{8}-"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAN3%2F%2F5JY%3D","line":237,"updated":"2013-03-07 11:38:55.000000000","message":"Better to reuse openstack.common.uuidutils.is_uuid_like()","commit_id":"596bd9543ca247ea357bd59d692e3c3bd9aedb66"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        confs_dir \u003d os.path.abspath(os.path.normpath(conf.dhcp_confs))"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        def is_uuid4_like(conf):"},{"line_number":238,"context_line":"            return re.match("},{"line_number":239,"context_line":"                \"\"\"^"},{"line_number":240,"context_line":"                   [a-f0-9]{8}-"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAN3%2F%2F4%2Bw%3D","line":237,"in_reply_to":"AAAAN3%2F%2F5JY%3D","updated":"2013-03-07 16:44:19.000000000","message":"Done","commit_id":"596bd9543ca247ea357bd59d692e3c3bd9aedb66"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"from quantum.agent.linux import ip_lib"},{"line_number":30,"context_line":"from quantum.agent.linux import utils"},{"line_number":31,"context_line":"from quantum.openstack.common import jsonutils, uuidutils"},{"line_number":32,"context_line":"from quantum.openstack.common import log as logging"},{"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":"AAAAN3%2F%2F1uI%3D","line":31,"updated":"2013-03-09 23:55:33.000000000","message":"The Quantum hacking guidelines do not allow this style of import.  The uuidutils import should go after line 32.","commit_id":"5a0d2d69e67b37eb9a834b13fab1c375121b11fd"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"from quantum.agent.linux import ip_lib"},{"line_number":30,"context_line":"from quantum.agent.linux import utils"},{"line_number":31,"context_line":"from quantum.openstack.common import jsonutils, uuidutils"},{"line_number":32,"context_line":"from quantum.openstack.common import log as logging"},{"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":"AAAAN3%2F%2F1eM%3D","line":31,"in_reply_to":"AAAAN3%2F%2F1uI%3D","updated":"2013-03-10 14:14:55.000000000","message":"Done","commit_id":"5a0d2d69e67b37eb9a834b13fab1c375121b11fd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":175,"context_line":"        LOG.debug(msg % file_name)"},{"line_number":176,"context_line":"        return None"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @classmethod"},{"line_number":179,"context_line":"    def _is_dhcp_alive(cls, network_id, pid, root_helper):"},{"line_number":180,"context_line":"        \"\"\"Returns True if dhcp-process with given pid is serving given net\"\"\""},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAN3%2F%2F1to%3D","line":178,"updated":"2013-03-09 23:55:33.000000000","message":"I don\u0027t think this necessary after making the suggested changes in line 237.","commit_id":"5a0d2d69e67b37eb9a834b13fab1c375121b11fd"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"unresolved":false,"context_lines":[{"line_number":175,"context_line":"        LOG.debug(msg % file_name)"},{"line_number":176,"context_line":"        return None"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @classmethod"},{"line_number":179,"context_line":"    def _is_dhcp_alive(cls, network_id, pid, root_helper):"},{"line_number":180,"context_line":"        \"\"\"Returns True if dhcp-process with given pid is serving given net\"\"\""},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAN3%2F%2F1eI%3D","line":178,"in_reply_to":"AAAAN3%2F%2F1to%3D","updated":"2013-03-10 14:14:55.000000000","message":"Done","commit_id":"5a0d2d69e67b37eb9a834b13fab1c375121b11fd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        confs_dir \u003d os.path.abspath(os.path.normpath(conf.dhcp_confs))"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        def is_pid_alive(conf):"},{"line_number":238,"context_line":"            try:"},{"line_number":239,"context_line":"                pid_path \u003d os.path.join(confs_dir, conf, \"pid\")"},{"line_number":240,"context_line":"                with open(pid_path, \"rt\") as f:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAN3%2F%2F1ts%3D","line":237,"updated":"2013-03-09 23:55:33.000000000","message":"You\u0027re duplicating existing functionality.  Lines 237-252 can be replaced with:\n\nreturn [\n    c for c in os.listdir(confs_dir)\n    if uuidutils.is_uuid_like(c) and cls(conf, c, root_helper).active\n]","commit_id":"5a0d2d69e67b37eb9a834b13fab1c375121b11fd"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        confs_dir \u003d os.path.abspath(os.path.normpath(conf.dhcp_confs))"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        def is_pid_alive(conf):"},{"line_number":238,"context_line":"            try:"},{"line_number":239,"context_line":"                pid_path \u003d os.path.join(confs_dir, conf, \"pid\")"},{"line_number":240,"context_line":"                with open(pid_path, \"rt\") as f:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAN3%2F%2F1eE%3D","line":237,"in_reply_to":"AAAAN3%2F%2F1ts%3D","updated":"2013-03-10 14:14:55.000000000","message":"Done","commit_id":"5a0d2d69e67b37eb9a834b13fab1c375121b11fd"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"unresolved":false,"context_lines":[{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        confs_dir \u003d os.path.abspath(os.path.normpath(conf.dhcp_confs))"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        class FakeNetwork:"},{"line_number":231,"context_line":"            def __init__(self, net_id):"},{"line_number":232,"context_line":"                self.id \u003d net_id"},{"line_number":233,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2Fz3o%3D","line":230,"updated":"2013-03-11 19:22:49.000000000","message":"Ugly, but adding `from quantum.agent.dhcp_agent import DictModel` to the top of the module leads to a circular import. So  there are two options: make that import right here or declare a helper class.","commit_id":"83586242e7879846b3d55af5046e8ae28e2bd943"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"unresolved":false,"context_lines":[{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        confs_dir \u003d os.path.abspath(os.path.normpath(conf.dhcp_confs))"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        class FakeNetwork:"},{"line_number":231,"context_line":"            def __init__(self, net_id):"},{"line_number":232,"context_line":"                self.id \u003d net_id"},{"line_number":233,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2FzSM%3D","line":230,"in_reply_to":"AAAAN3%2F%2Fz3o%3D","updated":"2013-03-12 02:12:43.000000000","message":"Or you can move \u0027DictModel\u0027 into \u0027quantum.agent.utils.py\u0027","commit_id":"83586242e7879846b3d55af5046e8ae28e2bd943"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"unresolved":false,"context_lines":[{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        confs_dir \u003d os.path.abspath(os.path.normpath(conf.dhcp_confs))"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        class FakeNetwork:"},{"line_number":231,"context_line":"            def __init__(self, net_id):"},{"line_number":232,"context_line":"                self.id \u003d net_id"},{"line_number":233,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2FzG8%3D","line":230,"in_reply_to":"AAAAN3%2F%2FzQQ%3D","updated":"2013-03-12 06:26:55.000000000","message":"ok, that\u0027s ok for me","commit_id":"83586242e7879846b3d55af5046e8ae28e2bd943"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        confs_dir \u003d os.path.abspath(os.path.normpath(conf.dhcp_confs))"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        class FakeNetwork:"},{"line_number":231,"context_line":"            def __init__(self, net_id):"},{"line_number":232,"context_line":"                self.id \u003d net_id"},{"line_number":233,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2FzQQ%3D","line":230,"in_reply_to":"AAAAN3%2F%2FzSM%3D","updated":"2013-03-12 03:10:48.000000000","message":"We\u0027re late in release cycle for this to make RC1 and want to avoid moving any code.  I think that using a fake here is acceptable since the method is leveraging the class\u0027 own functionality.","commit_id":"83586242e7879846b3d55af5046e8ae28e2bd943"}],"quantum/tests/unit/test_dhcp_agent.py":[{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"e4cabf76e60145e69d852baccae3bb38dfffc1a7","unresolved":false,"context_lines":[{"line_number":336,"context_line":"                active.assert_called_once_with(dhcp.conf)"},{"line_number":337,"context_line":"                cache.assert_called_once_with()"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"        with mock.patch.object(self.driver, \u0027active_networks\u0027) as active:"},{"line_number":340,"context_line":"            with mock.patch(\u0027quantum.agent.dhcp_agent.NetworkCache\u0027) as cache:"},{"line_number":341,"context_line":"                with mock.patch(\u0027quantum.agent.dhcp_agent.DictModel\u0027) as Dict:"},{"line_number":342,"context_line":"                    networks \u003d [\u0027aaa\u0027, \u0027bbb\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAN3%2F%2F6qA%3D","line":339,"updated":"2013-03-06 16:06:14.000000000","message":"I think it\u0027s better add a separate test for this.","commit_id":"c235f5d2865316af70cb11b4f1f33b18e896ba58"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def test_populate_cache_on_start_without_active_networks_support(self):"},{"line_number":329,"context_line":"        # emul dhcp driver that doesn\u0027t support retrieving of active networks"},{"line_number":330,"context_line":"        with mock.patch.object(self.driver, \u0027active_networks\u0027) as active:"},{"line_number":331,"context_line":"            with mock.patch(\u0027quantum.agent.dhcp_agent.NetworkCache\u0027) as cache:"},{"line_number":332,"context_line":"                active.side_effect \u003d NotImplementedError"},{"line_number":333,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5g8%3D","line":330,"updated":"2013-03-07 05:25:07.000000000","message":"self.driver is already a mock.  There should be no need to patch it.","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":328,"context_line":"    def test_populate_cache_on_start_without_active_networks_support(self):"},{"line_number":329,"context_line":"        # emul dhcp driver that doesn\u0027t support retrieving of active networks"},{"line_number":330,"context_line":"        with mock.patch.object(self.driver, \u0027active_networks\u0027) as active:"},{"line_number":331,"context_line":"            with mock.patch(\u0027quantum.agent.dhcp_agent.NetworkCache\u0027) as cache:"},{"line_number":332,"context_line":"                active.side_effect \u003d NotImplementedError"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"                dhcp \u003d dhcp_agent.DhcpAgent(HOSTNAME)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5go%3D","line":331,"updated":"2013-03-07 05:25:07.000000000","message":"The cache is empty after each run.  Not sure why it is necessary to mock it.","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":334,"context_line":"                dhcp \u003d dhcp_agent.DhcpAgent(HOSTNAME)"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"                active.assert_called_once_with(dhcp.conf)"},{"line_number":337,"context_line":"                cache.assert_called_once_with()"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"    def test_populate_cache_on_start(self):"},{"line_number":340,"context_line":"        with mock.patch.object(self.driver, \u0027active_networks\u0027) as active:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5gU%3D","line":337,"updated":"2013-03-07 05:25:07.000000000","message":"Shouldn\u0027t you validate that the cache is still empty?","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":337,"context_line":"                cache.assert_called_once_with()"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"    def test_populate_cache_on_start(self):"},{"line_number":340,"context_line":"        with mock.patch.object(self.driver, \u0027active_networks\u0027) as active:"},{"line_number":341,"context_line":"            with mock.patch(\u0027quantum.agent.dhcp_agent.NetworkCache\u0027) as cache:"},{"line_number":342,"context_line":"                with mock.patch(\u0027quantum.agent.dhcp_agent.DictModel\u0027) as Dict:"},{"line_number":343,"context_line":"                    networks \u003d [\u0027aaa\u0027, \u0027bbb\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5g0%3D","line":340,"updated":"2013-03-07 05:25:07.000000000","message":"same as above","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":338,"context_line":""},{"line_number":339,"context_line":"    def test_populate_cache_on_start(self):"},{"line_number":340,"context_line":"        with mock.patch.object(self.driver, \u0027active_networks\u0027) as active:"},{"line_number":341,"context_line":"            with mock.patch(\u0027quantum.agent.dhcp_agent.NetworkCache\u0027) as cache:"},{"line_number":342,"context_line":"                with mock.patch(\u0027quantum.agent.dhcp_agent.DictModel\u0027) as Dict:"},{"line_number":343,"context_line":"                    networks \u003d [\u0027aaa\u0027, \u0027bbb\u0027]"},{"line_number":344,"context_line":"                    active.return_value \u003d networks"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5gg%3D","line":341,"updated":"2013-03-07 05:25:07.000000000","message":"The cache is empty after each run.  Not sure why it is necessary to mock it.","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":345,"context_line":""},{"line_number":346,"context_line":"                    dhcp \u003d dhcp_agent.DhcpAgent(HOSTNAME)"},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"                    cache.assert_called_once()"},{"line_number":349,"context_line":"                    active.assert_called_once_with(dhcp.conf)"},{"line_number":350,"context_line":"                    Dict.assert_has_calls(["},{"line_number":351,"context_line":"                        mock.call({\"id\": net_id, \"subnets\": [], \"ports\": []})"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2F5gY%3D","line":348,"updated":"2013-03-07 05:25:07.000000000","message":"Should you verify that the data items are added to the cache?","commit_id":"9589f0ae87222c05014ae8025d6462b202469139"}]}
