Skip to content

Commit

Permalink
Merge pull request #860 from globocom/hot_fix_backup_dccm
Browse files Browse the repository at this point in the history
hot fix backup dccm
  • Loading branch information
nimbfire authored Apr 13, 2023
2 parents 61dd67a + 60a83a5 commit fe81dab
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions dbaas/backup/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ def unlock_instance(driver, instance, client):
return False


def make_instance_old_snapshot_backup(instance, error, group,
provider_class=VolumeProviderSnapshot,
target_volume=None,
current_hour=None,
task=None,
persist=0):
def make_instance_dccm_snapshot_backup(instance, error, group,
provider_class=VolumeProviderSnapshot,
target_volume=None,
current_hour=None,
task=None,
persist=0):
LOG.info("Make instance backup for {}".format(instance))
provider = provider_class(instance)
infra = instance.databaseinfra
Expand Down Expand Up @@ -211,7 +211,8 @@ def make_instance_old_snapshot_backup(instance, error, group,

return snapshot

def make_instance_snapshot_backup(

def make_instance_gcp_snapshot_backup(
instance, error, group, provider_class=VolumeProviderSnapshot, target_volume=None,
current_hour=None, task=None, persist=0
):
Expand Down Expand Up @@ -350,6 +351,30 @@ def make_instance_snapshot_backup(
return snapshot


def make_instance_snapshot_backup(instance, error, group,
provider_class=VolumeProviderSnapshot,
target_volume=None,
current_hour=None,
task=None,
persist=0):
infra = instance.databaseinfra
env = infra.environment
if env.name == 'prod':
return make_instance_dccm_snapshot_backup(instance, error, group,
provider_class=provider_class,
target_volume=target_volume,
current_hour=current_hour,
task=task,
persist=persist)
else:
return make_instance_gcp_snapshot_backup(instance, error, group,
provider_class=provider_class,
target_volume=target_volume,
current_hour=current_hour,
task=task,
persist=persist)


def make_instance_snapshot_backup_upgrade_disk(instance, error, group, provider_class=VolumeProviderSnapshot,
target_volume=None,
current_hour=None):
Expand Down

0 comments on commit fe81dab

Please sign in to comment.