def _is_running(self): '''Is there PostgreSQL instance running on a given host and port.''' LOG.debug('Checking if database is running at ' + self.host + ':' + str(self.port)) check_db = ['psql', '-U', self.user, '-l', '-p', str(self.port), '-h', self.host] err, code = util.call_command(check_db, self.run_env) return code == 0
def _is_running(self): """Is there PostgreSQL instance running on a given host and port.""" LOG.debug("Checking if database is running at " + self.host + ":" + str(self.port)) check_db = ["psql", "-U", self.user, "-l", "-p", str(self.port), "-h", self.host] err, code = util.call_command(check_db, self.run_env) return code == 0
def _initialize_database_data(self): """Initialize a PostgreSQL instance with initdb. """ LOG.debug('Initializing database at ' + self.path) init_db = ['initdb', '-U', self.user, '-D', self.path, '-E SQL_ASCII'] err, code = util.call_command(init_db, self.run_env) # logger -> print error return code == 0
def _initialize_database_data(self): '''Initialize a PostgreSQL instance with initdb. ''' LOG.debug('Initializing database at ' + self.path) init_db = ['initdb', '-U', self.user, '-D', self.path, '-E SQL_ASCII'] err, code = util.call_command(init_db, self.run_env) # logger -> print error return code == 0
def _initialize_database_data(self): """Initialize a PostgreSQL instance with initdb. """ LOG.debug("Initializing database at " + self.path) init_db = ["initdb", "-U", self.user, "-D", self.path, "-E SQL_ASCII"] err, code = util.call_command(init_db, self.run_env) # logger -> print error return code == 0
def _is_running(self): """Is there PostgreSQL instance running on a given host and port.""" LOG.debug('Checking if database is running at ' + self.host + ':' + str(self.port)) check_db = ['psql', '-U', self.user, '-c', 'SELECT version();', '-p', str(self.port), '-h', self.host, '-d', 'postgres'] err, code = util.call_command(check_db, self.run_env) return code == 0