)]}'
{"neutron/agent/linux/dhcp.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6e378bff06617bcc6228f8aff95f314861c17de6","unresolved":false,"context_lines":[{"line_number":386,"context_line":""},{"line_number":387,"context_line":"        try:"},{"line_number":388,"context_line":"            cmd.append(\u0027--conf-file\u003d%s\u0027 % self.conf.dnsmasq_config_file)"},{"line_number":389,"context_line":"        except RuntimeError:"},{"line_number":390,"context_line":"            # NOTE(changzhi): RuntimeError will happen when dnsmasq_config_file"},{"line_number":391,"context_line":"            # doesn\u0027t exist."},{"line_number":392,"context_line":"            cmd.append(\u0027--conf-file\u003d\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_ab2220a1","line":389,"updated":"2016-02-08 04:39:37.000000000","message":"i would suggest logging something here. what can lead to this happening? this may at least help an admin isolate and address that issue","commit_id":"737dae9bf88779d84fb4c17eef33f80b00dd4251"},{"author":{"_account_id":14562,"name":"Zhi Chang","email":"changzhi2@lenovo.com","username":"changzhi"},"change_message_id":"5aee24c75087923bdd0e635159ddd8830bc3745c","unresolved":false,"context_lines":[{"line_number":386,"context_line":""},{"line_number":387,"context_line":"        try:"},{"line_number":388,"context_line":"            cmd.append(\u0027--conf-file\u003d%s\u0027 % self.conf.dnsmasq_config_file)"},{"line_number":389,"context_line":"        except RuntimeError:"},{"line_number":390,"context_line":"            # NOTE(changzhi): RuntimeError will happen when dnsmasq_config_file"},{"line_number":391,"context_line":"            # doesn\u0027t exist."},{"line_number":392,"context_line":"            cmd.append(\u0027--conf-file\u003d\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_ebfc97b9","line":389,"in_reply_to":"5a5ae5dd_ab2220a1","updated":"2016-02-08 06:03:47.000000000","message":"this exception will happen when the configuration file doesn\u0027t exists.","commit_id":"737dae9bf88779d84fb4c17eef33f80b00dd4251"},{"author":{"_account_id":14562,"name":"Zhi Chang","email":"changzhi2@lenovo.com","username":"changzhi"},"change_message_id":"7007b8093ab7459d9e637757e585c7b1814c4805","unresolved":false,"context_lines":[{"line_number":386,"context_line":""},{"line_number":387,"context_line":"        try:"},{"line_number":388,"context_line":"            cmd.append(\u0027--conf-file\u003d%s\u0027 % self.conf.dnsmasq_config_file)"},{"line_number":389,"context_line":"        except RuntimeError:"},{"line_number":390,"context_line":"            # NOTE(changzhi): RuntimeError will happen when dnsmasq_config_file"},{"line_number":391,"context_line":"            # doesn\u0027t exist."},{"line_number":392,"context_line":"            cmd.append(\u0027--conf-file\u003d\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_7124e3c5","line":389,"in_reply_to":"5a5ae5dd_ebfc97b9","updated":"2016-02-09 01:40:21.000000000","message":"hi garyk. i have a question about unit test. in this unit test:\n\n        def test_spawn_cfg_config_file(self):\n            self.conf.set_override(\u0027dnsmasq_config_file\u0027, \u0027/foo\u0027)\n            self._test_spawn([\u0027--conf-file\u003d/foo\u0027, \u0027--domain\u003dopenstacklocal\u0027])\n\n\"/foo\" is not exist. and why there is no RuntimeError? and how do i change this following my code? thx","commit_id":"737dae9bf88779d84fb4c17eef33f80b00dd4251"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"73388008177ba61b5b8bbd7fadcbefe4bb19d42d","unresolved":false,"context_lines":[{"line_number":386,"context_line":""},{"line_number":387,"context_line":"        # NOTE(changzhi): RuntimeError will happen when dnsmasq_config_file"},{"line_number":388,"context_line":"        # doesn\u0027t exist."},{"line_number":389,"context_line":"        if os.path.exists(self.conf.dnsmasq_config_file):"},{"line_number":390,"context_line":"            cmd.append(\u0027--conf-file\u003d%s\u0027 % self.conf.dnsmasq_config_file)"},{"line_number":391,"context_line":"        else:"},{"line_number":392,"context_line":"            cmd.append(\u0027--conf-file\u003d\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a57f1b5_1d401256","line":389,"range":{"start_line":389,"start_character":11,"end_line":389,"end_character":25},"updated":"2016-02-10 03:16:10.000000000","message":"dnsmasq_config_file should be a file, what about using \"os.path.isfile\"","commit_id":"10e51f0e9e097ac2fae1c5e814088234b206e6b0"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"ff58414c2a45e844ebd503931e8ced6b4522e5f7","unresolved":false,"context_lines":[{"line_number":386,"context_line":""},{"line_number":387,"context_line":"        # NOTE(changzhi): RuntimeError will happen when dnsmasq_config_file"},{"line_number":388,"context_line":"        # doesn\u0027t exist."},{"line_number":389,"context_line":"        if os.path.exists(self.conf.dnsmasq_config_file):"},{"line_number":390,"context_line":"            cmd.append(\u0027--conf-file\u003d%s\u0027 % self.conf.dnsmasq_config_file)"},{"line_number":391,"context_line":"        else:"},{"line_number":392,"context_line":"            cmd.append(\u0027--conf-file\u003d\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a57f1b5_9255bdc7","line":389,"range":{"start_line":389,"start_character":11,"end_line":389,"end_character":25},"in_reply_to":"3a57f1b5_1d401256","updated":"2016-02-10 11:25:17.000000000","message":"+1 for os.path.isfile.\n\nhttp://stackoverflow.com/questions/17752078/difference-between-os-path-exists-and-os-path-isfile-in-python","commit_id":"10e51f0e9e097ac2fae1c5e814088234b206e6b0"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"fe2c411600a76363bc83ac1208b20d784d4f64db","unresolved":false,"context_lines":[{"line_number":386,"context_line":""},{"line_number":387,"context_line":"        # NOTE(changzhi): RuntimeError will happen when dnsmasq_config_file"},{"line_number":388,"context_line":"        # doesn\u0027t exist."},{"line_number":389,"context_line":"        if os.path.isfile(self.conf.dnsmasq_config_file):"},{"line_number":390,"context_line":"            cmd.append(\u0027--conf-file\u003d%s\u0027 % self.conf.dnsmasq_config_file)"},{"line_number":391,"context_line":"        else:"},{"line_number":392,"context_line":"            cmd.append(\u0027--conf-file\u003d\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a57f1b5_f7fa94bc","line":389,"updated":"2016-02-11 14:21:55.000000000","message":"I think we want this to be a fatal error if someone has specified a configuration file. Otherwise we are silently ignoring configuration which makes things hard to troubleshoot.","commit_id":"2d45ded4436051c29da6dd9e1ffee0e54b1fec68"},{"author":{"_account_id":14562,"name":"Zhi Chang","email":"changzhi2@lenovo.com","username":"changzhi"},"change_message_id":"d470e0f58ae2036cc3eb545a8d26a72b139425a1","unresolved":false,"context_lines":[{"line_number":386,"context_line":""},{"line_number":387,"context_line":"        # NOTE(changzhi): RuntimeError will happen when dnsmasq_config_file"},{"line_number":388,"context_line":"        # doesn\u0027t exist."},{"line_number":389,"context_line":"        if os.path.isfile(self.conf.dnsmasq_config_file):"},{"line_number":390,"context_line":"            cmd.append(\u0027--conf-file\u003d%s\u0027 % self.conf.dnsmasq_config_file)"},{"line_number":391,"context_line":"        else:"},{"line_number":392,"context_line":"            cmd.append(\u0027--conf-file\u003d\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a57f1b5_80473c76","line":389,"in_reply_to":"3a57f1b5_f7fa94bc","updated":"2016-02-12 01:25:27.000000000","message":"okay. So, what about your advice? Do we log error message here?","commit_id":"2d45ded4436051c29da6dd9e1ffee0e54b1fec68"}],"neutron/tests/unit/agent/linux/test_dhcp.py":[{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"73388008177ba61b5b8bbd7fadcbefe4bb19d42d","unresolved":false,"context_lines":[{"line_number":1092,"context_line":"        self._test_spawn([\u0027--conf-file\u003d\u0027, \u0027--domain\u003dopenstacklocal\u0027],"},{"line_number":1093,"context_line":"                         FakeDualNetwork(), 16777216, -1)"},{"line_number":1094,"context_line":""},{"line_number":1095,"context_line":"    def test_spawn_cfg_config_file(self):"},{"line_number":1096,"context_line":"        self.conf.set_override(\u0027dnsmasq_config_file\u0027, \u0027/foo\u0027)"},{"line_number":1097,"context_line":"        exists \u003d lambda path: path \u003d\u003d \"/foo\""},{"line_number":1098,"context_line":"        with mock.patch(\u0027os.path.exists\u0027, side_effect\u003dexists):"},{"line_number":1099,"context_line":"            self._test_spawn([\u0027--conf-file\u003d/foo\u0027, \u0027--domain\u003dopenstacklocal\u0027])"},{"line_number":1100,"context_line":""},{"line_number":1101,"context_line":"    def test_spawn_no_dhcp_domain(self):"},{"line_number":1102,"context_line":"        (exp_host_name, exp_host_data,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a57f1b5_a03195ee","line":1099,"range":{"start_line":1095,"start_character":0,"end_line":1099,"end_character":77},"updated":"2016-02-10 03:16:10.000000000","message":"To have a more comprehensive test, the test should be both sides. So I would suggest to add an UT to test the config_file not exist.","commit_id":"10e51f0e9e097ac2fae1c5e814088234b206e6b0"},{"author":{"_account_id":14562,"name":"Zhi Chang","email":"changzhi2@lenovo.com","username":"changzhi"},"change_message_id":"b623b9df7f14d0e4fa38ae0c302066193b4fc402","unresolved":false,"context_lines":[{"line_number":1092,"context_line":"        self._test_spawn([\u0027--conf-file\u003d\u0027, \u0027--domain\u003dopenstacklocal\u0027],"},{"line_number":1093,"context_line":"                         FakeDualNetwork(), 16777216, -1)"},{"line_number":1094,"context_line":""},{"line_number":1095,"context_line":"    def test_spawn_cfg_config_file(self):"},{"line_number":1096,"context_line":"        self.conf.set_override(\u0027dnsmasq_config_file\u0027, \u0027/foo\u0027)"},{"line_number":1097,"context_line":"        exists \u003d lambda path: path \u003d\u003d \"/foo\""},{"line_number":1098,"context_line":"        with mock.patch(\u0027os.path.exists\u0027, side_effect\u003dexists):"},{"line_number":1099,"context_line":"            self._test_spawn([\u0027--conf-file\u003d/foo\u0027, \u0027--domain\u003dopenstacklocal\u0027])"},{"line_number":1100,"context_line":""},{"line_number":1101,"context_line":"    def test_spawn_no_dhcp_domain(self):"},{"line_number":1102,"context_line":"        (exp_host_name, exp_host_data,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a57f1b5_fa55e3c5","line":1099,"range":{"start_line":1095,"start_character":0,"end_line":1099,"end_character":77},"in_reply_to":"3a57f1b5_a03195ee","updated":"2016-02-10 13:37:15.000000000","message":"I agree with you. But I think this function \"test_spawn_cfg_config_file\" should be rewritten, just like my changes. Because the origin logic will happen exception if I change the code in \"agent/linux/dhcp.py\".  \nFor your second advice that add an UT to test the config_file not exist. Could you give me an example? Thanks.","commit_id":"10e51f0e9e097ac2fae1c5e814088234b206e6b0"}]}
