Skip to content

Commit

Permalink
Fix user commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyh committed Oct 19, 2016
1 parent 48aa951 commit eb5913c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions datacube/index/postgres/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ def get_locations(self, dataset_id):
]

def __repr__(self):
return "PostgresDb<engine={!r}>".format(self._engine)
return "PostgresDb<connection={!r}>".format(self._connection)

def list_users(self):
result = self._connection.execute("""
Expand All @@ -850,10 +850,10 @@ def list_users(self):

def create_user(self, username, password, role):
pg_role = _to_pg_role(role)
tables.create_user(self._engine, username, password, pg_role)
tables.create_user(self._connection, username, password, pg_role)

def drop_user(self, username):
tables.drop_user(self._engine, username)
tables.drop_user(self._connection, username)

def grant_role(self, role, users):
"""
Expand All @@ -862,10 +862,10 @@ def grant_role(self, role, users):
pg_role = _to_pg_role(role)

for user in users:
if not tables.has_role(self._engine, user):
if not tables.has_role(self._connection, user):
raise ValueError('Unknown user %r' % user)

tables.grant_role(self._engine, pg_role, users)
tables.grant_role(self._connection, pg_role, users)


def _to_pg_role(role):
Expand Down

0 comments on commit eb5913c

Please sign in to comment.