Exemple #1
0
 def handle(self, request, data):
     try:
         cinder.volume_unmanage(request, self.initial["volume_id"])
         messages.success(request, _("Successfully sent the request to unmanage volume: %s") % data["name"])
         return True
     except Exception:
         redirect = reverse("horizon:admin:volumes:index")
         exceptions.handle(request, _("Unable to unmanage volume."), redirect=redirect)
Exemple #2
0
 def handle(self, request, data):
     try:
         cinder.volume_unmanage(request, self.initial['volume_id'])
         messages.success(
             request,
             _('Successfully sent the request to unmanage volume: %s') %
             data['name'])
         return True
     except Exception:
         exceptions.handle(request, _("Unable to unmanage volume."))
         return False
Exemple #3
0
 def handle(self, request, data):
     try:
         cinder.volume_unmanage(request, self.initial['volume_id'])
         messages.success(
             request,
             _('Successfully sent the request to unmanage volume: %s')
             % data['name'])
         return True
     except Exception:
         exceptions.handle(request, _("Unable to unmanage volume."))
         return False
Exemple #4
0
    def test_unmanage_volume(self):
        # important - need to get the v2 cinder volume which has host data
        volume_list = [x for x in self.cinder_volumes.list() if x.name == "v2_volume"]
        volume = volume_list[0]
        formData = {"volume_name": volume.name, "host_name": "host@backend-name#pool", "volume_id": volume.id}

        cinder.volume_get(IsA(http.HttpRequest), volume.id).AndReturn(volume)
        cinder.volume_unmanage(IsA(http.HttpRequest), volume.id).AndReturn(volume)
        self.mox.ReplayAll()
        res = self.client.post(reverse("horizon:admin:volumes:volumes:unmanage", args=(volume.id,)), formData)
        self.assertNoFormErrors(res)
Exemple #5
0
 def handle(self, request, data):
     try:
         cinder.volume_unmanage(request, self.initial['volume_id'])
         messages.success(
             request,
             _('Successfully sent the request to unmanage volume: %s')
             % data['name'])
         return True
     except Exception:
         redirect = reverse("horizon:admin:volumes:index")
         exceptions.handle(request, _("Unable to unmanage volume."),
                           redirect=redirect)
    def test_unmanage_volume(self):
        # important - need to get the v2 cinder volume which has host data
        volume_list = \
            filter(lambda x: x.name == 'v2_volume', self.cinder_volumes.list())
        volume = volume_list[0]
        formData = {'volume_name': volume.name,
                    'host_name': 'host@backend-name#pool',
                    'volume_id': volume.id}

        cinder.volume_get(IsA(http.HttpRequest), volume.id).AndReturn(volume)
        cinder.volume_unmanage(IsA(http.HttpRequest), volume.id).\
            AndReturn(volume)
        self.mox.ReplayAll()
        res = self.client.post(
            reverse('horizon:admin:volumes:volumes:unmanage',
                    args=(volume.id,)),
            formData)
        self.assertNoFormErrors(res)
Exemple #7
0
    def test_unmanage_volume(self):
        # important - need to get the v2 cinder volume which has host data
        volume_list = [x for x in self.cinder_volumes.list()
                       if x.name == 'v2_volume']
        volume = volume_list[0]
        formData = {'volume_name': volume.name,
                    'host_name': 'host@backend-name#pool',
                    'volume_id': volume.id}

        cinder.volume_get(IsA(http.HttpRequest), volume.id).AndReturn(volume)
        cinder.volume_unmanage(IsA(http.HttpRequest), volume.id). \
            AndReturn(volume)
        self.mox.ReplayAll()
        res = self.client.post(
            reverse('horizon:admin:volumes:unmanage',
                    args=(volume.id,)),
            formData)
        self.assertNoFormErrors(res)