コード例 #1
0
ファイル: forms.py プロジェクト: hightall/horizon
 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)
コード例 #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
コード例 #3
0
ファイル: forms.py プロジェクト: gabrielhurley/horizon
 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
コード例 #4
0
ファイル: tests.py プロジェクト: kadams54/horizon
    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)
コード例 #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)
コード例 #6
0
ファイル: tests.py プロジェクト: yvesjunior/openstack_tracing
    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)
コード例 #7
0
ファイル: tests.py プロジェクト: victordengsz/horizon
    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)