Coverage for manila/data/backup_driver.py: 67%

15 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2026-02-18 22:19 +0000

1# Copyright 2023 Cloudification GmbH. 

2# All Rights Reserved. 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"); you may 

5# not use this file except in compliance with the License. You may obtain 

6# a copy of the License at 

7# 

8# http://www.apache.org/licenses/LICENSE-2.0 

9# 

10# Unless required by applicable law or agreed to in writing, software 

11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 

12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 

13# License for the specific language governing permissions and limitations 

14# under the License. 

15 

16"""Base class for all backup drivers.""" 

17 

18 

19class BackupDriver(object): 

20 

21 def __init__(self): 

22 super(BackupDriver, self).__init__() 

23 

24 # This flag indicates if backup driver implement backup, restore and 

25 # delete operation by its own or uses data manager. 

26 self.use_data_manager = True 

27 

28 # This flag indicates if the backup driver supports out of place 

29 # restores to a share other then the source of a given backup. 

30 self.restore_to_target_support = False 

31 

32 def backup(self, context, backup, share): 

33 """Start a backup of a specified share.""" 

34 return 

35 

36 def restore(self, context, backup, share): 

37 """Restore a saved backup.""" 

38 return 

39 

40 def delete(self, context, backup): 

41 """Delete a saved backup.""" 

42 return 

43 

44 def get_backup_progress(self, context, backup, share): 

45 """Fetch the progress of a in progress backup""" 

46 return 

47 

48 def get_restore_progress(self, context, backup, share): 

49 """Fetch the progress of a in progress restore""" 

50 return