/silverlining/mgr-scripts/get-application.py

https://bitbucket.org/ianb/silverlining/ · Python · 17 lines · 11 code · 4 blank · 2 comment · 1 complexity · dd6b136437026c6e7c58686c3029f979 MD5 · raw file

  1. #!/usr/bin/env python
  2. """Find the application for a location"""
  3. import sys
  4. sys.path.insert(0, '/usr/local/share/silverlining/lib')
  5. from silversupport import appdata
  6. def main():
  7. hostname, path = appdata.normalize_location(sys.argv[1])
  8. instance = appdata.instance_for_location(hostname, path)
  9. appname = instance.split('.')[0]
  10. print appname
  11. return 0
  12. if __name__ == '__main__':
  13. sys.exit(main())