diff --git a/sbin/dm_sync_aps_user_accounts.sh b/sbin/dm_sync_aps_user_accounts.sh new file mode 100755 index 0000000000000000000000000000000000000000..c438d1bcf4cae65cf4593c1f7483adb7a778380c --- /dev/null +++ b/sbin/dm_sync_aps_user_accounts.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# +# Script used for syncing APS user accounts + +# Usage: +# +# $0 +# + +CURRENT_DIR=`pwd` +MY_DIR=`dirname $0` && cd $MY_DIR && MY_DIR=`pwd` +cd $CURRENT_DIR +DM_ROOT_DIR=$MY_DIR/.. +DM_ENV_FILE=${DM_ROOT_DIR}/setup.sh +if [ ! -f ${DM_ENV_FILE} ]; then + echo "Environment file ${DM_ENV_FILE} does not exist." + exit 2 +fi +. ${DM_ENV_FILE} > /dev/null +DM_CONFIG_FILE=$DM_ROOT_DIR/../etc/dm.aps-user-update-utilities.conf + +# Simply run update command after sourcing setup file +dm-update-users-from-aps-db --config-file=$DM_CONFIG_FILE --quiet + diff --git a/setup.sh b/setup.sh index 5bf05917a28f1e1d692376c49e2abb49db358728..ba2bb4f5ade39683e52e3ecd9495afa87ac601bd 100644 --- a/setup.sh +++ b/setup.sh @@ -109,6 +109,7 @@ fi oracleDir=$DM_SUPPORT_DIR/opt/oracle-client/$DM_HOST_ARCH if [ -d $oracleDir ]; then LD_LIBRARY_PATH=$oracleDir:$LD_LIBRARY_PATH + PATH=$oracleDir:$PATH fi # Get back to where we were before invoking the setup script diff --git a/src/python/dm/__init__.py b/src/python/dm/__init__.py index f024d30ee0540f374a9d103799c897379f732b69..7000cfa190658a75fd4d03541540dbcb9243a93a 100644 --- a/src/python/dm/__init__.py +++ b/src/python/dm/__init__.py @@ -1 +1 @@ -__version__ = "0.13 (2016.05.27)" +__version__ = "0.14 (2016.10.13)" diff --git a/src/python/dm/aps_user_db/cli/updateUsersFromApsDbCli.py b/src/python/dm/aps_user_db/cli/updateUsersFromApsDbCli.py index b9870b3ab7c2dca9f7bbaeda775981a5377bc711..afc0e615e3f2fbb1081a674c793dd849e0235af6 100755 --- a/src/python/dm/aps_user_db/cli/updateUsersFromApsDbCli.py +++ b/src/python/dm/aps_user_db/cli/updateUsersFromApsDbCli.py @@ -150,6 +150,10 @@ Description: # datetime cannot handle time zone at the moment timeZonePos = dmLastUpdate.rfind('-') dmLastUpdate = dmLastUpdate[0:timeZonePos] + # remove microseconds from the timestamp + secondPos = dmLastUpdate.rfind('.') + if secondPos > 0: + dmLastUpdate = dmLastUpdate[0:secondPos] dmLastUpdate = datetime.datetime.strptime(dmLastUpdate, '%Y-%m-%d %H:%M:%S') if not dmLastUpdate or dmLastUpdate < apsLastChangeDate: # User needs update