comparison piecrust/admin/siteinfo.py @ 1183:62900c42d6dd

admin: Don't pass a custom environment to sub-processes. Apparently I was trying to be too clever, it's causing problems in some cases.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 21 May 2020 22:10:04 -0700
parents 8af2ea1f5c34
children
comparison
equal deleted inserted replaced
1182:31e8ee0bf5b2 1183:62900c42d6dd
139 chef_path = os.path.realpath(os.path.join( 139 chef_path = os.path.realpath(os.path.join(
140 os.path.dirname(__file__), 140 os.path.dirname(__file__),
141 '../../chef.py')) 141 '../../chef.py'))
142 args = [sys.executable, chef_path] + args 142 args = [sys.executable, chef_path] + args
143 143
144 env = {}
145 for k, v in os.environ.items():
146 env[k] = v
147 env['PYTHONHOME'] = sys.prefix
148
149 logger.info("Running chef command: %s" % args) 144 logger.info("Running chef command: %s" % args)
150 proc = subprocess.Popen(args, cwd=self.root_dir, env=env) 145 proc = subprocess.Popen(args, cwd=self.root_dir)
151 logger.info("Chef process ID: %s" % proc.pid) 146 logger.info("Chef process ID: %s" % proc.pid)
152 return proc 147 return proc