NFP - Fixed authtoken configuration
Adding missing options to nfp keystone authtoken section Change-Id: I0c54f6565256ea59b5e318def730f4f0a2f49e56 Closes-Bug: 1654937
This commit is contained in:
		 Rajendra Machani
					Rajendra Machani
				
			
				
					committed by
					
						 ashutosh mishra
						ashutosh mishra
					
				
			
			
				
	
			
			
			 ashutosh mishra
						ashutosh mishra
					
				
			
						parent
						
							4831450e09
						
					
				
				
					commit
					55196558f4
				
			| @@ -454,11 +454,19 @@ function copy_nfp_files_and_start_process { | |||||||
|     admin_password=`iniget $NEUTRON_CONF keystone_authtoken admin_password` |     admin_password=`iniget $NEUTRON_CONF keystone_authtoken admin_password` | ||||||
|     admin_tenant_name=`iniget $NEUTRON_CONF keystone_authtoken admin_tenant_name` |     admin_tenant_name=`iniget $NEUTRON_CONF keystone_authtoken admin_tenant_name` | ||||||
|     auth_uri=`iniget $NEUTRON_CONF keystone_authtoken auth_uri` |     auth_uri=`iniget $NEUTRON_CONF keystone_authtoken auth_uri` | ||||||
|  |     auth_protocol=$(echo $auth_uri | tr ':/' ' ' | awk '{print $1}') | ||||||
|  |     auth_host=$(echo $auth_uri | tr ':/' ' ' | awk '{print $2}') | ||||||
|  |     auth_port=$(echo $auth_uri | tr ':/' ' ' | awk '{print $3}') | ||||||
|  |     auth_version=$(echo $auth_uri | tr ':/' ' ' | awk '{print $4}') | ||||||
|  |     auth_version=${auth_version:-v2.0} | ||||||
|  |  | ||||||
|     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken admin_user $admin_user |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken admin_user $admin_user | ||||||
|     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken admin_password $admin_password |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken admin_password $admin_password | ||||||
|     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken admin_tenant_name $admin_tenant_name |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken admin_tenant_name $admin_tenant_name | ||||||
|     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken auth_uri $auth_uri |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken auth_protocol $auth_protocol | ||||||
|  |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken auth_host $auth_host | ||||||
|  |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken auth_port $auth_port | ||||||
|  |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken auth_version $auth_version | ||||||
|  |  | ||||||
|     sed -i 's#source.*#source '$DEVSTACK_DIR'/openrc demo demo#g' $NFPSERVICE_DIR/devstack/exercises/nfp_service/*.sh |     sed -i 's#source.*#source '$DEVSTACK_DIR'/openrc demo demo#g' $NFPSERVICE_DIR/devstack/exercises/nfp_service/*.sh | ||||||
|     source $DEVSTACK_DIR/functions-common |     source $DEVSTACK_DIR/functions-common | ||||||
|   | |||||||
| @@ -82,10 +82,19 @@ def set_keystone_authtoken_section(): | |||||||
|     admin_password = commands.getoutput("crudini --get " + NEUTRON_CONF + " keystone_authtoken admin_password") |     admin_password = commands.getoutput("crudini --get " + NEUTRON_CONF + " keystone_authtoken admin_password") | ||||||
|     admin_tenant_name = commands.getoutput("crudini --get " + NEUTRON_CONF + " keystone_authtoken admin_tenant_name") |     admin_tenant_name = commands.getoutput("crudini --get " + NEUTRON_CONF + " keystone_authtoken admin_tenant_name") | ||||||
|     auth_uri = commands.getoutput("crudini --get " + NEUTRON_CONF + " keystone_authtoken auth_uri") |     auth_uri = commands.getoutput("crudini --get " + NEUTRON_CONF + " keystone_authtoken auth_uri") | ||||||
|  |     auth_protocol = commands.getoutput("echo " + auth_uri + " | cut -d':' -f1") | ||||||
|  |     auth_host = commands.getoutput("echo " + auth_uri + " | cut -d'/' -f3 | cut -d':' -f1") | ||||||
|  |     auth_port = commands.getoutput("echo " + auth_uri + " | cut -d'/' -f3 | cut -d':' -f2") | ||||||
|  |     auth_version = commands.getoutput("echo " + auth_uri + " | cut -d'/' -f4") | ||||||
|  |     if auth_version == '': | ||||||
|  |         auth_version = 'v2.0' | ||||||
|     subprocess.call(("crudini --set " + nfp_conf + " nfp_keystone_authtoken admin_user " + admin_user).split(' ')) |     subprocess.call(("crudini --set " + nfp_conf + " nfp_keystone_authtoken admin_user " + admin_user).split(' ')) | ||||||
|     subprocess.call(("crudini --set " + nfp_conf + " nfp_keystone_authtoken admin_password " + admin_password).split(' ')) |     subprocess.call(("crudini --set " + nfp_conf + " nfp_keystone_authtoken admin_password " + admin_password).split(' ')) | ||||||
|     subprocess.call(("crudini --set " + nfp_conf + " nfp_keystone_authtoken admin_tenant_name " + admin_tenant_name).split(' ')) |     subprocess.call(("crudini --set " + nfp_conf + " nfp_keystone_authtoken admin_tenant_name " + admin_tenant_name).split(' ')) | ||||||
|     subprocess.call(("crudini --set " + nfp_conf + " nfp_keystone_authtoken auth_uri " + auth_uri).split(' ')) |     subprocess.call(("crudini --set " + nfp_conf + " nfp_keystone_authtoken auth_protocol " + auth_protocol).split(' ')) | ||||||
|  |     subprocess.call(("crudini --set " + nfp_conf + " nfp_keystone_authtoken auth_host " + auth_host).split(' ')) | ||||||
|  |     subprocess.call(("crudini --set " + nfp_conf + " nfp_keystone_authtoken auth_port " + auth_port).split(' ')) | ||||||
|  |     subprocess.call(("crudini --set " + nfp_conf + " nfp_keystone_authtoken auth_version " + auth_version).split(' ')) | ||||||
|  |  | ||||||
| def configure_nfp(): | def configure_nfp(): | ||||||
|     commands.getoutput("cat /usr/lib/python2.7/site-packages/gbpservice/contrib/nfp/bin/nfp.ini >> /etc/nfp.ini") |     commands.getoutput("cat /usr/lib/python2.7/site-packages/gbpservice/contrib/nfp/bin/nfp.ini >> /etc/nfp.ini") | ||||||
|   | |||||||
| @@ -50,10 +50,13 @@ nfp_controller_port=8070 | |||||||
| topic=nfp-proxy-agent-topic | topic=nfp-proxy-agent-topic | ||||||
|  |  | ||||||
| [nfp_keystone_authtoken] | [nfp_keystone_authtoken] | ||||||
| admin_password= |  | ||||||
| admin_user= | admin_user= | ||||||
|  | admin_password= | ||||||
| admin_tenant_name= | admin_tenant_name= | ||||||
| auth_uri= | auth_protocol= | ||||||
|  | auth_host= | ||||||
|  | auth_port= | ||||||
|  | auth_version= | ||||||
|  |  | ||||||
| [heat_driver] | [heat_driver] | ||||||
| # External network on which vpn sites/users connect, | # External network on which vpn sites/users connect, | ||||||
|   | |||||||
| @@ -203,11 +203,19 @@ function copy_nfp_files_and_start_process { | |||||||
|     admin_password=`iniget /etc/neutron/neutron.conf keystone_authtoken admin_password` |     admin_password=`iniget /etc/neutron/neutron.conf keystone_authtoken admin_password` | ||||||
|     admin_tenant_name=`iniget /etc/neutron/neutron.conf keystone_authtoken admin_tenant_name` |     admin_tenant_name=`iniget /etc/neutron/neutron.conf keystone_authtoken admin_tenant_name` | ||||||
|     auth_uri=`iniget /etc/neutron/neutron.conf keystone_authtoken auth_uri` |     auth_uri=`iniget /etc/neutron/neutron.conf keystone_authtoken auth_uri` | ||||||
|  |     auth_protocol=$(echo $auth_uri | tr ':/' ' ' | awk '{print $1}') | ||||||
|  |     auth_host=$(echo $auth_uri | tr ':/' ' ' | awk '{print $2}') | ||||||
|  |     auth_port=$(echo $auth_uri | tr ':/' ' ' | awk '{print $3}') | ||||||
|  |     auth_version=$(echo $auth_uri | tr ':/' ' ' | awk '{print $4}') | ||||||
|  |     auth_version=${auth_version:-v2.0} | ||||||
|  |  | ||||||
|     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken admin_user $admin_user |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken admin_user $admin_user | ||||||
|     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken admin_password $admin_password |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken admin_password $admin_password | ||||||
|     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken admin_tenant_name $admin_tenant_name |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken admin_tenant_name $admin_tenant_name | ||||||
|     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken auth_uri $auth_uri |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken auth_protocol $auth_protocol | ||||||
|  |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken auth_host $auth_host | ||||||
|  |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken auth_port $auth_port | ||||||
|  |     iniset -sudo /etc/nfp.ini nfp_keystone_authtoken auth_version $auth_version | ||||||
|  |  | ||||||
|     ipnetns_router=`sudo ip netns |grep $RouterId` |     ipnetns_router=`sudo ip netns |grep $RouterId` | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user