Hello,
It looks like there is a minor issue when image, realm or flavor is
requested by id. Deltacloud API returns an error HTTP document instead
of 404 HTTP code, even if requested response format is XML. Below is a
trivial patch to address this issue.
Hope it can be of any use.
Thank you,
Roman
diff --git a/server/libexec/app/controllers/flavors_controller.rb
b/server/libexec/app/controllers/flavors_controller.rb
index 6176f2a..21d6531 100644
--- a/server/libexec/app/controllers/flavors_controller.rb
+++ b/server/libexec/app/controllers/flavors_controller.rb
@@ -40,6 +40,7 @@ class FlavorsController < ApplicationController
format.html
format.json
format.xml {
+ render :nothing=>true, :status=>404 and return unless @flavor
render :xml=>convert_to_xml( :flavor, @flavor )
}
end
diff --git a/server/libexec/app/controllers/images_controller.rb
b/server/libexec/app/controllers/images_controller.rb
index 382b138..a01b417 100644
--- a/server/libexec/app/controllers/images_controller.rb
+++ b/server/libexec/app/controllers/images_controller.rb
@@ -44,6 +44,7 @@ class ImagesController < ApplicationController
format.html
format.json
format.xml {
+ render :nothing=>true, :status=>404 and return unless @image
render :xml=>convert_to_xml( :image, @image )
}
end
diff --git a/server/libexec/app/controllers/realms_controller.rb
b/server/libexec/app/controllers/realms_controller.rb
index 492b850..73168ce 100644
--- a/server/libexec/app/controllers/realms_controller.rb
+++ b/server/libexec/app/controllers/realms_controller.rb
@@ -40,6 +40,7 @@ class RealmsController < ApplicationController
format.html
format.json
format.xml {
+ render :nothing=>true, :status=>404 and return unless @realm
render :xml=>convert_to_xml( :realm, @realm )
}
end