Skip to content

Commit 58ca6cb

Browse files
committed
Merge pull request alphagov#142 from alphagov/fix-home-directory-warnings
Fix warnings from ssh user home directory
2 parents e475886 + bff0463 commit 58ca6cb

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

performanceplatform.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from fabric.api import (cd, task, hosts, sudo)
1+
from fabric.api import (task, hosts, run)
22

33

44
@task
@@ -24,8 +24,4 @@ def unpublish_dashboard(slug):
2424

2525

2626
def run_stagecraft_postgres_command(sql_command):
27-
with cd('/'):
28-
# Run this command from the root directory so that we don't see errors
29-
# accessing the users
30-
# home directory as the postgres user.
31-
sudo('psql stagecraft -c "{0}"'.format(sql_command), user='postgres')
27+
run('sudo -iu postgres psql stagecraft -c "{0}"'.format(sql_command))

0 commit comments

Comments
 (0)