Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: have the ability to upload to both a local and remote bucket, within the same schedule #33

Open
vrragosta opened this issue Nov 15, 2023 · 0 comments

Comments

@vrragosta
Copy link
Collaborator

Currently, per the logic in create_snapshot(), uploading to local vs remote buckets is mutually exclusive. There has been a request to permit both of these to be specified within the same schedule.

def create_snapshot(self, fs, name, access_point_name, upload):
    try:
        status = self.call_weka_api(method="snapshots_list", parms={'file_system': fs, 'name': name})
        if len(status) == 1:
            actions_log.info(f"Snapshot exists: {fs} - {name}")
            return
        created_snap = self.call_weka_api(method="snapshot_create", parms={
            "file_system": fs,
            "name": name,
            "access_point": access_point_name,
            "is_writable": False})
        if created_snap == None:
            actions_log.info(f"Snapshot exists: {fs} - {name}")
            log.info(f"   Snap {fs}/{name} already exists")
        else:
            actions_log.info(f"Created snap {fs} - {name}")
            log.info(f"   Snap {fs}/{name} created")
        upload_op = False
        if upload == True or str(upload).upper() == 'LOCAL':
            upload_op = "upload"
        elif str(upload).upper() == 'REMOTE':
            upload_op = "upload-remote"
        if upload_op:
            background.QueueOperation(self.weka_cluster, fs, name, upload_op)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant