/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
- #!/usr/bin/env python
- """Find the application for a location"""
- import sys
- sys.path.insert(0, '/usr/local/share/silverlining/lib')
- from silversupport import appdata
- def main():
- hostname, path = appdata.normalize_location(sys.argv[1])
- instance = appdata.instance_for_location(hostname, path)
- appname = instance.split('.')[0]
- print appname
- return 0
- if __name__ == '__main__':
- sys.exit(main())