On Friday, January 27, 2012 11:19:59 AM Scott Seago wrote:
On 01/27/2012 10:11 AM, Petr Blaho wrote:
> ---
> .../delete_command/delete_image_not_found.yml | 4 ++--
> .../delete_target_image_not_found.yml | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/spec/vcr/cassettes/command/delete_command/delete_image_not_found.yml
b/spec/vcr/cassettes/command/delete_command/delete_image_not_found.yml
> index 459ca77..228ae96 100644
> --- a/spec/vcr/cassettes/command/delete_command/delete_image_not_found.yml
> +++ b/spec/vcr/cassettes/command/delete_command/delete_image_not_found.yml
> @@ -11,7 +11,7 @@
> - application/xml
> response: !ruby/struct:VCR::Response
> status: !ruby/struct:VCR::ResponseStatus
> - code: 500
> + code: 404
> message: Internal Server Error
Shouldn't the message be changed also:
message: Not Found
> headers:
> x-ua-compatible:
> @@ -36,4 +36,4 @@
> <message>Could not find Image 1234</message>
> </error>
>
> - http_version: "1.1"
> \ No newline at end of file
> + http_version: "1.1"
> diff --git
a/spec/vcr/cassettes/command/delete_command/delete_target_image_not_found.yml
b/spec/vcr/cassettes/command/delete_command/delete_target_image_not_found.yml
> index 1ec8227..ae572a2 100644
> --- a/spec/vcr/cassettes/command/delete_command/delete_target_image_not_found.yml
> +++ b/spec/vcr/cassettes/command/delete_command/delete_target_image_not_found.yml
> @@ -11,7 +11,7 @@
> - application/xml
> response: !ruby/struct:VCR::Response
> status: !ruby/struct:VCR::ResponseStatus
> - code: 500
> + code: 404
> message: Internal Server Error
And this message should be handled the same way
> headers:
> x-ua-compatible:
> @@ -36,4 +36,4 @@
> <message>Could not find TargetImage 1234</message>
> </error>
>
> - http_version: "1.1"
> \ No newline at end of file
> + http_version: "1.1"
Thanks for pointing it out. In fact I forgotten to use -XDELETE flag when curling these
urls from conductor...
So I now discovered that conductor behaves differently in reaction to delete non existent
image or target image and in reaction to delete other objects.
There is correct exception in api/images and api/target_images controllers in destroy
method but it is swalloed by rescue around destroy method and this 404 is replaced by
500.
Provider image controller and builds controller in destroy action is reraising 404 in
rescue block so 404 is not replaced by 500.
I will fix it and provide patch for conductor soon.
--
With regards
Petr Blaho