)]}'
{"ironic_python_agent/errors.py":[{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"89203d4168f4f8f0949ca4113822a1c82f0e4173","unresolved":false,"context_lines":[{"line_number":298,"context_line":""},{"line_number":299,"context_line":"class DeviceNotFound(NotFound):"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"    message \u003d \u0027Error finding IP for Ironic Agent\u0027"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"    def __init__(self, details):"},{"line_number":304,"context_line":"        super(DeviceNotFound, self).__init__(details)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_a06607eb","line":301,"updated":"2015-02-25 18:57:12.000000000","message":"Nit: by the message this looks more like a LookupAgentIPError (see line 117 of this file.) is there a reason this was not used?","commit_id":"47bf395c776627d286857ed1a2cda096443c5cdb"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"79fde10e274b57ca5713ca442e98b5b4af011a55","unresolved":false,"context_lines":[{"line_number":298,"context_line":""},{"line_number":299,"context_line":"class DeviceNotFound(NotFound):"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"    message \u003d \u0027Error finding IP for Ironic Agent\u0027"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"    def __init__(self, details):"},{"line_number":304,"context_line":"        super(DeviceNotFound, self).__init__(details)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_5992884c","line":301,"in_reply_to":"ba7be1f8_a06607eb","updated":"2015-02-26 11:32:47.000000000","message":"Oh, I forgot to update the message here :)\n\ncopy\u0026paste will fix","commit_id":"47bf395c776627d286857ed1a2cda096443c5cdb"}],"ironic_python_agent/extensions/image.py":[{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"a9e1595c42883be0339a84706f9b57676735b0e0","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    LOG.debug(\"Find the root partition %(uuid)s on device %(dev)s\","},{"line_number":37,"context_line":"              {\u0027dev\u0027: device, \u0027uuid\u0027: root_uuid})"},{"line_number":38,"context_line":"    report \u003d utils.execute(\u0027lsblk\u0027, \u0027-PbioKNAME,UUID,TYPE\u0027, device)[0]"},{"line_number":39,"context_line":"    for line in report.split(\u0027\\n\u0027):"},{"line_number":40,"context_line":"        part \u003d {}"},{"line_number":41,"context_line":"        # Split into KEY\u003dVAL pairs"},{"line_number":42,"context_line":"        vals \u003d shlex.split(line)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_c6969c3d","line":39,"updated":"2015-02-19 18:23:09.000000000","message":"splitlines?\n\n for line in report.splitlines():","commit_id":"65140f91b4d1be0be0462b768925d17ec67f917a"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"13a746c0a570ae60f8bf752d6798ac8178dbc222","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    LOG.debug(\"Find the root partition %(uuid)s on device %(dev)s\","},{"line_number":37,"context_line":"              {\u0027dev\u0027: device, \u0027uuid\u0027: root_uuid})"},{"line_number":38,"context_line":"    report \u003d utils.execute(\u0027lsblk\u0027, \u0027-PbioKNAME,UUID,TYPE\u0027, device)[0]"},{"line_number":39,"context_line":"    for line in report.split(\u0027\\n\u0027):"},{"line_number":40,"context_line":"        part \u003d {}"},{"line_number":41,"context_line":"        # Split into KEY\u003dVAL pairs"},{"line_number":42,"context_line":"        vals \u003d shlex.split(line)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_4ee9b519","line":39,"in_reply_to":"da86d52c_c6969c3d","updated":"2015-02-20 11:22:35.000000000","message":"Oh will add it, sorry missed it when pushing the new review. Since I just upload this code to store it somewhere apart from my laptop :) It wasn\u0027t ready yet.\n\nThanks","commit_id":"65140f91b4d1be0be0462b768925d17ec67f917a"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"a9e1595c42883be0339a84706f9b57676735b0e0","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    try:"},{"line_number":67,"context_line":"        # Mount the partition and binds"},{"line_number":68,"context_line":"        path \u003d tempfile.mkdtemp()"},{"line_number":69,"context_line":"        utils.execute(\u0027mount\u0027, root_partition, path)"},{"line_number":70,"context_line":"        utils.execute(\u0027mount\u0027, \u0027-o\u0027, \u0027bind\u0027, \u0027/dev\u0027, os.path.join(path, \u0027dev\u0027))"},{"line_number":71,"context_line":"        utils.execute(\u0027mount\u0027, \u0027-o\u0027, \u0027bind\u0027, \u0027/sys\u0027, os.path.join(path, \u0027sys\u0027))"},{"line_number":72,"context_line":"        utils.execute(\u0027mount\u0027, \u0027-o\u0027, \u0027bind\u0027, \u0027/proc\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_e6b64088","line":69,"updated":"2015-02-19 18:23:09.000000000","message":"Idea, maybe the list of bind mount points could be in a list/tuple.  Then could iterate through the list here and also below in the umount portion.","commit_id":"65140f91b4d1be0be0462b768925d17ec67f917a"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"13a746c0a570ae60f8bf752d6798ac8178dbc222","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    try:"},{"line_number":67,"context_line":"        # Mount the partition and binds"},{"line_number":68,"context_line":"        path \u003d tempfile.mkdtemp()"},{"line_number":69,"context_line":"        utils.execute(\u0027mount\u0027, root_partition, path)"},{"line_number":70,"context_line":"        utils.execute(\u0027mount\u0027, \u0027-o\u0027, \u0027bind\u0027, \u0027/dev\u0027, os.path.join(path, \u0027dev\u0027))"},{"line_number":71,"context_line":"        utils.execute(\u0027mount\u0027, \u0027-o\u0027, \u0027bind\u0027, \u0027/sys\u0027, os.path.join(path, \u0027sys\u0027))"},{"line_number":72,"context_line":"        utils.execute(\u0027mount\u0027, \u0027-o\u0027, \u0027bind\u0027, \u0027/proc\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_6eee7924","line":69,"in_reply_to":"da86d52c_e6b64088","updated":"2015-02-20 11:22:35.000000000","message":"Done","commit_id":"65140f91b4d1be0be0462b768925d17ec67f917a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"7499f808f925f76f8969ddd40ce2e594b6328759","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def _get_root_partition(device, root_uuid):"},{"line_number":35,"context_line":"    \"\"\"Find the root partiton of a given device.\"\"\""},{"line_number":36,"context_line":"    LOG.debug(\"Find the root partition %(uuid)s on device %(dev)s\","},{"line_number":37,"context_line":"              {\u0027dev\u0027: device, \u0027uuid\u0027: root_uuid})"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba7be1f8_5f7acc24","line":35,"updated":"2015-03-02 23:06:27.000000000","message":"nit: s/partiton/partition/","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e32315bd5114ec9af44e4093f9730b3e6a13d4c8","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def _get_root_partition(device, root_uuid):"},{"line_number":35,"context_line":"    \"\"\"Find the root partiton of a given device.\"\"\""},{"line_number":36,"context_line":"    LOG.debug(\"Find the root partition %(uuid)s on device %(dev)s\","},{"line_number":37,"context_line":"              {\u0027dev\u0027: device, \u0027uuid\u0027: root_uuid})"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a80dd14_5cb6d98b","line":35,"in_reply_to":"ba7be1f8_5f7acc24","updated":"2015-03-04 09:39:12.000000000","message":"Done","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"7499f808f925f76f8969ddd40ce2e594b6328759","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"def _install_grub2(device, root_uuid):"},{"line_number":77,"context_line":"    \"\"\"Install GRUB2 bootloader on a given device.\"\"\""},{"line_number":78,"context_line":"    LOG.debug(\"Installing GRUB2 bootloader on on device %s\", device)"},{"line_number":79,"context_line":"    root_partition \u003d _get_root_partition(device, root_uuid)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba7be1f8_bf61083b","line":78,"updated":"2015-03-02 23:06:27.000000000","message":"nit: s/on on/on/","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e32315bd5114ec9af44e4093f9730b3e6a13d4c8","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"def _install_grub2(device, root_uuid):"},{"line_number":77,"context_line":"    \"\"\"Install GRUB2 bootloader on a given device.\"\"\""},{"line_number":78,"context_line":"    LOG.debug(\"Installing GRUB2 bootloader on on device %s\", device)"},{"line_number":79,"context_line":"    root_partition \u003d _get_root_partition(device, root_uuid)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a80dd14_7cbb9d72","line":78,"in_reply_to":"ba7be1f8_bf61083b","updated":"2015-03-04 09:39:12.000000000","message":"Done","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"98d30b3453fb20a8dc2e7eec46cc9b61869b3a93","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        # Mount the partition and binds"},{"line_number":83,"context_line":"        path \u003d tempfile.mkdtemp()"},{"line_number":84,"context_line":"        utils.execute(\u0027mount\u0027, root_partition, path)"},{"line_number":85,"context_line":"        for fs in (\u0027/dev\u0027, \u0027/sys\u0027, \u0027/proc\u0027):"},{"line_number":86,"context_line":"            utils.execute(\u0027mount\u0027, \u0027-o\u0027, \u0027bind\u0027, fs, path + fs)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        binary_name \u003d \"grub\""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba7be1f8_b8b75ed7","line":85,"updated":"2015-03-03 00:41:10.000000000","message":"I think this should be a variable.  So the same variable could be used here and below in the umount portion.  That way only one place to change it.","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e32315bd5114ec9af44e4093f9730b3e6a13d4c8","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        # Mount the partition and binds"},{"line_number":83,"context_line":"        path \u003d tempfile.mkdtemp()"},{"line_number":84,"context_line":"        utils.execute(\u0027mount\u0027, root_partition, path)"},{"line_number":85,"context_line":"        for fs in (\u0027/dev\u0027, \u0027/sys\u0027, \u0027/proc\u0027):"},{"line_number":86,"context_line":"            utils.execute(\u0027mount\u0027, \u0027-o\u0027, \u0027bind\u0027, fs, path + fs)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        binary_name \u003d \"grub\""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a80dd14_9caf712b","line":85,"in_reply_to":"ba7be1f8_b8b75ed7","updated":"2015-03-04 09:39:12.000000000","message":"Done","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"98d30b3453fb20a8dc2e7eec46cc9b61869b3a93","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                      shell\u003dTrue)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        # Generate the grub configuration file"},{"line_number":99,"context_line":"        utils.execute(\u0027chroot %(path)s /bin/bash -c \u0027"},{"line_number":100,"context_line":"                      \u0027\"/usr/sbin/%(bin)s-mkconfig -o \u0027"},{"line_number":101,"context_line":"                      \u0027/boot/%(bin)s/grub.cfg\"\u0027 %"},{"line_number":102,"context_line":"                      {\u0027path\u0027: path, \u0027bin\u0027: binary_name}, shell\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba7be1f8_d8cdf232","line":99,"updated":"2015-03-03 00:41:10.000000000","message":"Should the first two be individual arguments?\n\n \u0027chroot\u0027, path, \u0027/bin/bash -c\u0027","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e32315bd5114ec9af44e4093f9730b3e6a13d4c8","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                      shell\u003dTrue)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        # Generate the grub configuration file"},{"line_number":99,"context_line":"        utils.execute(\u0027chroot %(path)s /bin/bash -c \u0027"},{"line_number":100,"context_line":"                      \u0027\"/usr/sbin/%(bin)s-mkconfig -o \u0027"},{"line_number":101,"context_line":"                      \u0027/boot/%(bin)s/grub.cfg\"\u0027 %"},{"line_number":102,"context_line":"                      {\u0027path\u0027: path, \u0027bin\u0027: binary_name}, shell\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a80dd14_7c40fd56","line":99,"in_reply_to":"ba7be1f8_d8cdf232","updated":"2015-03-04 09:39:12.000000000","message":"I\u0027ve tried to pass it as a list, but since we are passing a command to the command we are calling (we are chroot with bash, and giving a command to bash) execute() get\u0027s a bit confused with it. So using shell\u003dTrue means you can pass the whole command to be executed as one string.","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"1face6849ce9d507bc39363ff79e1605694f2cbd","unresolved":false,"context_lines":[{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        # If umounting the binds succeed then we can try to delete it"},{"line_number":125,"context_line":"        if not umount_binds_fail:"},{"line_number":126,"context_line":"            utils.execute(\u0027umount\u0027, path)"},{"line_number":127,"context_line":"            shutil.rmtree(path)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba7be1f8_bd47a24a","line":126,"updated":"2015-02-27 19:16:56.000000000","message":"I think we should probably catch ProcessExecutionError here too, yeah?","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e32315bd5114ec9af44e4093f9730b3e6a13d4c8","unresolved":false,"context_lines":[{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        # If umounting the binds succeed then we can try to delete it"},{"line_number":125,"context_line":"        if not umount_binds_fail:"},{"line_number":126,"context_line":"            utils.execute(\u0027umount\u0027, path)"},{"line_number":127,"context_line":"            shutil.rmtree(path)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a80dd14_bc2195b6","line":126,"in_reply_to":"ba7be1f8_bd47a24a","updated":"2015-03-04 09:39:12.000000000","message":"Done","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"77108b1adbe7988141c217c4f032aaf7670aa8fe","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                              delay_on_retry\u003dTrue)"},{"line_number":123,"context_line":"            except processutils.ProcessExecutionError as e:"},{"line_number":124,"context_line":"                umount_binds_fail \u003d True"},{"line_number":125,"context_line":"                LOG.warning(umount_warn_msg, {\u0027path\u0027: fs, \u0027error\u0027: e})"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        # If umounting the binds succeed then we can try to delete it"},{"line_number":128,"context_line":"        if not umount_binds_fail:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_73173ea4","line":125,"updated":"2015-03-04 15:47:17.000000000","message":"wondering if it might be useful to log path+fs instead of fs.","commit_id":"def5abf0ef8f090dbcd0832731c76c2410b09790"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"6a7588f0aa412a11dd9eb26113e1e2d4233bfcd0","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                              delay_on_retry\u003dTrue)"},{"line_number":123,"context_line":"            except processutils.ProcessExecutionError as e:"},{"line_number":124,"context_line":"                umount_binds_fail \u003d True"},{"line_number":125,"context_line":"                LOG.warning(umount_warn_msg, {\u0027path\u0027: fs, \u0027error\u0027: e})"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        # If umounting the binds succeed then we can try to delete it"},{"line_number":128,"context_line":"        if not umount_binds_fail:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_c5dd7f44","line":125,"in_reply_to":"9a80dd14_73173ea4","updated":"2015-03-04 16:31:17.000000000","message":"Oh right, yeah I will update it","commit_id":"def5abf0ef8f090dbcd0832731c76c2410b09790"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"77108b1adbe7988141c217c4f032aaf7670aa8fe","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        # If umounting the binds succeed then we can try to delete it"},{"line_number":128,"context_line":"        if not umount_binds_fail:"},{"line_number":129,"context_line":"            try:"},{"line_number":130,"context_line":"                utils.execute(\u0027umount\u0027, path)"},{"line_number":131,"context_line":"            except processutils.ProcessExecutionError as e:"},{"line_number":132,"context_line":"                LOG.warning(umount_warn_msg, {\u0027path\u0027: path, \u0027error\u0027: e})"},{"line_number":133,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_334b06b2","line":130,"updated":"2015-03-04 15:47:17.000000000","message":"I was wondering -- if it fails, why not attempts\u003d3 like you did above? (And if you do change it, then maybe update the log msg to include something like \u0027Attempted 3 times.\u0027","commit_id":"def5abf0ef8f090dbcd0832731c76c2410b09790"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"6a7588f0aa412a11dd9eb26113e1e2d4233bfcd0","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        # If umounting the binds succeed then we can try to delete it"},{"line_number":128,"context_line":"        if not umount_binds_fail:"},{"line_number":129,"context_line":"            try:"},{"line_number":130,"context_line":"                utils.execute(\u0027umount\u0027, path)"},{"line_number":131,"context_line":"            except processutils.ProcessExecutionError as e:"},{"line_number":132,"context_line":"                LOG.warning(umount_warn_msg, {\u0027path\u0027: path, \u0027error\u0027: e})"},{"line_number":133,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_25cbbb73","line":130,"in_reply_to":"9a80dd14_334b06b2","updated":"2015-03-04 16:31:17.000000000","message":"+1","commit_id":"def5abf0ef8f090dbcd0832731c76c2410b09790"}],"ironic_python_agent/tests/extensions/image.py":[{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"1face6849ce9d507bc39363ff79e1605694f2cbd","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"@mock.patch.object(hardware, \u0027dispatch_to_managers\u0027)"},{"line_number":32,"context_line":"@mock.patch.object(utils, \u0027execute\u0027)"},{"line_number":33,"context_line":"@mock.patch.object(tempfile, \u0027mkdtemp\u0027, lambda *_: \u0027/tmp/fake-dir\u0027)"},{"line_number":34,"context_line":"@mock.patch.object(shutil, \u0027rmtree\u0027, lambda *_: None)"},{"line_number":35,"context_line":"class TestImageExtension(test_base.BaseTestCase):"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba7be1f8_bd5ec210","line":33,"updated":"2015-02-27 19:16:56.000000000","message":"Just FYI, I think you can do the same thing with return_value\u003d\u0027/tmp/fake-dir\u0027, rather than a lambda.","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8286ac48fe6a0f8f4f458c46872bd3f7246d57f0","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"@mock.patch.object(hardware, \u0027dispatch_to_managers\u0027)"},{"line_number":32,"context_line":"@mock.patch.object(utils, \u0027execute\u0027)"},{"line_number":33,"context_line":"@mock.patch.object(tempfile, \u0027mkdtemp\u0027, lambda *_: \u0027/tmp/fake-dir\u0027)"},{"line_number":34,"context_line":"@mock.patch.object(shutil, \u0027rmtree\u0027, lambda *_: None)"},{"line_number":35,"context_line":"class TestImageExtension(test_base.BaseTestCase):"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a80dd14_6644eb74","line":33,"in_reply_to":"9a80dd14_dc2e49a5","updated":"2015-03-04 11:01:41.000000000","message":"Oh it works differently than I thought. By adding \"return_value\u003d\" the mock will be passed to all methods of the TestImageExtension as a parameter. So the idea of passing the lambda here is that we can minimize the number of parameters and make sure that we always return that fake dir for tests (that doesn\u0027t even will be created for real, so we don\u0027t touch the users filesystem when running the tests)","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e32315bd5114ec9af44e4093f9730b3e6a13d4c8","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"@mock.patch.object(hardware, \u0027dispatch_to_managers\u0027)"},{"line_number":32,"context_line":"@mock.patch.object(utils, \u0027execute\u0027)"},{"line_number":33,"context_line":"@mock.patch.object(tempfile, \u0027mkdtemp\u0027, lambda *_: \u0027/tmp/fake-dir\u0027)"},{"line_number":34,"context_line":"@mock.patch.object(shutil, \u0027rmtree\u0027, lambda *_: None)"},{"line_number":35,"context_line":"class TestImageExtension(test_base.BaseTestCase):"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a80dd14_dc2e49a5","line":33,"in_reply_to":"ba7be1f8_bd5ec210","updated":"2015-03-04 09:39:12.000000000","message":"Oh, will try. Thanks","commit_id":"6fc42b87b8c20c3a1ad78c187db9d9231e4931ee"}]}
