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:
return
stop_nginx()
nginxconf = {}
- nginxconf['UPSTREAMHOST'] = 'localhost'
- nginxconf['LISTENHOST'] = 'localhost'
+ nginxconf['UPSTREAMHOST'] = '127.0.0.1'
+ nginxconf['LISTENHOST'] = '127.0.0.1'
nginxconf['CONTROLLERPORT'] = internal_port_from_config("Controller")
nginxconf['ARVADOS_API_HOST'] = "0.0.0.0:" + str(external_port_from_config("Controller"))
nginxconf['CONTROLLERSSLPORT'] = external_port_from_config("Controller")
"SystemRootToken": auth_token('system_user'),
"API": {
"RequestTimeout": "30s",
+ "LockBeforeUpdate": True,
},
"Login": {
"Test": {
"GitInternalDir": os.path.join(SERVICES_SRC_DIR, 'api', 'tmp', 'internal.git'),
},
"LocalKeepBlobBuffersPerVCPU": 0,
+ "Logging": {
+ "SweepInterval": 0, # disable, otherwise test cases can't acquire dblock
+ },
"SupportedDockerImageFormats": {"v1": {}},
"ShellAccess": {
"Admin": True,
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)