def main(): environment.use_stdlib() dev_conf = os.path.join(possible_topdir, 'etc', 'keystone.conf') config_files = None if os.path.exists(dev_conf): config_files = [dev_conf] cli.main(argv=sys.argv, config_files=config_files)
sys.exit(1) # Create a class for listing the tokens and add it to the keystone-manage # command list class TokenList(cli.BaseApp): """List tokens in the DB""" name = "token_list" @classmethod def main(cls): token_manager = token.persistence.PersistenceManager() token_manager.driver.list_tokens() cli.CMDS.append(TokenList) # Now do our thing if __name__ == '__main__': environment.use_stdlib() dev_conf = os.path.join(possible_topdir, 'etc', 'keystone.conf') config_files = None if os.path.exists(dev_conf): config_files = [dev_conf] # keystone-manage wants a command as a argv, so give it token_list sys.argv.append('token_list') cli.main(argv=sys.argv, config_files=config_files)