def reset_hba(self):
        """Remove all records from pg_hba.conf."""
        status = self.get_status()
        if status == 'not-initialized':
            raise ClusterError(
                'cannot modify HBA records: cluster is not initialized')

        pg_hba = os.path.join(self._data_dir, 'pg_hba.conf')

        try:
            with open(pg_hba, 'w'):
                pass
        except IOError as e:
            raise ClusterError(
                'cannot modify HBA records: {}'.format(e)) from e
def reset_hba ( self ) : status = self . get_status ( ) if status == 'not-initialized' : raise ClusterError ( 'cannot modify HBA records: cluster is not initialized' ) pg_hba = os . path . join ( self . _data_dir , 'pg_hba.conf' ) try : with open ( pg_hba , 'w' ) : pass except IOError as e : raise ClusterError ( 'cannot modify HBA records: {}' . format ( e ) ) from e
Remove all records from pg_hba.conf.