Only ask for bash on OS X

This commit is contained in:
Brandon Kreisel
2015-10-04 20:07:00 -04:00
parent a4d0188d21
commit 034af2003c
+7 -1
View File
@@ -154,12 +154,18 @@ binary for temporary key/certificate generation.""".replace("\n", "")
if self.conf("test-mode"): if self.conf("test-mode"):
logger.debug("Test mode. Executing the manual command: %s", command) logger.debug("Test mode. Executing the manual command: %s", command)
try: try:
# sh shipped with OS X does't support echo -n
if sys.platform == "darwin":
executable = "/bin/bash"
else:
executable = "/bin/sh"
self._httpd = subprocess.Popen( self._httpd = subprocess.Popen(
command, command,
# don't care about setting stdout and stderr, # don't care about setting stdout and stderr,
# we're in test mode anyway # we're in test mode anyway
shell=True, shell=True,
executable="/bin/bash", executable=executable,
# "preexec_fn" is UNIX specific, but so is "command" # "preexec_fn" is UNIX specific, but so is "command"
preexec_fn=os.setsid) preexec_fn=os.setsid)
except OSError as error: # ValueError should not happen! except OSError as error: # ValueError should not happen!