diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index 9b2b5309f5..bae0f2bc95 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -138,8 +138,12 @@ class SunstoneServer < CloudServer if OpenNebula.is_error?(rc) return [500, rc.to_json] else - resource.info - return [201, resource.to_json] + rc = resource.info + if OpenNebula.is_error?(rc) + return [201, "{\"#{kind.upcase}\": {\"ID\": \"#{resource.id}\"}}"] + else + return [201, resource.to_json] + end end end @@ -217,6 +221,7 @@ class SunstoneServer < CloudServer return [404, resource.to_json] end rc = resource.perform_action(action_json) + if OpenNebula.is_error?(rc) return [500, rc.to_json] else