|
254 | 254 |
|
255 | 255 |
|
256 | 256 | from ansible.module_utils.basic import AnsibleModule |
257 | | -from ansible.module_utils.six import iteritems |
258 | 257 | from ansible_collections.community.postgresql.plugins.module_utils.database import ( |
259 | 258 | check_input, pg_quote_identifier) |
260 | 259 | from ansible_collections.community.postgresql.plugins.module_utils.postgres import ( |
@@ -328,7 +327,7 @@ def transform_rowfilters_keys(rowfilters): |
328 | 327 | rowfilters (dict): Changed dict. |
329 | 328 | """ |
330 | 329 | revmap_filters = {} |
331 | | - for table, fltr in iteritems(rowfilters): |
| 330 | + for table, fltr in rowfilters.items(): |
332 | 331 | fltr = fltr.strip() |
333 | 332 | if fltr: |
334 | 333 | if fltr[:5].lower() == 'where': |
@@ -521,7 +520,7 @@ def create(self, tables, tables_in_schema, columns, rowfilters, params, owner, c |
521 | 520 | if params: |
522 | 521 | params_list = [] |
523 | 522 | # Make list ["param = 'value'", ...] from params dict: |
524 | | - for (key, val) in iteritems(params): |
| 523 | + for (key, val) in params.items(): |
525 | 524 | params_list.append("%s = '%s'" % (key, val)) |
526 | 525 |
|
527 | 526 | # Add the list to query_fragments: |
@@ -634,7 +633,7 @@ def update(self, tables, tables_in_schema, columns, rowfilters, params, owner, c |
634 | 633 |
|
635 | 634 | # Update pub parameters: |
636 | 635 | if params: |
637 | | - for key, val in iteritems(params): |
| 636 | + for key, val in params.items(): |
638 | 637 | if self.attrs['parameters'].get(key): |
639 | 638 |
|
640 | 639 | # In PostgreSQL 10/11 only 'publish' optional parameter is presented. |
@@ -875,7 +874,7 @@ def __pub_set_columns(self, columns_map, rowfilters, check_mode=False): |
875 | 874 | True if successful, False otherwise. |
876 | 875 | """ |
877 | 876 | table_list = [] |
878 | | - for table, columns in iteritems(columns_map): |
| 877 | + for table, columns in columns_map.items(): |
879 | 878 | quoted_cols = pg_quote_column_list(table, columns) |
880 | 879 | if table in rowfilters: |
881 | 880 | quoted_cols += (" WHERE %s" % rowfilters[table]) |
@@ -1035,7 +1034,7 @@ def main(): |
1035 | 1034 | if not params: |
1036 | 1035 | params_list = None |
1037 | 1036 | else: |
1038 | | - params_list = ['%s = %s' % (k, v) for k, v in iteritems(params)] |
| 1037 | + params_list = ['%s = %s' % (k, v) for k, v in params.items()] |
1039 | 1038 |
|
1040 | 1039 | check_input(module, name, tables, owner, |
1041 | 1040 | session_role, params_list, comment) |
|
0 commit comments