summaryrefslogtreecommitdiff
path: root/python/skytools/dbstruct.py
diff options
context:
space:
mode:
authorMarko Kreen2010-12-08 14:39:37 +0000
committerMarko Kreen2010-12-08 14:39:37 +0000
commite7ed54e08264a05a416dca6e16e97bef5c5ef1fb (patch)
tree143349ad67ec4690596e6e3e3202e67363f2e05d /python/skytools/dbstruct.py
parenta8b1420a0c234621f4dc55d8a9b50fa4b6f2220e (diff)
dbstruct: use new acl parser
Diffstat (limited to 'python/skytools/dbstruct.py')
-rw-r--r--python/skytools/dbstruct.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/python/skytools/dbstruct.py b/python/skytools/dbstruct.py
index 4c27b840..202b8058 100644
--- a/python/skytools/dbstruct.py
+++ b/python/skytools/dbstruct.py
@@ -4,7 +4,9 @@
import re
from skytools.sqltools import fq_name_parts, get_table_oid
-from skytools.quoting import quote_ident, quote_fqident, quote_literal, unquote_fqident
+from skytools.quoting import quote_ident, quote_fqident, quote_literal
+from skytools.quoting import unquote_ident, unquote_fqident
+from skytools.parsing import parse_pgarray, parse_acl
__all__ = ['TableStruct', 'SeqStruct',
'T_TABLE', 'T_CONSTRAINT', 'T_INDEX', 'T_TRIGGER',
@@ -291,13 +293,12 @@ class TGrant(TElem):
"""Parse ACL to tuple of (user, acl, who)"""
if relacl is None:
return []
- if len(relacl) > 0 and relacl[0] == '{' and relacl[-1] == '}':
- relacl = relacl[1:-1]
tup_list = []
- for f in relacl.split(','):
- user, tmp = f.strip('"').split('=')
- acl, who = tmp.split('/')
- tup_list.append((user, acl, who))
+ for sacl in parse_pgarray(relacl):
+ acl = parse_acl(sacl)
+ if not acl:
+ continue
+ tup_list.append(acl)
return tup_list
def __init__(self, table_name, row, new_name = None):