Set up swift's auth cache dir

Swift backing glance doesn't work due to auth_token failing without
a signing_dir configured and set up.  Create the dir and configure
in proxy-server.conf

Bug 1092783

Change-Id: If9ac46592bb7fc09e6cfd0a802a4fa61304fc369
diff --git a/lib/swift b/lib/swift
index 140e5e9..713b38c 100644
--- a/lib/swift
+++ b/lib/swift
@@ -29,6 +29,7 @@
 
 SWIFT_DIR=$DEST/swift
 SWIFTCLIENT_DIR=$DEST/python-swiftclient
+SWIFT_AUTH_CACHE_DIR=${SWIFT_AUTH_CACHE_DIR:-/var/cache/swift}
 
 # TODO: add logging to different location.
 
@@ -212,6 +213,7 @@
     iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken admin_tenant_name $SERVICE_TENANT_NAME
     iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken admin_user swift
     iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken admin_password $SERVICE_PASSWORD
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken signing_dir $SWIFT_AUTH_CACHE_DIR
 
     iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} filter:keystoneauth use
     iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} filter:keystoneauth operator_roles
@@ -325,6 +327,10 @@
         swift-ring-builder account.builder rebalance
     } && popd >/dev/null
 
+    # Create cache dir
+    sudo mkdir -p $SWIFT_AUTH_CACHE_DIR
+    sudo chown `whoami` $SWIFT_AUTH_CACHE_DIR
+    rm -f $SWIFT_AUTH_CACHE_DIR/*
 }
 
 function install_swift() {