You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2014/10/17 18:35:15 UTC

[28/49] git commit: Fixes region string

Fixes region string


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/f98ed253
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/f98ed253
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/f98ed253

Branch: refs/heads/two-dot-o
Commit: f98ed25366845432b29909c8af73d3dcca1c9b5e
Parents: b0d1605
Author: Todd Nine <to...@apache.org>
Authored: Wed Oct 15 13:32:19 2014 -0600
Committer: Todd Nine <to...@apache.org>
Committed: Wed Oct 15 13:32:19 2014 -0600

----------------------------------------------------------------------
 .../src/main/dist/init_instance/create_keyspaces.sh       | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f98ed253/stack/awscluster/src/main/dist/init_instance/create_keyspaces.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/create_keyspaces.sh b/stack/awscluster/src/main/dist/init_instance/create_keyspaces.sh
index f2ebe8f..5cf0f7f 100644
--- a/stack/awscluster/src/main/dist/init_instance/create_keyspaces.sh
+++ b/stack/awscluster/src/main/dist/init_instance/create_keyspaces.sh
@@ -29,8 +29,12 @@ FIRSTHOST="$(groovy get_first_instance.groovy cassandra)"
 if [ "$FIRSTHOST"=="$PUBLIC_HOSTNAME" ]; then
 
 
+#WE have to remove our -1 from the end, since us-east and us-west dont support -1 in cassandra
+CASS_REGION=${EC2_REGION%-1}
+
+
 #Update the keyspace replication and run the cql
-sed -i.bak "s/KEYSPACE_REGION/${EC2_REGION}/g" /usr/share/usergrid/cql/create_locks.cql
+sed -i.bak "s/KEYSPACE_REGION/${CASS_REGION}/g" /usr/share/usergrid/cql/create_locks.cql
 
 /usr/bin/cassandra-cli -f  /usr/share/usergrid/cql/create_locks.cql
 
@@ -38,7 +42,7 @@ sed -i.bak "s/KEYSPACE_REGION/${EC2_REGION}/g" /usr/share/usergrid/cql/create_lo
 
 
 #Update the keyspace region and run the cql
-sed -i.bak "s/KEYSPACE_REGION/${EC2_REGION}/g" /usr/share/usergrid/cql/create_usergrid.cql
+sed -i.bak "s/KEYSPACE_REGION/${CASS_REGION}/g" /usr/share/usergrid/cql/create_usergrid.cql
 
 /usr/bin/cassandra-cli -f  /usr/share/usergrid/cql/create_usergrid.cql
 
@@ -46,7 +50,7 @@ sed -i.bak "s/KEYSPACE_REGION/${EC2_REGION}/g" /usr/share/usergrid/cql/create_us
 
 
 #Update the keyspace region and run the cql
-sed -i.bak "s/KEYSPACE_REGION/${EC2_REGION}/g" /usr/share/usergrid/cql/create_usergrid_applications.cql
+sed -i.bak "s/KEYSPACE_REGION/${CASS_REGION}/g" /usr/share/usergrid/cql/create_usergrid_applications.cql
 
 /usr/bin/cassandra-cli -f  /usr/share/usergrid/cql/create_usergrid_applications.cql