B #5110: race condition vdc (#266)

Signed-off-by: Jorge Lobo <jlobo@opennebula.io>
(cherry picked from commit f4dc20b187)
This commit is contained in:
Jorge Miguel Lobo Escalona authored and Tino Vazquez committed 2020-09-29 14:42:50 +02:00
1 parent 01653bdcf1
commit 54c0ae12ff
1 file changed
+7 -2
+7 -2
View File
@@ -140,8 +140,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
@@ -219,6 +223,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