Update upload-pkg.py
This commit is contained in:
parent
1a3c297c9e
commit
6fb6d774d2
@ -34,11 +34,14 @@ def UploadFile(url: str, file: str, code: int = 201):
|
||||
with open(file, "rb") as f:
|
||||
res = put(url, f.read())
|
||||
text = GetReasonText(res)
|
||||
if res.status_code != code:
|
||||
raise RequestException(
|
||||
"upload %s status not %d: %d (%s)" %
|
||||
(file, code, res.status_code, text)
|
||||
)
|
||||
if res.status_code != code :
|
||||
if res.status_code == 409:
|
||||
info("target already exists; not overwritting")
|
||||
else
|
||||
raise RequestException(
|
||||
"upload %s status not %d: %d (%s)" %
|
||||
(file, code, res.status_code, text)
|
||||
)
|
||||
|
||||
|
||||
def UploadPackage(
|
||||
|
Loading…
Reference in New Issue
Block a user