File: convert_script

package info (click to toggle)
openstack-pkg-tools 123
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 912 kB
  • sloc: sh: 3,992; makefile: 31
file content (38 lines) | stat: -rwxr-xr-x 2,003 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Start conversion
pkgos_add_directive nova-test.ini keystone_authtoken "password =" "# Password for auth."
pkgos_deprecate_directive nova-test.ini keystone_authtoken admin_password keystone_authtoken password
pkgos_add_directive nova-test.ini keystone_authtoken "project_name =" "# Project name for auth."
pkgos_deprecate_directive nova-test.ini keystone_authtoken admin_tenant_name keystone_authtoken project_name
pkgos_add_directive nova-test.ini keystone_authtoken "username =" "# Project name for auth."
pkgos_deprecate_directive nova-test.ini keystone_authtoken admin_user keystone_authtoken username
pkgos_add_directive nova-test.ini keystone_authtoken "www_authenticate_uri =" "# Complete 'public' Identity API endpoint."
pkgos_deprecate_directive nova-test.ini keystone_authtoken auth_uri keystone_authtoken www_authenticate_uri
pkgos_add_directive nova-test.ini keystone_authtoken "auth_url =" "# Complete 'admin' Identity API endpoint."
pkgos_inifile get nova-test.ini keystone_authtoken auth_protocol
if [ "${RET}" = "http" ] ; then
	PROTO=http
else
	PROTO=https
fi
pkgos_inifile get nova-test.ini keystone_authtoken auth_host
ADDR=${RET}
if [ "${RET}" != "NOT_FOUND" ] && [ -n "${RET}" ] ; then
	pkgos_inifile get nova-test.ini keystone_authtoken www_authenticate_uri
	if [ -z "${RET}" ] ; then
		pkgos_inifile set nova-test.ini keystone_authtoken www_authenticate_uri ${PROTO}://${ADDR}:5000
	fi
	pkgos_inifile get nova-test.ini keystone_authtoken auth_url
	if [ -z "${RET}" ] ; then
		pkgos_inifile set nova-test.ini keystone_authtoken auth_url ${PROTO}://${ADDR}:5000
	fi
fi

pkgos_search_directive_line_num  nova-test.ini keystone_authtoken auth_host
if [ "${RET}" != "NOT_FOUND" ] && [ -n "${RET}" ] ; then
	sed -i ${RET}'s/^auth_host/#auth_host/' nova-test.ini
fi
pkgos_search_directive_line_num  nova-test.ini keystone_authtoken auth_protocol
if [ "${RET}" != "NOT_FOUND" ] && [ -n "${RET}" ] ; then
	sed -i ${RET}'s/^auth_protocol/#auth_protocol/' nova-test.ini
fi
# End conversion