~hudson-openstack/nova/trunk

« back to all changes in this revision

Viewing changes to nova/api/openstack/servers.py

  • Committer: Tarmac
  • Author(s): matt.dietz at rackspace, matt.dietz at rackspace
  • Date: 2011-08-02 23:31:14 UTC
  • mfrom: (1353.1.4 lp819523)
  • Revision ID: tarmac-20110802233114-yag5czqdj2ox6wnk
Fixes lp819523

OS API Migrate is now an admin-only method

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
            'confirmResize': self._action_confirm_resize,
165
165
            'revertResize': self._action_revert_resize,
166
166
            'rebuild': self._action_rebuild,
167
 
            'migrate': self._action_migrate,
168
167
            'createImage': self._action_create_image,
169
168
        }
170
169
 
281
280
            raise exc.HTTPUnprocessableEntity()
282
281
        return webob.Response(status_int=202)
283
282
 
284
 
    def _action_migrate(self, input_dict, req, id):
285
 
        try:
286
 
            self.compute_api.resize(req.environ['nova.context'], id)
287
 
        except Exception, e:
288
 
            LOG.exception(_("Error in migrate %s"), e)
289
 
            raise exc.HTTPBadRequest()
290
 
        return webob.Response(status_int=202)
291
 
 
292
283
    @scheduler_api.redirect_handler
293
284
    def lock(self, req, id):
294
285
        """
415
406
        return webob.Response(status_int=202)
416
407
 
417
408
    @scheduler_api.redirect_handler
 
409
    def migrate(self, req, id):
 
410
        try:
 
411
            self.compute_api.resize(req.environ['nova.context'], id)
 
412
        except Exception, e:
 
413
            LOG.exception(_("Error in migrate %s"), e)
 
414
            raise exc.HTTPBadRequest()
 
415
        return webob.Response(status_int=202)
 
416
 
 
417
    @scheduler_api.redirect_handler
418
418
    def rescue(self, req, id):
419
419
        """Permit users to rescue the server."""
420
420
        context = req.environ["nova.context"]