PageRenderTime 92ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/silverlining/mgr-scripts/update-appdata.py

https://bitbucket.org/ianb/silverlining/
Python | 27 lines | 25 code | 1 blank | 1 comment | 1 complexity | 34f3bbd1ec092bde093dada6a95f981d MD5 | raw file
Possible License(s): GPL-2.0
  1. #!/usr/bin/env python
  2. import sys
  3. sys.path.insert(0, '/usr/local/share/silverlining/lib')
  4. from silversupport.appdata import add_appdata
  5. from silversupport.appconfig import AppConfig
  6. from optparse import OptionParser
  7. parser = OptionParser(
  8. usage="%prog INSTANCE_NAME LOCATION1 LOCATION2 ...",
  9. description="""\
  10. Updates /var/www/appdata.map
  11. This sets the new hostname(s) (HOSTNAME1 etc) to point to INSTANCE_NAME.
  12. Also the app.ini is read to write other metadata that Apache reads.
  13. """)
  14. parser.add_option(
  15. '--debug-single-process',
  16. action='store_true',
  17. help="Deploy the app as a single-process threaded app for debugging")
  18. if __name__ == '__main__':
  19. options, args = parser.parse_args()
  20. instance_name = args[0]
  21. app_config = AppConfig.from_instance_name(instance_name)
  22. add_appdata(app_config, args[1:], debug_single_process=options.debug_single_process)
  23. if app_config.platform == 'php':
  24. app_config.write_php_env()