import glob
import httplib2
import os
-import pipes
import random
import re
+import shlex
import shutil
import signal
import socket
resdir = subprocess.check_output(['bundle', 'exec', 'passenger-config', 'about', 'resourcesdir']).decode().rstrip()
with open(resdir + '/templates/standalone/config.erb') as f:
template = f.read()
- newtemplate = re.sub('http {', 'http {\n passenger_stat_throttle_rate 0;', template)
+ newtemplate = re.sub(r'http \{', 'http {\n passenger_stat_throttle_rate 0;', template)
if newtemplate == template:
raise "template edit failed"
with open('tmp/passenger-nginx.conf.erb', 'w') as f:
host = os.environ['ARVADOS_API_HOST']
if args.auth is not None:
token = auth_token(args.auth)
- print("export ARVADOS_API_TOKEN={}".format(pipes.quote(token)))
- print("export ARVADOS_API_HOST={}".format(pipes.quote(host)))
+ print("export ARVADOS_API_TOKEN={}".format(shlex.quote(token)))
+ print("export ARVADOS_API_HOST={}".format(shlex.quote(host)))
print("export ARVADOS_API_HOST_INSECURE=true")
else:
print(host)