Exemplo n.º 1
0
    def test_share_revert(self):
        share = 'fake_share'
        snapshot = 'fake_snapshot'

        api.share_revert(self.request, share, snapshot)

        self.manilaclient.shares.revert_to_snapshot.assert_called_once_with(
            share, snapshot)
Exemplo n.º 2
0
    def test_share_revert(self):
        share = 'fake_share'
        snapshot = 'fake_snapshot'

        api.share_revert(self.request, share, snapshot)

        self.manilaclient.shares.revert_to_snapshot.assert_called_once_with(
            share, snapshot)
Exemplo n.º 3
0
 def handle(self, request, data):
     share_id = self.initial['share_id']
     snapshot_id = data['snapshot']
     try:
         manila.share_revert(request, share_id, snapshot_id)
         message = _('Share "%(s)s" has been reverted to "%(ss)s" snapshot '
                     'successfully') % {'s': share_id, 'ss': snapshot_id}
         messages.success(request, message)
         return True
     except Exception:
         redirect = reverse("horizon:project:shares:index")
         exceptions.handle(
             request,
             _('Unable to revert share to the snapshot.'),
             redirect=redirect)
Exemplo n.º 4
0
 def handle(self, request, data):
     share_id = self.initial['share_id']
     snapshot_id = data['snapshot']
     try:
         manila.share_revert(request, share_id, snapshot_id)
         message = _('Share "%(s)s" has been reverted to "%(ss)s" snapshot '
                     'successfully') % {'s': share_id, 'ss': snapshot_id}
         messages.success(request, message)
         return True
     except Exception:
         redirect = reverse("horizon:project:shares:index")
         exceptions.handle(
             request,
             _('Unable to revert share to the snapshot.'),
             redirect=redirect)