~edwargix/git.sr.ht

6a656f514a27944078135c19ec2d102bde6ddd5f — Drew DeVault 3 years ago 604eb6b
Fix some issues from minio upgrades

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

ಠ_ಠ
2 files changed, 2 insertions(+), 5 deletions(-)

M gitsrht/blueprints/artifacts.py
M gitsrht/repos.py
M gitsrht/blueprints/artifacts.py => gitsrht/blueprints/artifacts.py +0 -1
@@ 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

M gitsrht/repos.py => gitsrht/repos.py +2 -4
@@ 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)