MCPcopy Index your code
hub / github.com/MagicStack/asyncpg / reset_hba

Method reset_hba

asyncpg/cluster.py:367–381  ·  view source on GitHub ↗

Remove all records from pg_hba.conf.

(self)

Source from the content-addressed store, hash-verified

365 process.returncode, stderr.decode()))
366
367 def reset_hba(self):
368 """Remove all records from pg_hba.conf."""
369 status = self.get_status()
370 if status == 'not-initialized':
371 raise ClusterError(
372 'cannot modify HBA records: cluster is not initialized')
373
374 pg_hba = os.path.join(self._data_dir, 'pg_hba.conf')
375
376 try:
377 with open(pg_hba, 'w'):
378 pass
379 except IOError as e:
380 raise ClusterError(
381 'cannot modify HBA records: {}'.format(e)) from e
382
383 def add_hba_entry(self, *, type='host', database, user, address=None,
384 auth_method, auth_options=None):

Callers 4

test_pool_authMethod · 0.45
setUpMethod · 0.45
setUpMethod · 0.45

Calls 2

get_statusMethod · 0.95
ClusterErrorClass · 0.85

Tested by 3

test_pool_authMethod · 0.36
setUpMethod · 0.36
setUpMethod · 0.36