From e123830c15a4bd07f7ea700a46ca1e158487cdd9 Mon Sep 17 00:00:00 2001
From: Brant Knudson <bknudson@us.ibm.com>
Date: Sun, 21 Jun 2015 09:16:44 -0500
Subject: [PATCH] Add devstack-admin cloud to clouds.yaml

A lot of commands developers use require admin by default, so add a
"devstack-admin" cloud to clouds.yaml that has admin authority.

 $ openstack --os-cloud devstack-admin user list

Change-Id: Ie0f1979c50901004418f8622d4ca79dc4bdadd8d
---
 stack.sh | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/stack.sh b/stack.sh
index 26d9754f6f..4228f35e0d 100755
--- a/stack.sh
+++ b/stack.sh
@@ -1296,8 +1296,9 @@ fi
 save_stackenv
 
 # Update/create user clouds.yaml file.
-# clouds.yaml will have a `devstack` entry for the `demo` user for the `demo`
-# project.
+# clouds.yaml will have
+# - A `devstack` entry for the `demo` user for the `demo` project.
+# - A `devstack-admin` entry for the `admin` user for the `admin` project.
 
 # The location is a variable to allow for easier refactoring later to make it
 # overridable. There is currently no usecase where doing so makes sense, so
@@ -1320,6 +1321,16 @@ $TOP_DIR/tools/update_clouds_yaml.py \
     --os-username demo \
     --os-password $ADMIN_PASSWORD \
     --os-project-name demo
+$TOP_DIR/tools/update_clouds_yaml.py \
+    --file $CLOUDS_YAML \
+    --os-cloud devstack-admin \
+    --os-region-name $REGION_NAME \
+    --os-identity-api-version $IDENTITY_API_VERSION \
+    $CA_CERT_ARG \
+    --os-auth-url $KEYSTONE_AUTH_URI/v$IDENTITY_API_VERSION \
+    --os-username admin \
+    --os-password $ADMIN_PASSWORD \
+    --os-project-name admin
 
 
 # Wrapup configuration