)]}'
{"neutron/agent/l3/ha.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"2a95f357417ff85c52a267658ddb32da37b5547e","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from oslo_config import cfg"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from neutron.common import constants as l3_constants"},{"line_number":21,"context_line":"from neutron.common import utils"},{"line_number":22,"context_line":"from neutron.i18n import _LE"},{"line_number":23,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":24,"context_line":"from neutron.openstack.common import periodic_task"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_b02d7eaa","line":21,"updated":"2015-02-12 07:08:58.000000000","message":"wrong utils?","commit_id":"408bd9c48a3bde95df7561030b991431a3f4b5f1"}],"neutron/agent/linux/dhcp.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"fcdc7c9be5d861c06e79f4a0c14cbee9d4c88a5d","unresolved":false,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _ensure_network_conf_dir(self):"},{"line_number":185,"context_line":"        \"\"\"Ensures the directory for configuration files is created.\"\"\""},{"line_number":186,"context_line":"        utils.ensure_dir(self.network_conf_dir)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def _remove_config_files(self):"},{"line_number":189,"context_line":"        shutil.rmtree(self.network_conf_dir, ignore_errors\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_770485c6","line":186,"updated":"2015-02-27 10:11:26.000000000","message":"Now we call ensure_dir in ensure_dir :-(\nIt looks too redundant.","commit_id":"94f8631b31cf8cdfd79fbc7c18f5aea27c945136"},{"author":{"_account_id":12524,"name":"Zengfa Gao","email":"zengfa.gao@hp.com","username":"zengfagao"},"change_message_id":"04488aad571449836a844317bde8706069a6df57","unresolved":false,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _ensure_network_conf_dir(self):"},{"line_number":185,"context_line":"        \"\"\"Ensures the directory for configuration files is created.\"\"\""},{"line_number":186,"context_line":"        utils.ensure_dir(self.network_conf_dir)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def _remove_config_files(self):"},{"line_number":189,"context_line":"        shutil.rmtree(self.network_conf_dir, ignore_errors\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_6d037fb8","line":186,"in_reply_to":"ba7be1f8_3395b688","updated":"2015-03-02 17:25:34.000000000","message":"Done","commit_id":"94f8631b31cf8cdfd79fbc7c18f5aea27c945136"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b5260fd0595c969db6b0e487ead625c7a3dcff3b","unresolved":false,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _ensure_network_conf_dir(self):"},{"line_number":185,"context_line":"        \"\"\"Ensures the directory for configuration files is created.\"\"\""},{"line_number":186,"context_line":"        utils.ensure_dir(self.network_conf_dir)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def _remove_config_files(self):"},{"line_number":189,"context_line":"        shutil.rmtree(self.network_conf_dir, ignore_errors\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_3395b688","line":186,"in_reply_to":"ba7be1f8_770485c6","updated":"2015-02-27 12:58:32.000000000","message":"Right, this method should be removed.","commit_id":"94f8631b31cf8cdfd79fbc7c18f5aea27c945136"}],"neutron/agent/metadata/agent.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a0fe9fe391986b8ca5f1c7bbe742def5c1665cbd","unresolved":false,"context_lines":[{"line_number":309,"context_line":"    def __init__(self, conf):"},{"line_number":310,"context_line":"        self.conf \u003d conf"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"        dirname \u003d os.path.dirname(cfg.CONF.metadata_proxy_socket)"},{"line_number":313,"context_line":"        if os.path.isdir(dirname):"},{"line_number":314,"context_line":"            try:"},{"line_number":315,"context_line":"                os.unlink(cfg.CONF.metadata_proxy_socket)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_f51448a1","line":312,"updated":"2015-02-12 06:01:43.000000000","message":"Let\u0027s shorten this up since we are here. Remove the conditional and just call utils.ensure_dir in its place.","commit_id":"ca3e7c1cff8fdbdddb5d4e0647a10ecb01523cac"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b5260fd0595c969db6b0e487ead625c7a3dcff3b","unresolved":false,"context_lines":[{"line_number":311,"context_line":"        self.conf \u003d conf"},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"        dirname \u003d os.path.dirname(cfg.CONF.metadata_proxy_socket)"},{"line_number":314,"context_line":"        if os.path.isdir(dirname):"},{"line_number":315,"context_line":"            try:"},{"line_number":316,"context_line":"                os.unlink(cfg.CONF.metadata_proxy_socket)"},{"line_number":317,"context_line":"            except OSError:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_33c3f68b","line":314,"updated":"2015-02-27 12:58:32.000000000","message":"I think isdir call is redundant.","commit_id":"94f8631b31cf8cdfd79fbc7c18f5aea27c945136"},{"author":{"_account_id":12524,"name":"Zengfa Gao","email":"zengfa.gao@hp.com","username":"zengfagao"},"change_message_id":"04488aad571449836a844317bde8706069a6df57","unresolved":false,"context_lines":[{"line_number":311,"context_line":"        self.conf \u003d conf"},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"        dirname \u003d os.path.dirname(cfg.CONF.metadata_proxy_socket)"},{"line_number":314,"context_line":"        if os.path.isdir(dirname):"},{"line_number":315,"context_line":"            try:"},{"line_number":316,"context_line":"                os.unlink(cfg.CONF.metadata_proxy_socket)"},{"line_number":317,"context_line":"            except OSError:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_cd08ebdb","line":314,"in_reply_to":"ba7be1f8_33c3f68b","updated":"2015-03-02 17:25:34.000000000","message":"I think we still need to chedk if path exist to unlink.\nelse block ensure_dir method will call os.path.isdir again, is redudant. But we should put all makedirs with 0o755 in the same utils class.","commit_id":"94f8631b31cf8cdfd79fbc7c18f5aea27c945136"}],"neutron/tests/unit/agent/linux/test_utils.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"01d1076f9353a1866c4ae1d624050eda2d2fda3c","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    def test_ensure_dir(self):"},{"line_number":209,"context_line":"        with mock.patch(\u0027os.path.isdir\u0027) as isdir:"},{"line_number":210,"context_line":"            with mock.patch(\u0027os.makedirs\u0027) as makedirs:"},{"line_number":211,"context_line":"                isdir.return_value \u003d False"},{"line_number":212,"context_line":"                utils.ensure_dir(\u0027/the\u0027)"},{"line_number":213,"context_line":"                isdir.assert_called_once_with(\u0027/the\u0027)"},{"line_number":214,"context_line":"                makedirs.assert_called_once_with(\u0027/the\u0027, 0o755)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_3171cba8","line":211,"updated":"2015-02-11 03:49:26.000000000","message":"nit: you can move this line up into the mock, for example:\n\n    with mock.patch(\u0027os.path.isdir\u0027, return_value\u003dFalse) as isdir:","commit_id":"e69b533f720d8fb4a59153b9bf3d0ae7601929b3"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"01d1076f9353a1866c4ae1d624050eda2d2fda3c","unresolved":false,"context_lines":[{"line_number":211,"context_line":"                isdir.return_value \u003d False"},{"line_number":212,"context_line":"                utils.ensure_dir(\u0027/the\u0027)"},{"line_number":213,"context_line":"                isdir.assert_called_once_with(\u0027/the\u0027)"},{"line_number":214,"context_line":"                makedirs.assert_called_once_with(\u0027/the\u0027, 0o755)"},{"line_number":215,"context_line":"        with mock.patch(\u0027os.path.isdir\u0027) as isdir:"},{"line_number":216,"context_line":"            with mock.patch(\u0027os.makedirs\u0027) as makedirs:"},{"line_number":217,"context_line":"                isdir.return_value \u003d True"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_f1ef331c","line":214,"updated":"2015-02-11 03:49:26.000000000","message":"I would end this test here and put the below in a new one.","commit_id":"e69b533f720d8fb4a59153b9bf3d0ae7601929b3"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"01d1076f9353a1866c4ae1d624050eda2d2fda3c","unresolved":false,"context_lines":[{"line_number":214,"context_line":"                makedirs.assert_called_once_with(\u0027/the\u0027, 0o755)"},{"line_number":215,"context_line":"        with mock.patch(\u0027os.path.isdir\u0027) as isdir:"},{"line_number":216,"context_line":"            with mock.patch(\u0027os.makedirs\u0027) as makedirs:"},{"line_number":217,"context_line":"                isdir.return_value \u003d True"},{"line_number":218,"context_line":"                utils.ensure_dir(\u0027/the\u0027)"},{"line_number":219,"context_line":"                isdir.assert_called_once_with(\u0027/the\u0027)"},{"line_number":220,"context_line":"                self.assertFalse(makedirs.called)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_7166e3ee","line":217,"updated":"2015-02-11 03:49:26.000000000","message":"This one too","commit_id":"e69b533f720d8fb4a59153b9bf3d0ae7601929b3"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"3793094ce446c845e92e0fec9bee9e71ac606817","unresolved":false,"context_lines":[{"line_number":206,"context_line":""},{"line_number":207,"context_line":"class TestBaseOSUtils(base.BaseTestCase):"},{"line_number":208,"context_line":"    def test_ensure_dir_not_exist(self):"},{"line_number":209,"context_line":"        with mock.patch(\u0027os.path.isdir\u0027, return_value\u003dFalse) as isdir:"},{"line_number":210,"context_line":"            with mock.patch(\u0027os.makedirs\u0027) as makedirs:"},{"line_number":211,"context_line":"                utils.ensure_dir(\u0027/the\u0027)"},{"line_number":212,"context_line":"                isdir.assert_called_once_with(\u0027/the\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_92133964","line":209,"updated":"2015-02-18 17:00:37.000000000","message":"Prefer mock.patch.object if it can be used here.  I think it would go something like this:\n\n  from os import path\n  ...\n  with mock.patch.object(path, \u0027isdir\u0027, return_value\u003dTrue) as isdir:\n\nThis is more important when you\u0027re mocking stuff from the project where source code might get reorganized and module names may change.","commit_id":"7bdb341d17aa80601fb66b5e26cf834e292e98d7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"3793094ce446c845e92e0fec9bee9e71ac606817","unresolved":false,"context_lines":[{"line_number":213,"context_line":"                makedirs.assert_called_once_with(\u0027/the\u0027, 0o755)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def test_ensure_dir_exist(self):"},{"line_number":216,"context_line":"        with mock.patch(\u0027os.path.isdir\u0027, return_value\u003dTrue) as isdir:"},{"line_number":217,"context_line":"            with mock.patch(\u0027os.makedirs\u0027) as makedirs:"},{"line_number":218,"context_line":"                utils.ensure_dir(\u0027/the\u0027)"},{"line_number":219,"context_line":"                isdir.assert_called_once_with(\u0027/the\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_2d8f8c24","line":216,"updated":"2015-02-18 17:00:37.000000000","message":"nit:  I personally prefer the decorator versions of patch if the entire method can be under the patch.  It makes it more clear up front what the context of the test is and it reduces the amount of indentation:\n\nI think it would go something like this:\n\n  @mock.patch.object(path, \u0027is_dir\u0027, return_value\u003dTrue)\n  @mock.patch.object(os, \u0027makedirs\u0027)\n  def test_ensure_dir_exist(self, makedirs, isdir):\n      utils.ensure_dir(...)\n      ...","commit_id":"7bdb341d17aa80601fb66b5e26cf834e292e98d7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"3793094ce446c845e92e0fec9bee9e71ac606817","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                isdir.assert_called_once_with(\u0027/the\u0027)"},{"line_number":220,"context_line":"                self.assertFalse(makedirs.called)"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    def test_get_conf_file(self):"},{"line_number":223,"context_line":"        uuid \u003d str(uuidutils.generate_uuid)"},{"line_number":224,"context_line":"        cfg_root \u003d \u0027/etc/neutron\u0027"},{"line_number":225,"context_line":"        config_file \u003d \u0027conf\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_ad67fce8","line":222,"updated":"2015-02-18 17:00:37.000000000","message":"This new test doesn\u0027t relate to this patch as far as I can tell.  Keep patches as focused as possible.  Remove this test from this patch.","commit_id":"7bdb341d17aa80601fb66b5e26cf834e292e98d7"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"fcdc7c9be5d861c06e79f4a0c14cbee9d4c88a5d","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":"import mock"},{"line_number":15,"context_line":"import os"},{"line_number":16,"context_line":"import testtools"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.agent.linux import utils"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_57c4e15e","line":15,"updated":"2015-02-27 10:11:26.000000000","message":"\"os\" is a standard module.","commit_id":"94f8631b31cf8cdfd79fbc7c18f5aea27c945136"},{"author":{"_account_id":12524,"name":"Zengfa Gao","email":"zengfa.gao@hp.com","username":"zengfagao"},"change_message_id":"04488aad571449836a844317bde8706069a6df57","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":"import mock"},{"line_number":15,"context_line":"import os"},{"line_number":16,"context_line":"import testtools"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.agent.linux import utils"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_ed0ccf96","line":15,"in_reply_to":"ba7be1f8_53478a1d","updated":"2015-03-02 17:25:34.000000000","message":"Done","commit_id":"94f8631b31cf8cdfd79fbc7c18f5aea27c945136"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b5260fd0595c969db6b0e487ead625c7a3dcff3b","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":"import mock"},{"line_number":15,"context_line":"import os"},{"line_number":16,"context_line":"import testtools"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.agent.linux import utils"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_53478a1d","line":15,"in_reply_to":"ba7be1f8_57c4e15e","updated":"2015-02-27 12:58:32.000000000","message":"to make it clear, we split imports into categories, and stdlib imports (like os) should go the first and separated from mock import.","commit_id":"94f8631b31cf8cdfd79fbc7c18f5aea27c945136"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"4bd8b2905c62252ae55a74b448e3e240d793430a","unresolved":false,"context_lines":[{"line_number":212,"context_line":"    @mock.patch.object(os, \u0027makedirs\u0027)"},{"line_number":213,"context_line":"    def test_ensure_dir_not_exist(self, makedirs, isdir):"},{"line_number":214,"context_line":"        utils.ensure_dir(\u0027/the\u0027)"},{"line_number":215,"context_line":"        isdir.assert_called_once_with(\u0027/the\u0027)"},{"line_number":216,"context_line":"        makedirs.assert_called_once_with(\u0027/the\u0027, 0o755)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    @mock.patch.object(os.path, \u0027isdir\u0027, return_value\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a80dd14_c68ca038","line":215,"updated":"2015-03-11 03:22:02.000000000","message":"there seems to be favor not to check implementation details like this.\nhttps://review.openstack.org/#/c/159821/","commit_id":"3bf97256d0882a63f23e661073582bbd4a13300b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"5923700bbf2f50ab49e398a6e245b976ab02636f","unresolved":false,"context_lines":[{"line_number":212,"context_line":"    @mock.patch.object(os, \u0027makedirs\u0027)"},{"line_number":213,"context_line":"    def test_ensure_dir_not_exist(self, makedirs, isdir):"},{"line_number":214,"context_line":"        utils.ensure_dir(\u0027/the\u0027)"},{"line_number":215,"context_line":"        isdir.assert_called_once_with(\u0027/the\u0027)"},{"line_number":216,"context_line":"        makedirs.assert_called_once_with(\u0027/the\u0027, 0o755)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    @mock.patch.object(os.path, \u0027isdir\u0027, return_value\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a80dd14_96872912","line":215,"in_reply_to":"9a80dd14_606bcf85","updated":"2015-03-11 10:49:01.000000000","message":"do you guys think it should be a blocker?","commit_id":"3bf97256d0882a63f23e661073582bbd4a13300b"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"731cefd61949b7dfda9ff42ee6629b6134e92155","unresolved":false,"context_lines":[{"line_number":212,"context_line":"    @mock.patch.object(os, \u0027makedirs\u0027)"},{"line_number":213,"context_line":"    def test_ensure_dir_not_exist(self, makedirs, isdir):"},{"line_number":214,"context_line":"        utils.ensure_dir(\u0027/the\u0027)"},{"line_number":215,"context_line":"        isdir.assert_called_once_with(\u0027/the\u0027)"},{"line_number":216,"context_line":"        makedirs.assert_called_once_with(\u0027/the\u0027, 0o755)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    @mock.patch.object(os.path, \u0027isdir\u0027, return_value\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a80dd14_606bcf85","line":215,"in_reply_to":"9a80dd14_c68ca038","updated":"2015-03-11 10:12:28.000000000","message":"Right. makedirs check should be enough.","commit_id":"3bf97256d0882a63f23e661073582bbd4a13300b"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"4bd8b2905c62252ae55a74b448e3e240d793430a","unresolved":false,"context_lines":[{"line_number":219,"context_line":"    @mock.patch.object(os, \u0027makedirs\u0027)"},{"line_number":220,"context_line":"    def test_ensure_dir_exist(self, makedirs, isdir):"},{"line_number":221,"context_line":"        utils.ensure_dir(\u0027/the\u0027)"},{"line_number":222,"context_line":"        isdir.assert_called_once_with(\u0027/the\u0027)"},{"line_number":223,"context_line":"        self.assertFalse(makedirs.called)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a80dd14_4678b02b","line":222,"updated":"2015-03-11 03:22:02.000000000","message":"ditto","commit_id":"3bf97256d0882a63f23e661073582bbd4a13300b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"59deb4cb8d01621d45f972a56cf1132d6b2fe519","unresolved":false,"context_lines":[{"line_number":212,"context_line":"    @mock.patch.object(os, \u0027makedirs\u0027)"},{"line_number":213,"context_line":"    def test_ensure_dir_not_exist(self, makedirs, isdir):"},{"line_number":214,"context_line":"        utils.ensure_dir(\u0027/the\u0027)"},{"line_number":215,"context_line":"        isdir.assert_called_once_with(\u0027/the\u0027)"},{"line_number":216,"context_line":"        makedirs.assert_called_once_with(\u0027/the\u0027, 0o755)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    @mock.patch.object(os.path, \u0027isdir\u0027, return_value\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a80dd14_5124a8ae","line":215,"updated":"2015-03-12 08:04:21.000000000","message":"this was removed in ps 14, now back, did the removal cause test failures? :)","commit_id":"eba4c2941ee60409d5e481347d9a856947dbf216"}],"neutron/tests/unit/test_l3_agent.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"3793094ce446c845e92e0fec9bee9e71ac606817","unresolved":false,"context_lines":[{"line_number":302,"context_line":"    def test_init_ha_conf(self):"},{"line_number":303,"context_line":"        with mock.patch(\u0027os.path.dirname\u0027, return_value\u003d\u0027/etc/ha/\u0027) as dirname:"},{"line_number":304,"context_line":"            l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":305,"context_line":"            dirname.called_once()"},{"line_number":306,"context_line":"            self.ensure_dir.assert_called_once_with(\u0027/etc/ha/\u0027)"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    def test_periodic_sync_routers_task_raise_exception(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_12f58950","line":305,"updated":"2015-02-18 17:00:37.000000000","message":"I don\u0027t think .called_once() does what you think it does.  I think this call is meaningless.  Be wary of any check that appears to pass.  I like to ensure, while I\u0027m coding a test, that I see an assertion fail at least once by breaking the code manually to cause the failure that I\u0027m trying to check for.\n\n  \u003e\u003e\u003e import mock\n  \u003e\u003e\u003e mock.Mock().called_once()\n  \u003cMock name\u003d\u0027mock.called_once()\u0027 id\u003d\u002727792272\u0027\u003e\n\nSee, this just calls a mock method that happily returns a mock object and there is no possibility of failure.","commit_id":"7bdb341d17aa80601fb66b5e26cf834e292e98d7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"aa52837d575d620d623088afdca43da927da8ce5","unresolved":false,"context_lines":[{"line_number":305,"context_line":""},{"line_number":306,"context_line":"class TestBasicRouterOperations(BasicRouterOperationsFramework):"},{"line_number":307,"context_line":"    def test_init_ha_conf(self):"},{"line_number":308,"context_line":"        with mock.patch(\u0027os.path.dirname\u0027, return_value\u003d\u0027/etc/ha/\u0027):"},{"line_number":309,"context_line":"            l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":310,"context_line":"            self.ensure_dir.assert_called_once_with(\u0027/etc/ha/\u0027)"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_9cdae776","line":308,"updated":"2015-02-20 23:45:10.000000000","message":"nit:  I prefer mock.patch.object here too with a decorator.","commit_id":"94f8631b31cf8cdfd79fbc7c18f5aea27c945136"},{"author":{"_account_id":12524,"name":"Zengfa Gao","email":"zengfa.gao@hp.com","username":"zengfagao"},"change_message_id":"cc78cc77dd903f642f4ee6a4745ab57211328dd9","unresolved":false,"context_lines":[{"line_number":305,"context_line":""},{"line_number":306,"context_line":"class TestBasicRouterOperations(BasicRouterOperationsFramework):"},{"line_number":307,"context_line":"    def test_init_ha_conf(self):"},{"line_number":308,"context_line":"        with mock.patch(\u0027os.path.dirname\u0027, return_value\u003d\u0027/etc/ha/\u0027):"},{"line_number":309,"context_line":"            l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":310,"context_line":"            self.ensure_dir.assert_called_once_with(\u0027/etc/ha/\u0027)"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_bfbebdfd","line":308,"in_reply_to":"ba7be1f8_9cdae776","updated":"2015-02-21 00:31:14.000000000","message":"Done","commit_id":"94f8631b31cf8cdfd79fbc7c18f5aea27c945136"}],"neutron/tests/unit/test_linux_external_process.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"6dcf0e8f6d3f91f21236678bf90eb4b137080c05","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        self.execute \u003d self.execute_p.start()"},{"line_number":28,"context_line":"        self.delete_if_exists \u003d mock.patch("},{"line_number":29,"context_line":"            \u0027neutron.openstack.common.fileutils.delete_if_exists\u0027).start()"},{"line_number":30,"context_line":"        self.makedirs \u003d mock.patch(\u0027os.makedirs\u0027).start()"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        self.conf \u003d mock.Mock()"},{"line_number":33,"context_line":"        self.conf.external_pids \u003d \u0027/var/path\u0027"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a80dd14_ca538c6a","line":30,"updated":"2015-03-12 02:03:06.000000000","message":"This line is no longer required, surprised pylint didn\u0027t catch it.","commit_id":"509c929417550db7fe100a489d31c61e6bdc1d76"}],"neutron/tests/unit/test_metadata_agent.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"3793094ce446c845e92e0fec9bee9e71ac606817","unresolved":false,"context_lines":[{"line_number":617,"context_line":"        with mock.patch.object(agent, \u0027MetadataProxyHandler\u0027) as handler:"},{"line_number":618,"context_line":"            with mock.patch.object(agent, \u0027UnixDomainWSGIServer\u0027) as server:"},{"line_number":619,"context_line":"                with mock.patch(\u0027os.path.isdir\u0027) as isdir:"},{"line_number":620,"context_line":"                    with mock.patch(\u0027os.makedirs\u0027) as makedirs:"},{"line_number":621,"context_line":"                        isdir.return_value \u003d False"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":"                        p \u003d agent.UnixDomainMetadataProxy(self.cfg.CONF)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_0d4728a4","side":"PARENT","line":620,"updated":"2015-02-18 17:00:37.000000000","message":"Commentary:  Yuck!  Four levels of mock indentation.  If you\u0027re going to change this whole method, change it to use a mock.patch decorator.","commit_id":"072378eeb9d8b5f7ccba508bd4e25a1cc74e4e39"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"3793094ce446c845e92e0fec9bee9e71ac606817","unresolved":false,"context_lines":[{"line_number":612,"context_line":"    def test_run(self):"},{"line_number":613,"context_line":"        with mock.patch.object(agent, \u0027MetadataProxyHandler\u0027) as handler:"},{"line_number":614,"context_line":"            with mock.patch.object(agent, \u0027UnixDomainWSGIServer\u0027) as server:"},{"line_number":615,"context_line":"                with mock.patch(\u0027neutron.agent.linux.utils.ensure_dir\u0027)\\"},{"line_number":616,"context_line":"                    as ensure_dir:"},{"line_number":617,"context_line":"                    p \u003d agent.UnixDomainMetadataProxy(self.cfg.CONF)"},{"line_number":618,"context_line":"                    p.run()"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_08b2b648","line":615,"updated":"2015-02-18 17:00:37.000000000","message":"We don\u0027t continue lines with a \\","commit_id":"7bdb341d17aa80601fb66b5e26cf834e292e98d7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"6a1e33003ddb2f2694b637659b7b5d28ad8052f4","unresolved":false,"context_lines":[{"line_number":568,"context_line":"        self.cfg.CONF.metadata_backlog \u003d 128"},{"line_number":569,"context_line":""},{"line_number":570,"context_line":"    def test_init_doesnot_exists(self):"},{"line_number":571,"context_line":"        with mock.patch(\u0027neutron.agent.linux.utils.ensure_dir\u0027) as ensure_dir:"},{"line_number":572,"context_line":"            agent.UnixDomainMetadataProxy(mock.Mock())"},{"line_number":573,"context_line":"            ensure_dir.assert_called_once_with(\u0027/the\u0027)"},{"line_number":574,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_1fa71251","line":571,"updated":"2015-02-19 22:00:01.000000000","message":"nit: use patch object, same as you did at line 615","commit_id":"c4768858fd6664fdb1c2d962f8312ebaec9051bb"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"aa52837d575d620d623088afdca43da927da8ce5","unresolved":false,"context_lines":[{"line_number":612,"context_line":""},{"line_number":613,"context_line":"    @mock.patch.object(agent, \u0027MetadataProxyHandler\u0027)"},{"line_number":614,"context_line":"    @mock.patch.object(agent, \u0027UnixDomainWSGIServer\u0027)"},{"line_number":615,"context_line":"    @mock.patch.object(linux_utils, \u0027ensure_dir\u0027)"},{"line_number":616,"context_line":"    def test_run(self, ensure_dir, server, handler):"},{"line_number":617,"context_line":"        p \u003d agent.UnixDomainMetadataProxy(self.cfg.CONF)"},{"line_number":618,"context_line":"        p.run()"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_7cc45392","line":615,"updated":"2015-02-20 23:45:10.000000000","message":"I do very much like how this turned out compared to PS6.","commit_id":"94f8631b31cf8cdfd79fbc7c18f5aea27c945136"},{"author":{"_account_id":12524,"name":"Zengfa Gao","email":"zengfa.gao@hp.com","username":"zengfagao"},"change_message_id":"cc78cc77dd903f642f4ee6a4745ab57211328dd9","unresolved":false,"context_lines":[{"line_number":612,"context_line":""},{"line_number":613,"context_line":"    @mock.patch.object(agent, \u0027MetadataProxyHandler\u0027)"},{"line_number":614,"context_line":"    @mock.patch.object(agent, \u0027UnixDomainWSGIServer\u0027)"},{"line_number":615,"context_line":"    @mock.patch.object(linux_utils, \u0027ensure_dir\u0027)"},{"line_number":616,"context_line":"    def test_run(self, ensure_dir, server, handler):"},{"line_number":617,"context_line":"        p \u003d agent.UnixDomainMetadataProxy(self.cfg.CONF)"},{"line_number":618,"context_line":"        p.run()"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_df5291dc","line":615,"in_reply_to":"ba7be1f8_7cc45392","updated":"2015-02-21 00:31:14.000000000","message":"Thanks","commit_id":"94f8631b31cf8cdfd79fbc7c18f5aea27c945136"}]}
