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

Update deprecated mc admin policy commands #1277

Merged
merged 4 commits into from
May 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions minio/minioadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def group_list(self):
def policy_add(self, policy_name, policy_file):
"""Add new policy."""
return self._run(
["policy", "add", self._target, policy_name, policy_file],
["policy", "create", self._target, policy_name, policy_file],
)

def policy_remove(self, policy_name):
Expand All @@ -147,8 +147,8 @@ def policy_set(self, policy_name, user=None, group=None):
if (user is not None) ^ (group is not None):
return self._run(
[
"policy", "set", self._target, policy_name,
("user=" if user else "group=") + (user or group),
"policy", "attach", self._target, policy_name,
"--user" if user else "--group", user or group,
],
)
raise ValueError("either user or group must be set")
Expand All @@ -158,8 +158,8 @@ def policy_unset(self, policy_name, user=None, group=None):
if (user is not None) ^ (group is not None):
return self._run(
[
"policy", "unset", self._target, policy_name,
("user=" if user else "group=") + (user or group),
"policy", "detach", self._target, policy_name,
"--user" if user else "--group", user or group,
],
)
raise ValueError("either user or group must be set")
Expand Down