mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 13:15:14 +09:00
Fix sunstone upload for images in locked_used state
This commit is contained in:
1 parent
c60e021dc4
commit
4c25cb4a4f
1 file changed
+12
-3
@@ -167,12 +167,21 @@ class SunstoneServer < CloudServer
|
||||
return [500, rc.to_json]
|
||||
end
|
||||
|
||||
image.info
|
||||
rc = image.info
|
||||
#wait until image is ready to return
|
||||
while (image.state_str == 'LOCKED') && (image['RUNNING_VMS'] == '0') do
|
||||
while ( !OpenNebula.is_error?(rc) &&
|
||||
(image.state_str == 'LOCKED' ||
|
||||
image.state_str == 'LOCKED_USED' ||
|
||||
image.state_str == 'LOCKED_USED_PERS') ) do
|
||||
|
||||
sleep IMAGE_POLL_SLEEP_TIME
|
||||
image.info
|
||||
rc = image.info
|
||||
end
|
||||
|
||||
if OpenNebula.is_error?(rc)
|
||||
return [404, rc.to_json]
|
||||
end
|
||||
|
||||
return [201, image.to_json]
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user