Created
February 17, 2015 02:11
-
-
Save jamielennox/3b26bfb8e80fa48133e9 to your computer and use it in GitHub Desktop.
Load an auth plugin and session from options in a config file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from keystoneclient import auth | |
from keystoneclient import session | |
from oslo.config import cfg | |
cfg.CONF(sys.argv[1:]) | |
auth.register_conf_options(cfg.CONF, 'somegroup') | |
session.Session.register_conf_options(cfg.CONF, 'somegroup') | |
plugin = auth.load_from_conf_options(cfg.CONF, 'somegroup') | |
sess = session.Session.load_from_conf_options(cfg.CONF, | |
'somegroup', | |
auth=plugin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment