MCPcopy
hub / github.com/MagicStack/asyncpg / _run_pg_config

Method _run_pg_config

asyncpg/cluster.py:545–561  ·  view source on GitHub ↗
(self, pg_config_path)

Source from the content-addressed store, hash-verified

543 return 'running'
544
545 def _run_pg_config(self, pg_config_path):
546 process = subprocess.run(
547 pg_config_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
548 stdout, stderr = process.stdout, process.stderr
549
550 if process.returncode != 0:
551 raise ClusterError('pg_config exited with status {:d}: {}'.format(
552 process.returncode, stderr))
553 else:
554 config = {}
555
556 for line in stdout.splitlines():
557 k, eq, v = line.decode('utf-8').partition('=')
558 if eq:
559 config[k.strip().lower()] = v.strip()
560
561 return config
562
563 def _find_pg_config(self, pg_config_path):
564 if pg_config_path is None:

Callers 1

_init_envMethod · 0.95

Calls 3

ClusterErrorClass · 0.85
runMethod · 0.80
lowerMethod · 0.80

Tested by

no test coverage detected