added version info and removed 'bare' exception

pull/43056/head
Brian Coca 6 years ago
parent 5385de4bfd
commit 522c245ee7

@ -40,6 +40,7 @@ options:
type: type:
description: description:
- Type of database object to set privileges on. - Type of database object to set privileges on.
- The `default_prives` choice is available starting at version 2.7.
default: table default: table
choices: [table, sequence, function, database, choices: [table, sequence, function, database,
schema, language, tablespace, group, schema, language, tablespace, group,
@ -227,6 +228,7 @@ EXAMPLES = """
type: database type: database
role: librarian role: librarian
# Available since version 2.7
# ALTER DEFAULT PRIVILEGES ON DATABASE library TO librarian # ALTER DEFAULT PRIVILEGES ON DATABASE library TO librarian
# Objs must be set, ALL_DEFAULT to TABLES/SEQUENCES/TYPES/FUNCTIONS # Objs must be set, ALL_DEFAULT to TABLES/SEQUENCES/TYPES/FUNCTIONS
# ALL_DEFAULT works only with privs=ALL # ALL_DEFAULT works only with privs=ALL
@ -239,6 +241,7 @@ EXAMPLES = """
role: librarian role: librarian
grant_option: yes grant_option: yes
# Available since version 2.7
# ALTER DEFAULT PRIVILEGES ON DATABASE library TO reader # ALTER DEFAULT PRIVILEGES ON DATABASE library TO reader
# Objs must be set, ALL_DEFAULT to TABLES/SEQUENCES/TYPES/FUNCTIONS # Objs must be set, ALL_DEFAULT to TABLES/SEQUENCES/TYPES/FUNCTIONS
# ALL_DEFAULT works only with privs=ALL # ALL_DEFAULT works only with privs=ALL
@ -507,7 +510,7 @@ class Connection(object):
for obj in objs: for obj in objs:
try: try:
f, args = obj.split('(', 1) f, args = obj.split('(', 1)
except: except Exception:
raise Error('Illegal function signature: "%s".' % obj) raise Error('Illegal function signature: "%s".' % obj)
obj_ids.append('"%s"."%s"(%s' % (schema_qualifier, f, args)) obj_ids.append('"%s"."%s"(%s' % (schema_qualifier, f, args))
elif obj_type in ['table', 'sequence']: elif obj_type in ['table', 'sequence']:

Loading…
Cancel
Save