PageRenderTime 71ms CodeModel.GetById 50ms app.highlight 2ms RepoModel.GetById 18ms app.codeStats 0ms

/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
 4import sys
 5sys.path.insert(0, '/usr/local/share/silverlining/lib')
 6from silversupport import appdata
 7
 8
 9def main():
10    hostname, path = appdata.normalize_location(sys.argv[1])
11    instance = appdata.instance_for_location(hostname, path)
12    appname = instance.split('.')[0]
13    print appname
14    return 0
15
16if __name__ == '__main__':
17    sys.exit(main())