Browse code

Add auth config for neutron metadata proxy

* Without auth config, the proxy will return 500 errors on
cloud-init requests, which will cause VM connectivity
checks to fail.
* A cleaner fix would be for the metadata proxy to reuse the
configuration from the keystone_authtoken section of
neutron.conf, but I chose the easier route because of a
pending switch from REST to RPC communication (RPC won't
need the auth config).
* Fixes bug 1210664

Change-Id: Iaa3c74f5ada2404119c44c8cbdad380eda158f66

Maru Newby authored on 2013/08/11 06:27:54
Showing 1 changed files
... ...
@@ -577,6 +577,8 @@ function _configure_neutron_metadata_agent() {
577 577
     iniset $Q_META_CONF_FILE DEFAULT nova_metadata_ip $Q_META_DATA_IP
578 578
     iniset $Q_META_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND"
579 579
 
580
+    _neutron_setup_keystone $Q_META_CONF_FILE DEFAULT True True
581
+
580 582
 }
581 583
 
582 584
 function _configure_neutron_lbaas() {
... ...
@@ -687,6 +689,7 @@ function _neutron_setup_keystone() {
687 687
     local conf_file=$1
688 688
     local section=$2
689 689
     local use_auth_url=$3
690
+    local skip_auth_cache=$4
690 691
     if [[ -n $use_auth_url ]]; then
691 692
         iniset $conf_file $section auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT/v2.0"
692 693
     else
... ...
@@ -697,11 +700,13 @@ function _neutron_setup_keystone() {
697 697
     iniset $conf_file $section admin_tenant_name $SERVICE_TENANT_NAME
698 698
     iniset $conf_file $section admin_user $Q_ADMIN_USERNAME
699 699
     iniset $conf_file $section admin_password $SERVICE_PASSWORD
700
-    iniset $conf_file $section signing_dir $NEUTRON_AUTH_CACHE_DIR
701
-    # Create cache dir
702
-    sudo mkdir -p $NEUTRON_AUTH_CACHE_DIR
703
-    sudo chown $STACK_USER $NEUTRON_AUTH_CACHE_DIR
704
-    rm -f $NEUTRON_AUTH_CACHE_DIR/*
700
+    if [[ -z $skip_auth_cache ]]; then
701
+        iniset $conf_file $section signing_dir $NEUTRON_AUTH_CACHE_DIR
702
+        # Create cache dir
703
+        sudo mkdir -p $NEUTRON_AUTH_CACHE_DIR
704
+        sudo chown $STACK_USER $NEUTRON_AUTH_CACHE_DIR
705
+        rm -f $NEUTRON_AUTH_CACHE_DIR/*
706
+    fi
705 707
 }
706 708
 
707 709
 function _neutron_setup_interface_driver() {