)]}'
{"ironic_python_agent/tests/unit/base.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"1ae761f67a03ce2e5c1b997a0add0bde7011988a","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        \"\"\"Add a blanket ban on running external processes via utils.execute()."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        `self` will grow a property  called _exec_patch which is the Mock"},{"line_number":39,"context_line":"        that replaces utils.execute."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        If the mock is called, an exception is raised to warn the tester."},{"line_number":42,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_bc3ea3d7","line":39,"updated":"2017-10-23 13:48:26.000000000","message":"should probably update this.","commit_id":"4027f2ea692420b3d15b89380050ae55aeec9642"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"caf760d557581e84b5607b886955d044f2a43ff9","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        \"\"\"Add a blanket ban on running external processes via utils.execute()."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        `self` will grow a property  called _exec_patch which is the Mock"},{"line_number":39,"context_line":"        that replaces utils.execute."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        If the mock is called, an exception is raised to warn the tester."},{"line_number":42,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_3ff4e285","line":39,"in_reply_to":"3f4b6375_bc3ea3d7","updated":"2017-10-23 15:41:23.000000000","message":"Done","commit_id":"4027f2ea692420b3d15b89380050ae55aeec9642"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"1ae761f67a03ce2e5c1b997a0add0bde7011988a","unresolved":false,"context_lines":[{"line_number":47,"context_line":"            self._exec_patch \u003d mock.Mock()"},{"line_number":48,"context_line":"            self._exec_patch.side_effect \u003d Exception("},{"line_number":49,"context_line":"                \"Don\u0027t call ironic_lib.utils.execute() / \""},{"line_number":50,"context_line":"                \"processutils.execute() or similar functions in tests!\")"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"            # NOTE(jlvillal): pyudev.Context() calls ctypes.find_library()"},{"line_number":53,"context_line":"            # which calls subprocess.Popen(). So not blocking"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_fc1d3b73","line":50,"updated":"2017-10-23 13:48:26.000000000","message":"nit, maybe s/similar functions/similar external processes/ ?","commit_id":"4027f2ea692420b3d15b89380050ae55aeec9642"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"caf760d557581e84b5607b886955d044f2a43ff9","unresolved":false,"context_lines":[{"line_number":47,"context_line":"            self._exec_patch \u003d mock.Mock()"},{"line_number":48,"context_line":"            self._exec_patch.side_effect \u003d Exception("},{"line_number":49,"context_line":"                \"Don\u0027t call ironic_lib.utils.execute() / \""},{"line_number":50,"context_line":"                \"processutils.execute() or similar functions in tests!\")"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"            # NOTE(jlvillal): pyudev.Context() calls ctypes.find_library()"},{"line_number":53,"context_line":"            # which calls subprocess.Popen(). So not blocking"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_ff064a86","line":50,"in_reply_to":"3f4b6375_fc1d3b73","updated":"2017-10-23 15:41:23.000000000","message":"I personally like functions, since it is a function call we are catching.","commit_id":"4027f2ea692420b3d15b89380050ae55aeec9642"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"1ae761f67a03ce2e5c1b997a0add0bde7011988a","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            # NOTE(jlvillal): pyudev.Context() calls ctypes.find_library()"},{"line_number":53,"context_line":"            # which calls subprocess.Popen(). So not blocking"},{"line_number":54,"context_line":"            # subprocess.Popen()"},{"line_number":55,"context_line":"            self.patch(processutils, \u0027execute\u0027, self._exec_patch)"},{"line_number":56,"context_line":"            self.patch(subprocess, \u0027call\u0027, self._exec_patch)"},{"line_number":57,"context_line":"            self.patch(subprocess, \u0027check_call\u0027, self._exec_patch)"},{"line_number":58,"context_line":"            self.patch(subprocess, \u0027check_output\u0027, self._exec_patch)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_77e28403","line":55,"updated":"2017-10-23 13:48:26.000000000","message":"I\u0027m not totally sure, but I don\u0027t think that processutils.execute() is called in ipa. It looks to me like utils.execute() calls ironic_lib.execute() which calls processutils.execute(). If that\u0027s the case, then shouldn\u0027t we also mock ironic_lib.execute()?","commit_id":"4027f2ea692420b3d15b89380050ae55aeec9642"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"caf760d557581e84b5607b886955d044f2a43ff9","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            # NOTE(jlvillal): pyudev.Context() calls ctypes.find_library()"},{"line_number":53,"context_line":"            # which calls subprocess.Popen(). So not blocking"},{"line_number":54,"context_line":"            # subprocess.Popen()"},{"line_number":55,"context_line":"            self.patch(processutils, \u0027execute\u0027, self._exec_patch)"},{"line_number":56,"context_line":"            self.patch(subprocess, \u0027call\u0027, self._exec_patch)"},{"line_number":57,"context_line":"            self.patch(subprocess, \u0027check_call\u0027, self._exec_patch)"},{"line_number":58,"context_line":"            self.patch(subprocess, \u0027check_output\u0027, self._exec_patch)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_bfe7b2e4","line":55,"in_reply_to":"3f4b6375_77e28403","updated":"2017-10-23 15:41:23.000000000","message":"Good catch. I will add catching of ironic_lib.execute().\n\nThough it reality the other calls catch when someone calls ironic_lib.execute() because that calls processutils.execute()","commit_id":"4027f2ea692420b3d15b89380050ae55aeec9642"}],"ironic_python_agent/tests/unit/test_utils.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"1ae761f67a03ce2e5c1b997a0add0bde7011988a","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class ExecuteTestCase(ironic_agent_base.IronicAgentTest):"},{"line_number":38,"context_line":"    # This test case does call execute, so don\u0027t block access to the execute"},{"line_number":39,"context_line":"    # calls."},{"line_number":40,"context_line":"    block_execute \u003d False"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_5c08cf2a","line":38,"updated":"2017-10-23 13:48:26.000000000","message":"nit s/execute/utils.execute()/ because there are a few X.execute()s. You don\u0027t want to block utils.execute(), but you want to block what utils.execute() calls (L42), right?\n\nWording is hard...","commit_id":"4027f2ea692420b3d15b89380050ae55aeec9642"}]}
