setup_iis.py 627 B

12345678910111213141516171819202122
  1. import subprocess
  2. import sys
  3. import setup_util
  4. import os
  5. def start(args, logfile, errfile):
  6. if os.name != 'nt':
  7. return 1
  8. try:
  9. setup_util.replace_text("aspnet-stripped/src/Web.config", "localhost", args.database_host)
  10. subprocess.check_call("powershell -Command .\\setup_iis.ps1 start", cwd="aspnet-stripped", stderr=errfile, stdout=logfile)
  11. return 0
  12. except subprocess.CalledProcessError:
  13. return 1
  14. def stop(logfile, errfile):
  15. if os.name != 'nt':
  16. return 0
  17. subprocess.check_call("powershell -Command .\\setup_iis.ps1 stop", cwd="aspnet-stripped", stderr=errfile, stdout=logfile)
  18. return 0