def cluster_token(argv): if len(argv) != 1: print "ERROR: Must specify only one node" sys.exit(1) node = argv[0] tokens = utils.readTokens() if node in tokens: print tokens[node] else: print "ERROR: No authorization token for: %s" % (node) sys.exit(1)
def cluster_token(argv): if len(argv) > 1: utils.err("Must specify only one node") elif len(argv) == 0: utils.err("Must specify a node to get authorization token from") node = argv[0] tokens = utils.readTokens() if node in tokens: print tokens[node] else: utils.err("No authorization token for: %s" % (node))
def cluster_token_nodes(argv): print "\n".join(sorted(utils.readTokens().keys()))