aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-os-chef
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-06-11 14:22:02 +0300
committerMichael Lando <ml636r@att.com>2017-06-11 17:48:32 +0300
commitb3d4898d9e8452ea0b8d848c048e712d43b8d9a3 (patch)
tree0609319203be13f6c29ccbe24cb39c9d64f90095 /sdc-os-chef
parentaf9929df75604ce407d0ca542b200630164e0ae6 (diff)
[SDC-29] rebase continue work to align source
Change-Id: I218f1c5ee23fb2c8314f1c70921d3ad8682c10f4 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'sdc-os-chef')
-rw-r--r--sdc-os-chef/pom.xml4
-rw-r--r--sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb4
-rw-r--r--sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/files/default/user.py25
-rw-r--r--sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default/titan.properties6
-rw-r--r--sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb28
5 files changed, 21 insertions, 46 deletions
diff --git a/sdc-os-chef/pom.xml b/sdc-os-chef/pom.xml
index 94ea55f9aa..e511056105 100644
--- a/sdc-os-chef/pom.xml
+++ b/sdc-os-chef/pom.xml
@@ -223,7 +223,7 @@
</goals>
<configuration>
<removeAll>true</removeAll>
- <image>openecomp/sdc-backend,openecomp/sdc-frontend,openecomp/sdc-elasticsearch,openecomp/sdc-kibana,openecomp/sdc-sanity</image>
+ <image>openecomp/sdc-backend,openecomp/sdc-frontend,openecomp/sdc-elasticsearch,openecomp/sdc-kibana,openecomp/sdc-sanity</image>
</configuration>
</execution>
@@ -243,7 +243,7 @@
<goal>push</goal>
</goals>
<configuration>
- <image>openecomp/sdc-backend,openecomp/sdc-frontend,openecomp/sdc-elasticsearch,openecomp/sdc-kibana,openecomp/sdc-sanity</image>
+ <image>openecomp/sdc-backend,openecomp/sdc-frontend,openecomp/sdc-elasticsearch,openecomp/sdc-kibana,openecomp/sdc-sanity</image>
</configuration>
</execution>
</executions>
diff --git a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb
index f011a51021..4287ca8617 100644
--- a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb
+++ b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb
@@ -1,3 +1 @@
-#
-# Example to value after replacement : default['asdctool'][:version] = "1707.0.66.73.1"
-default['asdctool'][:version] = "__CATALOG-ASDCTOOL_TAR_NAME__" \ No newline at end of file
+# \ No newline at end of file
diff --git a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/files/default/user.py b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/files/default/user.py
index d1ce9cfad8..90e44561ce 100644
--- a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/files/default/user.py
+++ b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/files/default/user.py
@@ -38,9 +38,9 @@ def checkUser(userName):
-def createUser( firstName, lastName, userId , email , role ):
- print '[INFO] create first:[' + firstName + '], last:[' + lastName + '], Id:[' + userId + '], email:[' + email + '], role:[' + role +']'
- command="curl -s -o /dev/null -w \"%{http_code}\" -X POST -i -H \"Accept: application/json; charset=UTF-8\" -H \"Content-Type: application/json\" -H \"USER_ID: jh0003\" http://localhost:8080/sdc2/rest/v1/user/ -d '{\"firstName\": '" + firstName + "', \"lastName\": '" + lastName + "',\"userId\": '" + userId + "',\"email\": '" + email + "',\"role\": '" + role + "'}'"
+def createUser( firstName, lastName, userId , email_dom , role ):
+ print '[INFO] create first:[' + firstName + '], last:[' + lastName + '], Id:[' + userId + '], email:[' + userId + '@' + email_dom + '], role:[' + role +']'
+ command="curl -s -o /dev/null -w \"%{http_code}\" -X POST -i -H \"Accept: application/json; charset=UTF-8\" -H \"Content-Type: application/json\" -H \"USER_ID: jh0003\" http://localhost:8080/sdc2/rest/v1/user/ -d '{\"firstName\": '" + firstName + "', \"lastName\": '" + lastName + "',\"userId\": '" + userId + "',\"email\": '" + userId + "@" + email_dom + "',\"role\": '" + role + "'}'"
proc = subprocess.Popen( command , shell=True , stdout=subprocess.PIPE)
(out, err) = proc.communicate()
@@ -53,11 +53,11 @@ def createUser( firstName, lastName, userId , email , role ):
##############################
# Definitions
##############################
-userList = [ "demo" ]
-lastName = "demo"
-userId = "demo"
-email = "demo@openecomp.org"
-role = "ADMIN"
+userId = [ "demo" , "op0001" , "gv0001" , "jh0003" , "jm0007" , "cs0008" ]
+firstName = [ "demo" , "Oper" , "Giuseppe" , "Jimmy" , "Joni" , "Carlos" ]
+lastName = [ "demo" , "P" , "Verdi" , "Hendrix" , "Mitchell" , "Santana" ]
+role = [ "ADMIN" , "OPS" , "ADMIN" , "GOVERNOR" , "TESTER" , "DESIGNER" ]
+email_dom = "openecomp.org"
beStat=0
@@ -80,13 +80,14 @@ if beStat == 0:
print '[ERROR]: ' + time.strftime('%Y/%m/%d %H:%M:%S') + bcolors.FAIL + 'Backend is DOWN :-(' + bcolors.ENDC
exit()
-for user in userList:
+for user in userId:
myResult = checkUser(user)
+ pos = userId.index(user)
if myResult == '200':
print '[INFO]: ' + user + ' already exists'
else:
- myResult = createUser( user, lastName, userId, email, role )
+ myResult = createUser( firstName[pos], lastName[pos], userId[pos], email_dom, role[pos] )
if myResult == '201':
- print '[INFO]: ' + userId + ' created, result: [' + myResult + ']'
+ print '[INFO]: ' + userId[pos] + ' created, result: [' + myResult + ']'
else:
- print '[ERROR]: ' + bcolors.FAIL + userId + bcolors.ENDC + ' error creating , result: [' + myResult + ']'
+ print '[ERROR]: ' + bcolors.FAIL + userId[pos] + bcolors.ENDC + ' error creating , result: [' + myResult + ']'
diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default/titan.properties b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default/titan.properties
deleted file mode 100644
index 43944eae47..0000000000
--- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default/titan.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-storage.backend=cassandra
-storage.hostname=localhost
-storage.port=9160
-storage.username=asdc_user
-storage.password=Aa1234%^!
-storage.cassandra.keyspace=sdctitan \ No newline at end of file
diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb
index da6bbb184c..f65bb945f3 100644
--- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb
+++ b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb
@@ -12,41 +12,23 @@ echo -e "$KEYSPACE\n$KEYSPACE1" > /tmp/create_dox_keyspace.cql
chmod 755 /tmp/create_dox_keyspace.cql
cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS -f /tmp/create_dox_keyspace.cql > /dev/null 2>&1
-CS_VERSION=`cassandra -v`
-CS_MAJOR_VERSION=`cassandra -v | cut -c1`
-if [ ${CS_MAJOR_VERSION} -gt 2 ]; then
- echo "`date` --- CS [${CS_VERSION}] uses system_schema.keyspaces"
- res=`echo "select keyspace_name from system_schema.keyspaces ;" | cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS |grep -c dox 2>/dev/null`
-else
- echo "`date` --- CS [${CS_VERSION}] uses system.schema_keyspaces"
- res=`echo "select keyspace_name from system.schema_keyspaces ;" | cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS |grep -c dox 2>/dev/null`
-fi
+
+res=`echo "select keyspace_name from system.schema_keyspaces ;" | cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS |grep -c dox 2>/dev/null`
if [ $res -gt 0 ]; then
- echo "`date` --- dox keyspace was created "
+ echo "`date` --- dox keyspace was created "
else
- echo "`date` --- Failed to create dox keyspace"
+ echo "`date` --- Failed to create dox keyspace"
fi
echo "run create_dox_db.cql"
chmod 755 /tmp/create_dox_db.cql
cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS -f /tmp/create_dox_db.cql > /dev/null 2>&1
-$res=$?
-if [ $res -gt 0 ]; then
- echo "`date` --- dox keyspace: create_dox_db.cql failed ! "
-else
- echo "`date` --- dox keyspace: create_dox_db.cql completed successfully "
-fi
sleep 10
echo "run alter_dox_db.cql"
chmod 755 /tmp/alter_dox_db.cql
cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS -f /tmp/alter_dox_db.cql > /dev/null 2>&1
-$res=$?
-if [ $res -gt 0 ]; then
- echo "`date` --- dox keyspace: alter_dox_db.cql failed !"
-else
- echo "`date` --- dox keyspace: alter_dox_db.cql completed successfully "
-fi
+