diff options
| author | Amy Fong <amy.fong@windriver.com> | 2014-07-24 13:04:41 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-07-25 15:45:30 -0400 |
| commit | 1491d54da84195dda8c7d5ce1fac21437f2bc519 (patch) | |
| tree | cc16576ec9471de2c9d18de8987f5a046971df0f /meta-openstack/recipes-devtools/python/python-keystone | |
| parent | 3085fa57f54335cfa3794aaf1f45928f5300b000 (diff) | |
| download | meta-cloud-services-1491d54da84195dda8c7d5ce1fac21437f2bc519.tar.gz | |
openstack initscript: add reset
Some of the openstack data is associated with external resources
(ie glance may have external files), we explicitly invoke the delete commands on those
in additional to dropping and recreating the databases.
Signed-off-by: Amy Fong <amy.fong@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-keystone')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-keystone/keystone | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-keystone/keystone b/meta-openstack/recipes-devtools/python/python-keystone/keystone index d73bc75..6524fed 100644 --- a/meta-openstack/recipes-devtools/python/python-keystone/keystone +++ b/meta-openstack/recipes-devtools/python/python-keystone/keystone | |||
| @@ -67,6 +67,40 @@ status() | |||
| 67 | echo "$DESC is not running" | 67 | echo "$DESC is not running" |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | reset() | ||
| 71 | { | ||
| 72 | # Cleanup keystone tenant | ||
| 73 | . /etc/nova/openrc | ||
| 74 | simple_delete "keystone user-list" "keystone user-delete" 1 "keystone user" | ||
| 75 | simple_delete "keystone tenant-list" "keystone tenant-delete" 1 "keystone tenant" | ||
| 76 | simple_delete "keystone role-list" "keystone role-delete" 1 "keystone role" | ||
| 77 | simple_delete "keystone endpoint-list" "keystone endpoint-delete" 1 "keystone endpoint" | ||
| 78 | simple_delete "keystone service-list" "keystone service-delete" 1 "keystone service" | ||
| 79 | |||
| 80 | stop | ||
| 81 | |||
| 82 | # This is to make sure postgres is configured and running | ||
| 83 | if ! pidof postmaster > /dev/null; then | ||
| 84 | /etc/init.d/postgresql-init | ||
| 85 | /etc/init.d/postgresql start | ||
| 86 | sleep 2 | ||
| 87 | fi | ||
| 88 | |||
| 89 | sudo -u postgres dropdb keystone | ||
| 90 | sudo -u postgres createdb keystone | ||
| 91 | keystone-manage db_sync | ||
| 92 | keystone-manage pki_setup --keystone-user=root --keystone-group=root | ||
| 93 | |||
| 94 | start | ||
| 95 | |||
| 96 | sleep 2 | ||
| 97 | |||
| 98 | ADMIN_PASSWORD=%ADMIN_PASSWORD% \ | ||
| 99 | SERVICE_PASSWORD=%SERVICE_PASSWORD% \ | ||
| 100 | SERVICE_TENANT_NAME=%SERVICE_TENANT_NAME% \ | ||
| 101 | bash /etc/keystone/identity.sh | ||
| 102 | } | ||
| 103 | |||
| 70 | case "$1" in | 104 | case "$1" in |
| 71 | start) | 105 | start) |
| 72 | start | 106 | start |
| @@ -81,8 +115,11 @@ case "$1" in | |||
| 81 | status) | 115 | status) |
| 82 | status | 116 | status |
| 83 | ;; | 117 | ;; |
| 118 | reset) | ||
| 119 | reset | ||
| 120 | ;; | ||
| 84 | *) | 121 | *) |
| 85 | echo "Usage: $0 {start|stop|force-reload|restart|reload|status}" | 122 | echo "Usage: $0 {start|stop|force-reload|restart|reload|status|reset}" |
| 86 | exit 1 | 123 | exit 1 |
| 87 | ;; | 124 | ;; |
| 88 | esac | 125 | esac |
