From a677b7fe828445968cdc714a630c74d35321c8fb Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Mon, 25 Nov 2013 23:40:20 +0100 Subject: [PATCH] Move neutron cache dir into a function Taking the model of Nova, this patch aims to move the cache directory management into a function with the goal to reuse it somewhere else like Grenade. Change-Id: I93df52f69ef339e6528b88d88d4ea70e0b725893 Signed-off-by: Emilien Macchi --- lib/neutron | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/neutron b/lib/neutron index 70417be5d3..8b0656bc26 100644 --- a/lib/neutron +++ b/lib/neutron @@ -17,6 +17,7 @@ # - configure_neutron_third_party # - init_neutron_third_party # - start_neutron_third_party +# - create_neutron_cache_dir # - create_nova_conf_neutron # - start_neutron_service_and_check # - create_neutron_initial_network @@ -296,6 +297,14 @@ function create_nova_conf_neutron() { fi } +# create_neutron_cache_dir() - Part of the _neutron_setup_keystone() process +function create_neutron_cache_dir() { + # Create cache dir + sudo mkdir -p $NEUTRON_AUTH_CACHE_DIR + sudo chown $STACK_USER $NEUTRON_AUTH_CACHE_DIR + rm -f $NEUTRON_AUTH_CACHE_DIR/* +} + # create_neutron_accounts() - Set up common required neutron accounts # Tenant User Roles @@ -782,9 +791,7 @@ function _neutron_setup_keystone() { if [[ -z $skip_auth_cache ]]; then iniset $conf_file $section signing_dir $NEUTRON_AUTH_CACHE_DIR # Create cache dir - sudo mkdir -p $NEUTRON_AUTH_CACHE_DIR - sudo chown $STACK_USER $NEUTRON_AUTH_CACHE_DIR - rm -f $NEUTRON_AUTH_CACHE_DIR/* + create_neutron_cache_dir fi }