Revision c60e021d

View differences:

src/sunstone/models/SunstoneServer.rb
27 27
    # FLAG that will filter the elements retrieved from the Pools
28 28
    POOL_FILTER = Pool::INFO_ALL
29 29

  
30
    # Secs to sleep between checks to see if image upload to repo is finished
31
    IMAGE_POLL_SLEEP_TIME = 5
32

  
30 33
    def initialize(client, config, logger)
31 34
        super(config, logger)
32 35
        @client = client
......
164 167
            return [500, rc.to_json]
165 168
        end
166 169

  
167
        rc = image.info
168

  
169
        if OpenNebula.is_error?(rc)
170
            return [500, rc.to_json]
170
        image.info
171
        #wait until image is ready to return
172
        while (image.state_str == 'LOCKED') && (image['RUNNING_VMS'] == '0') do
173
            sleep IMAGE_POLL_SLEEP_TIME
174
            image.info
171 175
        end
172

  
173 176
        return [201, image.to_json]
174 177
    end
175 178

  
src/sunstone/public/app/tabs/files-tab/form-panels/create.js
251 251
            file: file.fileName,
252 252
            tempfile: file.uniqueIdentifier
253 253
          },
254
          success: function(response) {
255
            Notifier.notifyCustom(Locale.tr("Image uploaded correctly"), " ID: " + response.IMAGE.ID, false);
254
          success: function() {
255
            Notifier.notifyMessage("Image uploaded correctly");
256 256
            $('div[id="files-' + file.fileName + 'progressBar"]').remove();
257 257
            Sunstone.runAction("File.refresh");
258 258
          },
src/sunstone/public/app/tabs/images-tab/form-panels/create.js
401 401
            file: file.fileName,
402 402
            tempfile: file.uniqueIdentifier
403 403
          },
404
          success: function(response) {
405
            Notifier.notifyCustom(Locale.tr("Image uploaded correctly"), " ID: " + response.IMAGE.ID, false);
404
          success: function() {
405
            Notifier.notifyMessage("Image uploaded correctly");
406 406
            $('div[id="' + file.fileName + 'progressBar"]').remove();
407 407
            Sunstone.runAction("Image.refresh");
408 408
          },

Also available in: Unified diff