documentation updates
[sfa.git] / registry / createAuthority.py
1 ##
2 # Create an authority via the hierarchy module.
3 #
4 # This tool was most likely used during development and is deprecated by the
5 # import tool.
6 ##
7
8 import getopt
9 import sys
10
11 from hierarchy import *
12
13 hrn = None
14
15 def process_options():
16    global hrn
17
18    (options, args) = getopt.getopt(sys.argv[1:], '', [])
19    for opt in options:
20        name = opt[0]
21        val = opt[1]
22
23    if not args:
24        print "no hrn specified"
25        sys.exit(-1)
26
27    hrn = args[0]
28
29
30 def main():
31     process_options()
32
33     h = Hierarchy()
34     h.create_auth(hrn)
35
36 if __name__ == "__main__":
37     main()