Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit b0c5b62

Browse files
authored
Merge pull request #16 from abaez/add-policy-name-lookup
Add get policy by name
2 parents 64aed2c + d1ff0c7 commit b0c5b62

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

consul/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,8 +957,8 @@ def create(self, name, description=None,
957957
headers=headers,
958958
data=json.dumps(payload))
959959

960-
def get(self, policy_id, token=None):
961-
path = '/v1/acl/policy/%s' % policy_id
960+
def get(self, policy_id=None, name=None, token=None):
961+
path = '/v1/acl/policy/%s' % (policy_id or 'name/' + name)
962962
headers = {}
963963
token = token or self.agent.token
964964
if token:

0 commit comments

Comments
 (0)