Skip to content

Commit

Permalink
Update deprecated mc admin commands (#1277)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrw authored May 21, 2023
1 parent 5347b25 commit d67d8fb
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit d67d8fb

Please sign in to comment.