minio / minio-py

MinIO Client SDK for Python
https://docs.min.io/docs/python-client-quickstart-guide.html
Apache License 2.0
852 stars 325 forks source link

MinioAdmin.policy_add() triggers an mc deprecation error #1293

Closed ctengel closed 1 year ago

ctengel commented 1 year ago

Upon calling

minio.MinioAdmin().policy_add()

The following error is returned: subprocess.CalledProcessError: Command '['/home/minio/mc', '--json', 'admin', 'policy', 'add', 'alias', 'policy', 'policy.json']' returned non-zero exit status 1.

Upon closer investigation, it appears that mc admin policy add is being run, and on recent versions of mc, the following error is returned from that mc: <ERROR> Deprecated command. Please use 'mc admin policy create' instead.

minio-py version 7.1.5 ; mc version RELEASE.2023-08-08T17-23-59Z

Assuming this was a recent change to mc, I am guessing minio-py`s minioadmin.py needs to be slightly changed to accommodate this.

ctengel commented 1 year ago

See minio/mc#4428 and minio/mc#4498

balamurugana commented 1 year ago

Feel free to send a PR

ctengel commented 1 year ago

Good news - looks like it has already been fixed by #1277

Perhaps a new release is in order so that way those who are installing this via pip etc can benefit from the fix?

balamurugana commented 1 year ago

Stay tuned!