diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index a29d008633..cbfba2e527 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -27,9 +27,6 @@ class SunstoneServer < CloudServer # FLAG that will filter the elements retrieved from the Pools POOL_FILTER = Pool::INFO_ALL - # Secs to sleep between checks to see if image upload to repo is finished - IMAGE_POLL_SLEEP_TIME = 5 - def initialize(client, config, logger) super(config, logger) @client = client @@ -167,12 +164,12 @@ class SunstoneServer < CloudServer return [500, rc.to_json] end - image.info - #wait until image is ready to return - while (image.state_str == 'LOCKED') && (image['RUNNING_VMS'] == '0') do - sleep IMAGE_POLL_SLEEP_TIME - image.info + rc = image.info + + if OpenNebula.is_error?(rc) + return [500, rc.to_json] end + return [201, image.to_json] end diff --git a/src/sunstone/public/app/tabs/files-tab/form-panels/create.js b/src/sunstone/public/app/tabs/files-tab/form-panels/create.js index e005c925c8..1af1cfbab2 100644 --- a/src/sunstone/public/app/tabs/files-tab/form-panels/create.js +++ b/src/sunstone/public/app/tabs/files-tab/form-panels/create.js @@ -251,8 +251,8 @@ define(function(require) { file: file.fileName, tempfile: file.uniqueIdentifier }, - success: function() { - Notifier.notifyMessage("Image uploaded correctly"); + success: function(response) { + Notifier.notifyCustom(Locale.tr("Image uploaded correctly"), " ID: " + response.IMAGE.ID, false); $('div[id="files-' + file.fileName + 'progressBar"]').remove(); Sunstone.runAction("File.refresh"); }, diff --git a/src/sunstone/public/app/tabs/images-tab/form-panels/create.js b/src/sunstone/public/app/tabs/images-tab/form-panels/create.js index cb93342f0a..a2cd6f2941 100644 --- a/src/sunstone/public/app/tabs/images-tab/form-panels/create.js +++ b/src/sunstone/public/app/tabs/images-tab/form-panels/create.js @@ -401,8 +401,8 @@ define(function(require) { file: file.fileName, tempfile: file.uniqueIdentifier }, - success: function() { - Notifier.notifyMessage("Image uploaded correctly"); + success: function(response) { + Notifier.notifyCustom(Locale.tr("Image uploaded correctly"), " ID: " + response.IMAGE.ID, false); $('div[id="' + file.fileName + 'progressBar"]').remove(); Sunstone.runAction("Image.refresh"); },