From fe4081c7d3428ebc543330c3fa7b14278cb12dd1 Mon Sep 17 00:00:00 2001 From: ssamson-tis Date: Wed, 30 Sep 2015 16:14:25 +0200 Subject: [PATCH] change method to list all postgres databases --- libtisbackup/backup_pgsql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtisbackup/backup_pgsql.py b/libtisbackup/backup_pgsql.py index 53806e5..bbe6bd6 100644 --- a/libtisbackup/backup_pgsql.py +++ b/libtisbackup/backup_pgsql.py @@ -70,7 +70,7 @@ class backup_pgsql(backup_generic): else: stats['log']= "Successfully backuping processed to the following databases :" stats['status']='List' - cmd = "su - postgres -c 'psql -l -t' | cut -d'|' -f1 | sed -e 's/ //g' -e '/^$/d'" + cmd = """su - postgres -c 'psql -t -c "SELECT datname FROM pg_database WHERE datistemplate = false;"'""" self.logger.debug('[%s] List databases: %s',self.backup_name,cmd) (error_code,output) = ssh_exec(cmd,ssh=self.ssh) self.logger.debug("[%s] Output of %s :\n%s",self.backup_name,cmd,output)