Eli Mesika has uploaded a new change for review. Change subject: core: squash 03_00_0420_encrypt_pm_passwd.sh ......................................................................
core: squash 03_00_0420_encrypt_pm_passwd.sh Change-Id: I6c92f1f6af48582a9f6315dd3e42cb8fe4a0b7e8 Signed-off-by: Eli Mesika <emes...@redhat.com> --- D backend/manager/dbscripts/upgrade/03_00_0420_encrypt_pm_passwd.sh 1 file changed, 0 insertions(+), 42 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/71/15471/1 diff --git a/backend/manager/dbscripts/upgrade/03_00_0420_encrypt_pm_passwd.sh b/backend/manager/dbscripts/upgrade/03_00_0420_encrypt_pm_passwd.sh deleted file mode 100755 index f2a1052..0000000 --- a/backend/manager/dbscripts/upgrade/03_00_0420_encrypt_pm_passwd.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -#include db general functions -source ./dbfunctions.sh - -# get configuration values needed for password encryption from DB - -caBaseDir=$(get_config_value "CABaseDirectory" "general") -keystore=$(get_config_value "keystoreUrl" "general") -passwd=$(get_config_value "keystorePass" "general") -alias=$(get_config_value "CertAlias" "general") -ear=$(get_config_value "ENGINEEARLib" "general") - -# change pm_password column to text to fit the encrypted password. -CMD="select fn_db_change_column_type('vds_static','pm_password','VARCHAR','text');" -execute_command "${CMD}" "${DATABASE}" ${SERVERNAME} ${PORT} > /dev/null - -# get all hosts that have PM configured (vds_id and pm_password) -filename=$(mktemp) -CMD="select vds_id,vds_name,pm_password from vds_static where pm_enabled = true;" -execute_command "${CMD}" "${DATABASE}" ${SERVERNAME} ${PORT} > ${filename} -while read line -do - # extracting the relevant fields values from each record. - if [ $(echo $line | grep "|" |wc -l) -eq 0 ]; then - continue - fi - hostId=$(echo "${line}" | cut -d "|" -f1 | sed 's/^ *//g' | tr -d ' ') - hostName=$(echo "${line}" | cut -d "|" -f2 | sed 's/^ *//g' | tr -d ' ') - pmPasswd=$(echo "${line}" | cut -d "|" -f3 | sed 's/^ *//g' | tr -d ' ') - if [ "$hostId" != "" -a "$pmPasswd" != "" ]; then - # encrypt the password - encryptedPasswd=$(${caBaseDir}/store-utils.sh -enc ${keystore} ${passwd} ${alias} ${pmPasswd} ${ear}) - if [ $? -ne 0 ]; then - echo "Failed to encrypt host ${hostName} Power Management password, please set host Power Management manually for this host." - else - # update the pm_password field for the given host - CMD="update vds_static set pm_password = '${encryptedPasswd}' where vds_id = '${hostId}';" - execute_command "${CMD}" "${DATABASE}" ${SERVERNAME} ${PORT} > /dev/null - fi - fi -done < ${filename} -- To view, visit http://gerrit.ovirt.org/15471 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c92f1f6af48582a9f6315dd3e42cb8fe4a0b7e8 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Eli Mesika <emes...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches