How to use the pgctl.configsearch.glob function in pgctl

To help you get started, we’ve selected a few pgctl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Yelp / pgctl / tests / unit / configsearch.py View on Github external
def it_globs_files(self, tmpdir):
        tmpdir.ensure('a/file.1')
        tmpdir.ensure('d/file.4')
        with tmpdir.as_cwd():
            assert list(configsearch.glob('*/file.*')) == ['a/file.1', 'd/file.4']
github Yelp / pgctl / pgctl / config.py View on Github external
def from_glob(self, pattern):
        from pgctl.configsearch import glob
        results = []
        for fname in glob(pattern):
            try:
                config = self.from_file(fname)
            except UnrecognizedConfig:
                continue
            else:
                results.append(config)

        if len(results) == 1:
            return results[0]
        elif len(results) > 1:
            raise AmbiguousConfig('multiple configurations found at %s' % pattern)