)]}'
{"shade/__init__.py":[{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"abf36585fbeea72a2f336ed54da15585049547be","unresolved":false,"context_lines":[{"line_number":445,"context_line":"            self.log.debug("},{"line_number":446,"context_line":"                \"image {name} exists and is up to date\".format(name\u003dname))"},{"line_number":447,"context_line":"            return"},{"line_number":448,"context_line":"        kwargs[IMAGE_MD5_KEY] \u003d md5"},{"line_number":449,"context_line":"        # This makes me want to die inside"},{"line_number":450,"context_line":"        if self._get_glance_api_version() \u003d\u003d \u00272\u0027:"},{"line_number":451,"context_line":"            self._upload_image_v2("}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_938050c0","line":448,"updated":"2015-01-08 23:34:31.000000000","message":"If we\u0027re doing our own integrity checks, maybe we can switch to sha-256?","commit_id":"8801f7bbe399c0fde92524322db3ed9ffb439263"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"1b4f0ef3b293e9ecdda69ee74a6429d3bcacf469","unresolved":false,"context_lines":[{"line_number":445,"context_line":"            self.log.debug("},{"line_number":446,"context_line":"                \"image {name} exists and is up to date\".format(name\u003dname))"},{"line_number":447,"context_line":"            return"},{"line_number":448,"context_line":"        kwargs[IMAGE_MD5_KEY] \u003d md5"},{"line_number":449,"context_line":"        # This makes me want to die inside"},{"line_number":450,"context_line":"        if self._get_glance_api_version() \u003d\u003d \u00272\u0027:"},{"line_number":451,"context_line":"            self._upload_image_v2("}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_9f556e20","line":448,"in_reply_to":"3a961159_938050c0","updated":"2015-01-21 22:58:13.000000000","message":"Done","commit_id":"8801f7bbe399c0fde92524322db3ed9ffb439263"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"abf36585fbeea72a2f336ed54da15585049547be","unresolved":false,"context_lines":[{"line_number":453,"context_line":"                current_image\u003dcurrent_image,"},{"line_number":454,"context_line":"                wait\u003dwait, timeout\u003dtimeout, **kwargs)"},{"line_number":455,"context_line":"        else:"},{"line_number":456,"context_line":"            self._upload_image_v1(name, filename, md5\u003dmd5)"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    def _upload_image_v1("},{"line_number":459,"context_line":"            self, name, filename,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_b3838cc9","line":456,"updated":"2015-01-08 23:34:31.000000000","message":"We don\u0027t return anything usefur to the caller...","commit_id":"8801f7bbe399c0fde92524322db3ed9ffb439263"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"abf36585fbeea72a2f336ed54da15585049547be","unresolved":false,"context_lines":[{"line_number":463,"context_line":"            name\u003dname, is_public\u003dFalse, disk_format\u003ddisk_format,"},{"line_number":464,"context_line":"            container_format\u003dcontainer_format, **image_properties)"},{"line_number":465,"context_line":"        image.update(data\u003dopen(filename, \u0027rb\u0027))"},{"line_number":466,"context_line":"        return image.id"},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"    def _upload_image_v2("},{"line_number":469,"context_line":"            self, name, filename, container, current_image\u003dNone,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_d36d7833","line":466,"updated":"2015-01-08 23:34:31.000000000","message":"This returns an ID, which is great.  I guess this does a PUT and gets the image id in the response?  So the upload is complete when this is done?  Is there further server-side processing that needs to be done?  Is it included in that call, or does it happen afterwords async?","commit_id":"8801f7bbe399c0fde92524322db3ed9ffb439263"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"1b4f0ef3b293e9ecdda69ee74a6429d3bcacf469","unresolved":false,"context_lines":[{"line_number":463,"context_line":"            name\u003dname, is_public\u003dFalse, disk_format\u003ddisk_format,"},{"line_number":464,"context_line":"            container_format\u003dcontainer_format, **image_properties)"},{"line_number":465,"context_line":"        image.update(data\u003dopen(filename, \u0027rb\u0027))"},{"line_number":466,"context_line":"        return image.id"},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"    def _upload_image_v2("},{"line_number":469,"context_line":"            self, name, filename, container, current_image\u003dNone,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_df5d367e","line":466,"in_reply_to":"3a961159_d36d7833","updated":"2015-01-21 22:58:13.000000000","message":"v1 is a sync upload - so this is a totally blocking call and when it\u0027s done it\u0027ll return the id. I need to hammer it a little more to get a good sense of what failures look like - but this is essentially the code that\u0027s in nodepool right now.","commit_id":"8801f7bbe399c0fde92524322db3ed9ffb439263"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"abf36585fbeea72a2f336ed54da15585049547be","unresolved":false,"context_lines":[{"line_number":488,"context_line":"                status \u003d self.glance_client.tasks.get(task.id)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"                if status.status \u003d\u003d \u0027success\u0027:"},{"line_number":491,"context_line":"                    return status.result[\u0027image_id\u0027]"},{"line_number":492,"context_line":"                if status.status \u003d\u003d \u0027failure\u0027:"},{"line_number":493,"context_line":"                    raise OpenStackCloudException("},{"line_number":494,"context_line":"                        \"Image creation failed: {message}\".format("}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_f368b422","line":491,"updated":"2015-01-08 23:34:31.000000000","message":"Wait, what is this task engine in glanceclient doing?  What\u0027s happening in the background?  I guess this is the same question as above... is it doing a put and then reading the response?  Or is it waiting for further server processing after the put?\n\nNothing else works like this, right?  So for consistency, shouldn\u0027t this library just always be synchronous?  That\u0027s the way I would want to use it in nodepool, which generally expects to do things synchronously in one thread per provider, except for when we expect something to be really long (like uploading an image), in which case we do that in another thread.\n\nSo in short, what I really want out of this function is an HTTP put call.  If glanceclient isn\u0027t willing to do that, then I think we should emulate it by waiting for its task to complete.  However, there\u0027s a further complication with this timeout mechanism -- what if this method times out, but glanceclient eventually finishes in the background.  Then we\u0027ve lied to the user.  Is there a way to abort a task?\n\nSo in short, this should always be synchronous (or everything should be asynchronous).  And it should either return an id, or raise an exception (and in that case, we should be certain that nothing was done).","commit_id":"8801f7bbe399c0fde92524322db3ed9ffb439263"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"1b4f0ef3b293e9ecdda69ee74a6429d3bcacf469","unresolved":false,"context_lines":[{"line_number":488,"context_line":"                status \u003d self.glance_client.tasks.get(task.id)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"                if status.status \u003d\u003d \u0027success\u0027:"},{"line_number":491,"context_line":"                    return status.result[\u0027image_id\u0027]"},{"line_number":492,"context_line":"                if status.status \u003d\u003d \u0027failure\u0027:"},{"line_number":493,"context_line":"                    raise OpenStackCloudException("},{"line_number":494,"context_line":"                        \"Image creation failed: {message}\".format("}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_1f425e68","line":491,"in_reply_to":"3a961159_f368b422","updated":"2015-01-21 22:58:13.000000000","message":"There is no synchronous call in glance v2 - there is ONLY this task interface. And it\u0027s not glanceclient itself - it\u0027s glance - this is the only way you can upload an image to rax. (sigh)\n\nSo, I think the short answer is to maybe default the wait param to True and have this poll the task status for completion so that it behaves as if it\u0027s a sync put call.\n\nYou raise an excellent point about what the user is supposed to do if it times out and how we should expose that still-pending work to the user. Perhaps if we exceed the amount of time the user has expressed being willing to wait for this to happen, we should also delete the task? I don\u0027t know if that works or not - but I\u0027ll look in to it.","commit_id":"8801f7bbe399c0fde92524322db3ed9ffb439263"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"abf36585fbeea72a2f336ed54da15585049547be","unresolved":false,"context_lines":[{"line_number":498,"context_line":"            raise OpenStackCloudException("},{"line_number":499,"context_line":"                \"Timeout waiting for the image to import.\")"},{"line_number":500,"context_line":"        else:"},{"line_number":501,"context_line":"            return task"},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"    def _get_volumes_from_cloud(self):"},{"line_number":504,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_137460fc","line":501,"updated":"2015-01-08 23:34:31.000000000","message":"Returning a glanceclient task seems like a layer violation.","commit_id":"8801f7bbe399c0fde92524322db3ed9ffb439263"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"1b4f0ef3b293e9ecdda69ee74a6429d3bcacf469","unresolved":false,"context_lines":[{"line_number":498,"context_line":"            raise OpenStackCloudException("},{"line_number":499,"context_line":"                \"Timeout waiting for the image to import.\")"},{"line_number":500,"context_line":"        else:"},{"line_number":501,"context_line":"            return task"},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"    def _get_volumes_from_cloud(self):"},{"line_number":504,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_3f471a79","line":501,"in_reply_to":"3a961159_137460fc","updated":"2015-01-21 22:58:13.000000000","message":"Agree. Done.","commit_id":"8801f7bbe399c0fde92524322db3ed9ffb439263"}]}
