From 6a656f514a27944078135c19ec2d102bde6ddd5f Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 19 Jan 2021 12:30:09 -0500 Subject: [PATCH] Fix some issues from minio upgrades MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Point out that minio-go lacks specific exceptions 2. Get told it's by design 3. Point out that Python offers specific exceptions 4. Specific exceptions are removed from Python ಠ_ಠ --- gitsrht/blueprints/artifacts.py | 1 - gitsrht/repos.py | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/gitsrht/blueprints/artifacts.py b/gitsrht/blueprints/artifacts.py index af2fc0e..916f6ae 100644 --- a/gitsrht/blueprints/artifacts.py +++ b/gitsrht/blueprints/artifacts.py @@ -7,7 +7,6 @@ from gitsrht.git import Repository as GitRepository from gitsrht.repos import delete_artifact, upload_artifact from gitsrht.types import Artifact from minio import Minio -from minio.error import BucketAlreadyOwnedByYou, BucketAlreadyExists from scmsrht.access import check_access, get_repo_or_redir, UserAccess from srht.config import cfg from srht.database import db diff --git a/gitsrht/repos.py b/gitsrht/repos.py index 8691969..74d1e1d 100644 --- a/gitsrht/repos.py +++ b/gitsrht/repos.py @@ -4,7 +4,6 @@ import pygit2 import subprocess from gitsrht.types import Artifact, Repository, Redirect from minio import Minio -from minio.error import BucketAlreadyOwnedByYou, BucketAlreadyExists, ResponseError from scmsrht.repos import SimpleRepoApi from srht.config import cfg from srht.database import db @@ -54,9 +53,8 @@ def upload_artifact(valid, repo, commit, f, filename): repo.owner.canonical_name, repo.name) try: minio.make_bucket(s3_bucket) - except BucketAlreadyOwnedByYou: - pass - except BucketAlreadyExists: + except: + # Thanks for not giving us more specific exceptions, minio pass sha = hashlib.sha256() buf = f.read(1024) -- 2.38.4