Fixed SQL query.

This commit is contained in:
Antoine Nguyen
2017-03-03 18:34:50 +01:00
parent 4b3d812a68
commit 5de629cfd1
2 changed files with 24 additions and 17 deletions

View File

@@ -61,8 +61,8 @@ class PostgreSQL(Database):
if dbname and dbuser:
self._setup_pgpass(dbname, dbuser, dbpassword)
cmd += " -h {} -d {} -U {} -w".format(self.dbhost, dbname, dbuser)
utils.exec_cmd(
"""{} -c "{}" """.format(cmd, query), sudo_user=self.dbuser)
cmd = "{} -c '{}' ".format(cmd, query)
utils.exec_cmd(cmd, sudo_user=self.dbuser)
def create_user(self, name, password):
"""Create a user."""