# Pastebin 5SPioRkS from keystoneclient.auth import conf class OpenStackClients(object): """Convenience class to create and cache client instance.""" def __init__(self, context=None): self._context = context self.reset_clients() conf.register_conf_options(cfg.CONF, "keystone_authtoken") auth_plugin_name = cfg.CONF.keystone_authtoken.auth_plugin if auth_plugin_name == 'password': plugin_options = conf.get_plugin_options(auth_plugin_name) cfg.CONF.register_opts(plugin_options, "keystone_authtoken") else: raise exception.AuthorizationFailure( message=(_( "auth_plugin (%(auth_plugin)s) is not valid. " "Only 'password' auth plugin is supported.") % {'auth_plugin': auth_plugin_name})) ... def _get_admin_credentials(self): creds = {'auth_url': cfg.CONF.keystone_authtoken.auth_url, 'username': cfg.CONF.keystone_authtoken.username, 'password': cfg.CONF.keystone_authtoken.password, 'project_name': cfg.CONF.keystone_authtoken.project_name}