Example #1
0
 def delete(self, request, obj_id):
     obj = self.table.get_object_by_id(obj_id)
     name = self.table.get_object_display(obj)
     try:
         manila.share_group_snapshot_delete(request, obj_id)
     except Exception:
         msg = _('Unable to delete share group snapshot "%s". '
                 'One or more share groups depend on it.')
         exceptions.check_message(["snapshots", "dependent"], msg % name)
         raise
Example #2
0
 def delete(self, request, obj_id):
     obj = self.table.get_object_by_id(obj_id)
     name = self.table.get_object_display(obj)
     try:
         manila.share_group_snapshot_delete(request, obj_id)
     except Exception:
         msg = _('Unable to delete share group snapshot "%s". '
                 'One or more share groups depend on it.')
         exceptions.check_message(["snapshots", "dependent"], msg % name)
         raise
Example #3
0
    def test_share_group_snapshot_delete(self, force):
        sgs = 'fake_share_group_snapshot'

        result = api.share_group_snapshot_delete(self.request, sgs, force)

        self.assertIsNotNone(result)
        self.assertEqual(
            self.manilaclient.share_group_snapshots.delete.return_value,
            result)
        self.manilaclient.share_group_snapshots.delete.assert_called_once_with(
            sgs, force=force)
Example #4
0
    def test_share_group_snapshot_delete(self, force):
        sgs = 'fake_share_group_snapshot'

        result = api.share_group_snapshot_delete(self.request, sgs, force)

        self.assertIsNotNone(result)
        self.assertEqual(
            self.manilaclient.share_group_snapshots.delete.return_value,
            result)
        self.manilaclient.share_group_snapshots.delete.assert_called_once_with(
            sgs, force=force)