diff options
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-keystone')
3 files changed, 50 insertions, 1 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-keystone/convert_keystone_backend.py b/meta-openstack/recipes-devtools/python/python-keystone/convert_keystone_backend.py new file mode 100755 index 00000000..eebd59d9 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-keystone/convert_keystone_backend.py @@ -0,0 +1,43 @@ +#!/usr/bin/python + +import sys +import ConfigParser +import shutil + +path = "/etc/keystone/keystone.conf" + +if len(sys.argv) != 2: + sys.stderr.write("Usage: "+sys.argv[0]+" [sql|hybrid]\n") + sys.exit(1) + +backend = sys.argv[1] +if backend == "hybrid": + identity_backend = 'keystone.identity.backends.hybrid_identity.Identity' + assignment_backend = 'keystone.assignment.backends.hybrid_assignment.Assignment' +elif backend == "sql": + identity_backend = 'keystone.identity.backends.sql.Identity' + assignment_backend = 'keystone.assignment.backends.sql.Assignment' +else: + sys.stderr.write("Usage: "+sys.argv[0]+" [sql|hybrid]\n") + sys.exit(1) + +shutil.copyfile(path, path + ".bak") + +cfg = ConfigParser.ConfigParser() +c = cfg.read(path) + +if not cfg.has_section("identity"): + cfg.add_section("identity") + +cfg.set("identity", "driver", identity_backend) + +if not cfg.has_section("assignment"): + cfg.add_section("assignment") + +cfg.set("assignment", "driver", assignment_backend) + +fp = open(path, "w") +cfg.write(fp) +fp.close() + +exit(0) diff --git a/meta-openstack/recipes-devtools/python/python-keystone/hybrid-backend-setup b/meta-openstack/recipes-devtools/python/python-keystone/hybrid-backend-setup new file mode 100755 index 00000000..d3f7eac2 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-keystone/hybrid-backend-setup @@ -0,0 +1,6 @@ +#!/bin/sh + +/etc/keystone/convert_keystone_backend.py hybrid + +/etc/init.d/openldap start +/etc/init.d/keystone restart diff --git a/meta-openstack/recipes-devtools/python/python-keystone/keystone b/meta-openstack/recipes-devtools/python/python-keystone/keystone index 6524fed3..8953da8c 100644 --- a/meta-openstack/recipes-devtools/python/python-keystone/keystone +++ b/meta-openstack/recipes-devtools/python/python-keystone/keystone @@ -98,7 +98,7 @@ reset() ADMIN_PASSWORD=%ADMIN_PASSWORD% \ SERVICE_PASSWORD=%SERVICE_PASSWORD% \ SERVICE_TENANT_NAME=%SERVICE_TENANT_NAME% \ - bash /etc/keystone/identity.sh + bash /etc/keystone/service-user-setup } case "$1" in |