-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from ZLLentz/enh_check_python
ENH: polish scripts (error handling, paths)
- Loading branch information
Showing
8 changed files
with
55 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
# This is meant to be sourced. | ||
# Helper script for activating the correct python environment. | ||
# Sets a default env or you can provide your own activate path for testing | ||
|
||
DEFAULT_ENV=/cds/group/pcds/pyps/conda/venvs/ansible/bin/activate | ||
|
||
if [ -f "${ANSIBLE_PYTHON_ACTIVATE:=${DEFAULT_ENV}}" ]; then | ||
source "${ANSIBLE_PYTHON_ACTIVATE}" | ||
else | ||
echo "No Python activation script found at ${ANSIBLE_PYTHON_ACTIVATE}" | ||
return 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# Sourceable script to set common vars for the various scripts. | ||
# This sets a bunch of environment variables related to known paths | ||
# and puts us into the ansible directory for the duration of the | ||
# encapsulating script. | ||
set -e | ||
|
||
THIS_SCRIPT="$(realpath "${BASH_SOURCE[0]}")" | ||
THIS_DIR="$(dirname "${THIS_SCRIPT}")" | ||
|
||
ANSIBLE_ROOT="$(realpath "${THIS_DIR}/..")" | ||
export ANSIBLE_ROOT | ||
INVENTORY_PATH="${ANSIBLE_ROOT}/inventory/plcs.yaml" | ||
export INVENTORY_PATH | ||
SSH_CONFIG="${ANSIBLE_ROOT}/ssh_config" | ||
export SSH_CONFIG | ||
|
||
cd "${ANSIBLE_ROOT}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters