Esempio n. 1
0
    def test_reboot_instance(self):
        server = self.servers.first()

        api.flavor_list(IsA(http.HttpRequest)).AndReturn(self.flavors.list())
        api.server_list(IsA(http.HttpRequest)).AndReturn(self.servers.list())
        api.server_reboot(IsA(http.HttpRequest), server.id)

        self.mox.ReplayAll()

        formData = {'action': 'instances__reboot__%s' % server.id}
        res = self.client.post(INDEX_URL, formData)

        self.assertRedirectsNoFollow(res, INDEX_URL)
Esempio n. 2
0
    def test_reboot_instance(self):
        server = self.servers.first()

        api.flavor_list(IsA(http.HttpRequest)).AndReturn(self.flavors.list())
        api.server_list(IsA(http.HttpRequest)).AndReturn(self.servers.list())
        api.server_reboot(IsA(http.HttpRequest), server.id)

        self.mox.ReplayAll()

        formData = {'action': 'instances__reboot__%s' % server.id}
        res = self.client.post(INDEX_URL, formData)

        self.assertRedirectsNoFollow(res, INDEX_URL)
 def handle(self, request, data):
     instance_id = data['instance']
     try:
         server = api.server_reboot(request, instance_id)
         messages.success(request, "Instance rebooting")
     except api_exceptions.ApiException, e:
         LOG.error('ApiException while rebooting instance "%s"' %
                   instance_id, exc_info=True)
         messages.error(request,
                    'Unable to reboot instance: %s' % e.message)
Esempio n. 4
0
 def action(self, request, obj_id):
     api.server_reboot(request, obj_id)
Esempio n. 5
0
 def action(self, request, obj_id):
     api.server_reboot(request, obj_id)