mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
provision: Rewrite using subprocess module instead of sh.
The `with sh.sudo` pattern that we were using in python-sh was deprecated, and emperically hangs on Ubuntu xenial. Since in general the use of python-sh/python-pbs caused trouble (requiring extra dependencies, confusing syntax), this just removes it. We replace it with a new zulip_tools.py library function that echoes the command line and streams the output. We do the same to install-phantomjs so we can remove that dependency.
This commit is contained in:
@@ -5,6 +5,7 @@ import errno
|
||||
import os
|
||||
import pwd
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
@@ -67,3 +68,12 @@ def get_deployment_lock(error_rerun_script):
|
||||
|
||||
def release_deployment_lock():
|
||||
shutil.rmtree(LOCK_DIR)
|
||||
|
||||
def run(args):
|
||||
# Output what we're doing in the `set -x` style
|
||||
print("+ %s" % (" ".join(args)))
|
||||
process = subprocess.Popen(args)
|
||||
rc = process.wait()
|
||||
if rc:
|
||||
raise subprocess.CalledProcessError(rc, args)
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user