Get rid of postgres warning
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
parent
e18ba2107b
commit
b6f06b4a27
1 changed files with 2 additions and 1 deletions
|
@ -46,7 +46,8 @@ TO '{tmpfile}' delimiter ',' CSV header;
|
|||
query = query.format(username=username, tmpfile=tempfilename)
|
||||
command = ['sudo', '-u', 'postgres', 'psql', 'datanommer', '-c', '"%s"' % query]
|
||||
subprocess.check_call(
|
||||
' '.join(command), shell=True, stdout=subprocess.PIPE)
|
||||
' '.join(command), shell=True, stdout=subprocess.PIPE,
|
||||
cwd='/tmp')
|
||||
with open(tempfilename) as stream:
|
||||
data = stream.read()
|
||||
os.unlink(tempfilename)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue