-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Boekhorst <[email protected]>
- Loading branch information
1 parent
a30c9ca
commit d27d5ad
Showing
2 changed files
with
77 additions
and
30 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
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,29 @@ | ||
#!/bin/env bash | ||
|
||
# Check if a version argument is provided | ||
if [ $# -eq 1 ]; then | ||
RADOSLIB_VERSION="$1" | ||
else | ||
# Default version if no argument is provided | ||
RADOSLIB_VERSION="2.0.0" | ||
fi | ||
|
||
# Get the location of the installed rados library | ||
GENERAL_LIB_LOCATION=$(pip show rados | grep -oP "(?<=Location: ).*") | ||
|
||
# Get the installed version of the rados library | ||
RADOSLIB_INSTALLED_VERSION=$(pip show rados | grep Version | awk '{print $2}') | ||
|
||
# Check if the rados library is installed | ||
if [ -z "$GENERAL_LIB_LOCATION" ]; then | ||
echo -e "\033[0;31mERROR: 'rados' library not found. Please make sure it's installed.\033[0m" | ||
exit 1 | ||
fi | ||
|
||
# Check if the installed version matches the expected version | ||
if [ "$RADOSLIB_INSTALLED_VERSION" != "$RADOSLIB_VERSION" ]; then | ||
echo -e "\033[0;31mERROR: 'rados' library version $RADOSLIB_INSTALLED_VERSION does not match the expected version $RADOSLIB_VERSION.\033[0m" | ||
exit 1 | ||
else | ||
echo -e "\033[0;32m'rados' library version $RADOSLIB_INSTALLED_VERSION is correct.\033[0m" | ||
fi |