summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-keystone
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-keystone')
-rwxr-xr-xmeta-openstack/recipes-devtools/python/python-keystone/convert_keystone_backend.py43
-rwxr-xr-xmeta-openstack/recipes-devtools/python/python-keystone/hybrid-backend-setup6
-rw-r--r--meta-openstack/recipes-devtools/python/python-keystone/keystone2
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 0000000..eebd59d
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-keystone/convert_keystone_backend.py
@@ -0,0 +1,43 @@
1#!/usr/bin/python
2
3import sys
4import ConfigParser
5import shutil
6
7path = "/etc/keystone/keystone.conf"
8
9if len(sys.argv) != 2:
10 sys.stderr.write("Usage: "+sys.argv[0]+" [sql|hybrid]\n")
11 sys.exit(1)
12
13backend = sys.argv[1]
14if backend == "hybrid":
15 identity_backend = 'keystone.identity.backends.hybrid_identity.Identity'
16 assignment_backend = 'keystone.assignment.backends.hybrid_assignment.Assignment'
17elif backend == "sql":
18 identity_backend = 'keystone.identity.backends.sql.Identity'
19 assignment_backend = 'keystone.assignment.backends.sql.Assignment'
20else:
21 sys.stderr.write("Usage: "+sys.argv[0]+" [sql|hybrid]\n")
22 sys.exit(1)
23
24shutil.copyfile(path, path + ".bak")
25
26cfg = ConfigParser.ConfigParser()
27c = cfg.read(path)
28
29if not cfg.has_section("identity"):
30 cfg.add_section("identity")
31
32cfg.set("identity", "driver", identity_backend)
33
34if not cfg.has_section("assignment"):
35 cfg.add_section("assignment")
36
37cfg.set("assignment", "driver", assignment_backend)
38
39fp = open(path, "w")
40cfg.write(fp)
41fp.close()
42
43exit(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 0000000..d3f7eac
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-keystone/hybrid-backend-setup
@@ -0,0 +1,6 @@
1#!/bin/sh
2
3/etc/keystone/convert_keystone_backend.py hybrid
4
5/etc/init.d/openldap start
6/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 6524fed..8953da8 100644
--- a/meta-openstack/recipes-devtools/python/python-keystone/keystone
+++ b/meta-openstack/recipes-devtools/python/python-keystone/keystone
@@ -98,7 +98,7 @@ reset()
98 ADMIN_PASSWORD=%ADMIN_PASSWORD% \ 98 ADMIN_PASSWORD=%ADMIN_PASSWORD% \
99 SERVICE_PASSWORD=%SERVICE_PASSWORD% \ 99 SERVICE_PASSWORD=%SERVICE_PASSWORD% \
100 SERVICE_TENANT_NAME=%SERVICE_TENANT_NAME% \ 100 SERVICE_TENANT_NAME=%SERVICE_TENANT_NAME% \
101 bash /etc/keystone/identity.sh 101 bash /etc/keystone/service-user-setup
102} 102}
103 103
104case "$1" in 104case "$1" in