)]}'
{"ironic_python_agent/hardware.py":[{"author":{"_account_id":7589,"name":"linggao","email":"linggao@us.ibm.com","username":"linggao"},"change_message_id":"3cea7882710e333852c783afc1c35b63a6754ced","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    @abc.abstractmethod"},{"line_number":111,"context_line":"    def erase_block_device(self, block_device):"},{"line_number":112,"context_line":"        \"\"\"Attempt to erase a block device. Implementations should detect the"},{"line_number":113,"context_line":"        type of device and erase it in the most appropriate way possible."},{"line_number":114,"context_line":"        Generic implementations should support common erase mechanisms such as"},{"line_number":115,"context_line":"        ATA secure erase, or multi-pass random writes. Operators with more"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_2792fef5","line":112,"updated":"2014-06-05 17:51:57.000000000","message":"Please leave a blank line after \"Attempt to erase a block device, \"\nto confirm with the doc string standard.\nPlease also give a short description for the input parameter block_device using :param keyword.","commit_id":"808e599626f7a0ea34ff77035fe8831fb3a972c3"},{"author":{"_account_id":10626,"name":"Russell Haering","email":"russellhaering@gmail.com","username":"russell_h"},"change_message_id":"12805c327a628f4ed22c47ec64ea829ec6e73830","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    @abc.abstractmethod"},{"line_number":111,"context_line":"    def erase_block_device(self, block_device):"},{"line_number":112,"context_line":"        \"\"\"Attempt to erase a block device. Implementations should detect the"},{"line_number":113,"context_line":"        type of device and erase it in the most appropriate way possible."},{"line_number":114,"context_line":"        Generic implementations should support common erase mechanisms such as"},{"line_number":115,"context_line":"        ATA secure erase, or multi-pass random writes. Operators with more"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_b570e7a4","line":112,"in_reply_to":"1ae5cdf2_2792fef5","updated":"2014-06-06 04:21:53.000000000","message":"Done, thanks.","commit_id":"808e599626f7a0ea34ff77035fe8831fb3a972c3"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"3adc22f5350d3a40ba95d2428e6da5257a7639b0","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def erase_block_device(self, block_device):"},{"line_number":222,"context_line":"        if self._ata_erase(block_device):"},{"line_number":223,"context_line":"            return True"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        raise errors.BlockDeviceEraseError((\u0027Unable to erase block device \u0027"},{"line_number":226,"context_line":"            \u0027{0}: device is unsupported.\u0027).format(block_device.name))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_c4f24205","line":223,"updated":"2014-06-05 12:50:24.000000000","message":"Why is this returning True? There is no information about return value in the docstring and I doubt it is required","commit_id":"808e599626f7a0ea34ff77035fe8831fb3a972c3"},{"author":{"_account_id":10626,"name":"Russell Haering","email":"russellhaering@gmail.com","username":"russell_h"},"change_message_id":"12805c327a628f4ed22c47ec64ea829ec6e73830","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def erase_block_device(self, block_device):"},{"line_number":222,"context_line":"        if self._ata_erase(block_device):"},{"line_number":223,"context_line":"            return True"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        raise errors.BlockDeviceEraseError((\u0027Unable to erase block device \u0027"},{"line_number":226,"context_line":"            \u0027{0}: device is unsupported.\u0027).format(block_device.name))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_15619bd2","line":223,"in_reply_to":"1ae5cdf2_c4f24205","updated":"2014-06-06 04:21:53.000000000","message":"Good catch, fixed.","commit_id":"808e599626f7a0ea34ff77035fe8831fb3a972c3"},{"author":{"_account_id":7589,"name":"linggao","email":"linggao@us.ibm.com","username":"linggao"},"change_message_id":"3cea7882710e333852c783afc1c35b63a6754ced","unresolved":false,"context_lines":[{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        raise errors.BlockDeviceEraseError((\u0027Unable to erase block device \u0027"},{"line_number":226,"context_line":"            \u0027{0}: device is unsupported.\u0027).format(block_device.name))"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def _get_ata_security_lines(self, block_device):"},{"line_number":229,"context_line":"        output \u003d utils.execute(\u0027hdparm\u0027, \u0027-I\u0027, block_device.name)[0]"},{"line_number":230,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_0a5c274a","line":227,"updated":"2014-06-05 17:51:57.000000000","message":"How about this?\n    if not self._ata_erase(block_device):\n        raise errors.BlockDeviceEraseError((\u0027Unable to erase block device \u0027\n                \u0027{0}: device is unsupported.\u0027).format(block_device.name))","commit_id":"808e599626f7a0ea34ff77035fe8831fb3a972c3"},{"author":{"_account_id":10626,"name":"Russell Haering","email":"russellhaering@gmail.com","username":"russell_h"},"change_message_id":"12805c327a628f4ed22c47ec64ea829ec6e73830","unresolved":false,"context_lines":[{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        raise errors.BlockDeviceEraseError((\u0027Unable to erase block device \u0027"},{"line_number":226,"context_line":"            \u0027{0}: device is unsupported.\u0027).format(block_device.name))"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def _get_ata_security_lines(self, block_device):"},{"line_number":229,"context_line":"        output \u003d utils.execute(\u0027hdparm\u0027, \u0027-I\u0027, block_device.name)[0]"},{"line_number":230,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_b5a7070a","line":227,"in_reply_to":"1ae5cdf2_0a5c274a","updated":"2014-06-06 04:21:53.000000000","message":"I\u0027m envisioning that erase_block_device will attempt multiple erase mechanisms, and only reach this point if none return True. I\u0027ve added a comment to indicate why it is factored this way.","commit_id":"808e599626f7a0ea34ff77035fe8831fb3a972c3"},{"author":{"_account_id":10342,"name":"Jay Faulkner","display_name":"JayF","email":"jay@jvf.cc","username":"JayF","status":"youtube.com/@oss-gr / podcast.gr-oss.io"},"change_message_id":"7d1bc693c96f6f371188bd7d9a387573ee224ec3","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        \"\"\""},{"line_number":142,"context_line":"        block_devices \u003d self.list_block_devices()"},{"line_number":143,"context_line":"        for block_device in block_devices:"},{"line_number":144,"context_line":"            self.erase_block_device(block_device)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def list_hardware_info(self):"},{"line_number":147,"context_line":"        hardware_info \u003d {}"}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_f07506fb","line":144,"updated":"2014-06-06 16:55:26.000000000","message":"Using our existing logic for list_block_devices() will cause breakage here in some configurations, like in cases of device mapper:\n\nroot@ubuntu-12:~# blockdev --report\nRO    RA   SSZ   BSZ   StartSec            Size   Device\nrw   256   512  4096          0     44040192000   /dev/sda\nrw   256   512  4096       2048       898629632   /dev/sda1\nrw   256   512  1024    1759230            1024   /dev/sda2\nrw   256   512  4096    1759232     43138416640   /dev/sda5\nrw   256   512  4096          0     39996882944   /dev/dm-0\nrw   256   512  4096          0      3137339392   /dev/dm-1\n\nlist_block_devices() would return /dev/sda, /dev/dm-0 and /dev/dm-1 -- dm-0 and dm-1 would obviously not be eligible for a secure erase.\n\nPerhaps we should use hdparm or something else to verify a block device is \u0027real\u0027 here before submitting it for erasure?","commit_id":"ce0ece02506f35e4f1574074220f6d27351a145e"},{"author":{"_account_id":10626,"name":"Russell Haering","email":"russellhaering@gmail.com","username":"russell_h"},"change_message_id":"ef8f37e480973753f4c63899caaa93585fdddee6","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        \"\"\""},{"line_number":142,"context_line":"        block_devices \u003d self.list_block_devices()"},{"line_number":143,"context_line":"        for block_device in block_devices:"},{"line_number":144,"context_line":"            self.erase_block_device(block_device)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def list_hardware_info(self):"},{"line_number":147,"context_line":"        hardware_info \u003d {}"}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_dd357edc","line":144,"in_reply_to":"1ae5cdf2_f07506fb","updated":"2014-06-06 18:59:21.000000000","message":"My thinking on this is that operators probably oughtn\u0027t be configuring device mapper in an agent ramdisk. If we hear about a reasonable use-case for that I\u0027d be happy to add support, but IMO we should err on the side of not skipping any devices.","commit_id":"ce0ece02506f35e4f1574074220f6d27351a145e"},{"author":{"_account_id":10342,"name":"Jay Faulkner","display_name":"JayF","email":"jay@jvf.cc","username":"JayF","status":"youtube.com/@oss-gr / podcast.gr-oss.io"},"change_message_id":"7d1bc693c96f6f371188bd7d9a387573ee224ec3","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        # NOTE(russell_h): Support for additional generic erase methods should"},{"line_number":232,"context_line":"        # be added above this raise, in order of precedence."},{"line_number":233,"context_line":"        raise errors.BlockDeviceEraseError((\u0027Unable to erase block device \u0027"},{"line_number":234,"context_line":"            \u0027{0}: device is unsupported.\u0027).format(block_device.name))"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def _get_ata_security_lines(self, block_device):"},{"line_number":237,"context_line":"        output \u003d utils.execute(\u0027hdparm\u0027, \u0027-I\u0027, block_device.name)[0]"}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_f01ee6ba","line":234,"updated":"2014-06-06 16:55:26.000000000","message":"Does this mean that it\u0027s impossible for an erase_devices call to succeed if any device on the system needs to be erased by something other than ATA secure erase?","commit_id":"ce0ece02506f35e4f1574074220f6d27351a145e"},{"author":{"_account_id":10626,"name":"Russell Haering","email":"russellhaering@gmail.com","username":"russell_h"},"change_message_id":"ef8f37e480973753f4c63899caaa93585fdddee6","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        # NOTE(russell_h): Support for additional generic erase methods should"},{"line_number":232,"context_line":"        # be added above this raise, in order of precedence."},{"line_number":233,"context_line":"        raise errors.BlockDeviceEraseError((\u0027Unable to erase block device \u0027"},{"line_number":234,"context_line":"            \u0027{0}: device is unsupported.\u0027).format(block_device.name))"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def _get_ata_security_lines(self, block_device):"},{"line_number":237,"context_line":"        output \u003d utils.execute(\u0027hdparm\u0027, \u0027-I\u0027, block_device.name)[0]"}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_e71b8d1a","line":234,"in_reply_to":"1ae5cdf2_f01ee6ba","updated":"2014-06-06 18:59:21.000000000","message":"Today, yes. We\u0027ll iterate to add support for additional devices over time. If a device we don\u0027t know how to erase is discovered it seems safer to error than to silently succeed.","commit_id":"ce0ece02506f35e4f1574074220f6d27351a145e"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"f76fd694d6b12d11ec9fe145d15395fcc013f880","unresolved":false,"context_lines":[{"line_number":255,"context_line":"    def _ata_erase(self, block_device):"},{"line_number":256,"context_line":"        security_lines \u003d self._get_ata_security_lines(block_device)"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        # If secure erase isn\u0027t supported return False erase_block_device can"},{"line_number":259,"context_line":"        # try another mechanism. Below here, if secure erase is supported but"},{"line_number":260,"context_line":"        # fails in some way, error out (operators of hardware that supports"},{"line_number":261,"context_line":"        # secure erase presumably expect this to work)."}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_d520fcb2","line":258,"updated":"2014-06-06 16:33:36.000000000","message":"\"return False erase_block_device\" - there\u0027s some sort of grammar issue here, maybe just add a semi-colon or \u0027so that\u0027?","commit_id":"ce0ece02506f35e4f1574074220f6d27351a145e"},{"author":{"_account_id":10626,"name":"Russell Haering","email":"russellhaering@gmail.com","username":"russell_h"},"change_message_id":"ef8f37e480973753f4c63899caaa93585fdddee6","unresolved":false,"context_lines":[{"line_number":255,"context_line":"    def _ata_erase(self, block_device):"},{"line_number":256,"context_line":"        security_lines \u003d self._get_ata_security_lines(block_device)"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        # If secure erase isn\u0027t supported return False erase_block_device can"},{"line_number":259,"context_line":"        # try another mechanism. Below here, if secure erase is supported but"},{"line_number":260,"context_line":"        # fails in some way, error out (operators of hardware that supports"},{"line_number":261,"context_line":"        # secure erase presumably expect this to work)."}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_07195922","line":258,"in_reply_to":"1ae5cdf2_d520fcb2","updated":"2014-06-06 18:59:21.000000000","message":"Fixed, thanks.","commit_id":"ce0ece02506f35e4f1574074220f6d27351a145e"}]}
