)]}'
{"glance_store/_drivers/sheepdog.py":[{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"06dac4e49ed2d56b29ef81e287a0e1a0d54fcae6","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        Sheepdog Usage: collie vdi create -a address -p port image size"},{"line_number":111,"context_line":"        \"\"\""},{"line_number":112,"context_line":"        if not isinstance(size, (int, long, float)):"},{"line_number":113,"context_line":"            raise exceptions.Forbidden(\"Size is not a number\")"},{"line_number":114,"context_line":"        self._run_command(\"create\", None, str(size))"},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3aaa91ec_70e79640","line":112,"updated":"2016-06-28 17:15:10.000000000","message":"I would suggest to use six.integer_types https://pythonhosted.org/six/#six.integer_types + float","commit_id":"ce7396b0fda35504674b0c211a787453a740af06"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"6723610b04f65d5eeee0fdabc2a73b0f124f5745","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        \"\"\""},{"line_number":96,"context_line":"        return self._run_command(\"read\", None, str(offset), str(count))"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def write(self, data, offset, count):"},{"line_number":99,"context_line":"        \"\"\""},{"line_number":100,"context_line":"        Write up to \u0027count\u0027 bytes from the data to this image starting at"},{"line_number":101,"context_line":"        \u0027offset\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_fcb32e4b","line":98,"range":{"start_line":98,"start_character":26,"end_line":98,"end_character":39},"updated":"2016-06-29 14:53:47.000000000","message":"The interface for consumers of the glance_store library has never really been well defined.\n\nI\u0027m assuming that the generic store functions (add, delete, etc) are intended to be consumed. I\u0027m also assuming that store specific functions (eg like this sheepdog write function) are not intended to be called directly.\n\nIf so, then when the library is being used properly there is currently no way for the write function to be called with malicious offset or count parameters.\n\nBut that could change in the future.\n\nDepending on how paranoid we\u0027re feeling, we could consider validating the offset/count before calling _run_command here in order to prevent a future code change somehow allowing someone to set offset/count, eg via an \u0027add\u0027.\n\nIf we decide to do that for write, it would make sense to do it for \u0027read\u0027 and the others.","commit_id":"4b6818dc62669d0ca62779ae71e64fcfacbf9850"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"d35e165c481b7013a0910bf81a19595c60d72223","unresolved":false,"context_lines":[{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        Sheepdog Usage: collie vdi create -a address -p port image size"},{"line_number":112,"context_line":"        \"\"\""},{"line_number":113,"context_line":"        if not isinstance(size, (six.integer_types, float)):"},{"line_number":114,"context_line":"            raise exceptions.Forbidden(\"Size is not a number\")"},{"line_number":115,"context_line":"        self._run_command(\"create\", None, str(size))"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_64f58381","line":113,"updated":"2016-07-01 08:40:39.000000000","message":"Is float a valid type here? I mean, whether the image size to be equal to 3.14.","commit_id":"4b6818dc62669d0ca62779ae71e64fcfacbf9850"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"19b73b258ce83b4c7b7c9a6f7fb29a42d598a87f","unresolved":false,"context_lines":[{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        Sheepdog Usage: collie vdi create -a address -p port image size"},{"line_number":112,"context_line":"        \"\"\""},{"line_number":113,"context_line":"        if not isinstance(size, (six.integer_types, float)):"},{"line_number":114,"context_line":"            raise exceptions.Forbidden(\"Size is not a number\")"},{"line_number":115,"context_line":"        self._run_command(\"create\", None, str(size))"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_9918d11f","line":113,"in_reply_to":"3aaa91ec_64f58381","updated":"2016-07-01 10:04:39.000000000","message":"Raspberry Pi images are 3.14","commit_id":"4b6818dc62669d0ca62779ae71e64fcfacbf9850"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"4ba42d7aeedadbe6fa57a246a1e20eaa65281d15","unresolved":false,"context_lines":[{"line_number":114,"context_line":"            raise exceptions.Forbidden(\"Size is not a number\")"},{"line_number":115,"context_line":"        self._run_command(\"create\", None, str(size))"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def resize(self, size):"},{"line_number":118,"context_line":"        \"\"\"Resize this image in the Sheepdog cluster with size \u0027size\u0027."},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        Sheepdog Usage: collie vdi create -a address -p port image size"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_91ce562b","line":117,"updated":"2016-06-29 14:07:09.000000000","message":"Should we we validate resize here also to provide better class consistency?","commit_id":"4b6818dc62669d0ca62779ae71e64fcfacbf9850"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"7a62c1d082fe82e03fa8c6b7fca5e3d32b238062","unresolved":false,"context_lines":[{"line_number":114,"context_line":"            raise exceptions.Forbidden(\"Size is not a number\")"},{"line_number":115,"context_line":"        self._run_command(\"create\", None, str(size))"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def resize(self, size):"},{"line_number":118,"context_line":"        \"\"\"Resize this image in the Sheepdog cluster with size \u0027size\u0027."},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        Sheepdog Usage: collie vdi create -a address -p port image size"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_d224590e","line":117,"in_reply_to":"3aaa91ec_91ce562b","updated":"2016-06-29 15:26:18.000000000","message":"Stuart\u0027s comment is pretty relevant to this. Depends how paranoid we want to be. As the size used in the create method (L107) is the only argument not initialised by the sheepdog Store method.\n\nThis size used in the resize method is created on L313-L317, so does not get passed in by the user.","commit_id":"4b6818dc62669d0ca62779ae71e64fcfacbf9850"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"4ec96f33fbef0b2d85e705d4ee5d144af77a83ab","unresolved":false,"context_lines":[{"line_number":114,"context_line":"            raise exceptions.Forbidden(\"Size is not a number\")"},{"line_number":115,"context_line":"        self._run_command(\"create\", None, str(size))"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def resize(self, size):"},{"line_number":118,"context_line":"        \"\"\"Resize this image in the Sheepdog cluster with size \u0027size\u0027."},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        Sheepdog Usage: collie vdi create -a address -p port image size"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_dd3ef7b6","line":117,"in_reply_to":"3aaa91ec_d224590e","updated":"2016-06-30 13:44:06.000000000","message":"so wouldn\u0027t this be clearer to validate size in add method because the class looks inconsistent when we assume image_size for \"create\" to be non-string value \nbut we do not assume that for other methods.","commit_id":"4b6818dc62669d0ca62779ae71e64fcfacbf9850"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"6575b4d0d47ed3fa98f8e5f7759b7dc5f221bf8a","unresolved":false,"context_lines":[{"line_number":114,"context_line":"            raise exceptions.Forbidden(\"Size is not a number\")"},{"line_number":115,"context_line":"        self._run_command(\"create\", None, str(size))"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def resize(self, size):"},{"line_number":118,"context_line":"        \"\"\"Resize this image in the Sheepdog cluster with size \u0027size\u0027."},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        Sheepdog Usage: collie vdi create -a address -p port image size"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_70041a49","line":117,"in_reply_to":"3aaa91ec_dd3ef7b6","updated":"2016-07-01 09:27:53.000000000","message":"I personally prefer to check the value as close as possible to where it is used, as there is less likely to be another pathway which avoids the check. This seems like a potential bike shed sort of topic so I\u0027m not too fussed.","commit_id":"4b6818dc62669d0ca62779ae71e64fcfacbf9850"}]}
