Browse code

Make ec2 credentials work properly

Vishvananda Ishaya authored on 2011/10/25 08:05:57
Showing 4 changed files
... ...
@@ -147,3 +147,9 @@ nova secgroup-delete $SECGROUP
147 147
 
148 148
 # FIXME: validate shutdown within 5 seconds
149 149
 # (nova show $NAME returns 1 or status != ACTIVE)?
150
+
151
+# Testing Euca2ools
152
+# ==================
153
+
154
+# make sure that we can describe instances
155
+euca-describe-instances
... ...
@@ -16,3 +16,4 @@ iputils-ping
16 16
 wget
17 17
 curl
18 18
 tcpdump
19
+euca2ools # only for testing client
... ...
@@ -36,8 +36,8 @@ $BIN_DIR/keystone-manage $* endpointTemplates add RegionOne keystone http://%HOS
36 36
 # Tokens
37 37
 $BIN_DIR/keystone-manage $* token add %SERVICE_TOKEN% admin admin 2015-02-05T00:00
38 38
 
39
-# EC2 related creds - note we are setting the token to user_password
39
+# EC2 related creds - note we are setting the secret key to ADMIN_PASSWORD
40 40
 # but keystone doesn't parse them - it is just a blob from keystone's
41 41
 # point of view
42
-$BIN_DIR/keystone-manage $* credentials add admin EC2 'admin_%ADMIN_PASSWORD%' admin admin || echo "no support for adding credentials"
43
-$BIN_DIR/keystone-manage $* credentials add demo EC2 'demo_%ADMIN_PASSWORD%' demo demo || echo "no support for adding credentials"
42
+$BIN_DIR/keystone-manage $* credentials add admin EC2 'admin' '%ADMIN_PASSWORD%' admin || echo "no support for adding credentials"
43
+$BIN_DIR/keystone-manage $* credentials add demo EC2 'demo' '%ADMIN_PASSWORD%' demo || echo "no support for adding credentials"
... ...
@@ -26,7 +26,7 @@ export NOVA_API_KEY=${ADMIN_PASSWORD:-secrete}
26 26
 # has access to - including nova, glance, keystone, swift, ...  We currently
27 27
 # recommend using the 2.0 *auth api*.
28 28
 #
29
-# *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0.  We 
29
+# *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0.  We
30 30
 # will use the 1.1 *compute api*
31 31
 export NOVA_URL=${NOVA_URL:-http://$HOST_IP:5000/v2.0/}
32 32
 
... ...
@@ -37,5 +37,15 @@ export NOVA_VERSION=${NOVA_VERSION:-1.1}
37 37
 # FIXME - why does this need to be specified?
38 38
 export NOVA_REGION_NAME=${NOVA_REGION_NAME:-RegionOne}
39 39
 
40
+# Set the ec2 url so euca2ools works
41
+export EC2_URL=${EC2_URL:-http://$HOST_IP:8773/services/Cloud}
42
+
43
+# Access key is set in the initial keystone data to be the same as username
44
+export EC2_ACCESS_KEY=${USERNAME:-demo}
45
+
46
+# Secret key is set in the initial keystone data to the admin password
47
+export EC2_SECRET_KEY=${ADMIN_PASSWORD:-secrete}
48
+
40 49
 # set log level to DEBUG (helps debug issues)
41 50
 # export NOVACLIENT_DEBUG=1
51
+