Skip to content
Snippets Groups Projects
Commit 234af166 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update sudo handling in ceph checks

parent e14e4b61
No related branches found
No related tags found
1 merge request!194update sudo handling in ceph checks
...@@ -88,9 +88,11 @@ case "$1" in ...@@ -88,9 +88,11 @@ case "$1" in
*) *)
esac esac
# --- check required tools
ph.require ceph
if ! data=$( sudo -n /bin/ceph osd tree 2>&1 ); then if ! data=$( sudo -n /bin/ceph osd tree 2>&1 ); then
echo "$data" ph.abort "UNKNOWN: No sudo permissions to execute ceph commands."
ph.abort "UNKNOWN: ceph is not available or no sudo permissions to execute ceph commands."
fi fi
# set default / override from command line params # set default / override from command line params
......
...@@ -67,8 +67,7 @@ EOF ...@@ -67,8 +67,7 @@ EOF
function readCephStatus(){ function readCephStatus(){
if ! data=$( sudo -n /bin/ceph status 2>&1 ); then if ! data=$( sudo -n /bin/ceph status 2>&1 ); then
echo "$data" ph.abort "UNKNOWN: No sudo permissions to execute ceph commands."
ph.abort "UNKNOWN: ceph is not available or no sudo permissions to execute ceph commands."
fi fi
} }
function getCephStatus(){ function getCephStatus(){
...@@ -98,6 +97,9 @@ case "$1" in ...@@ -98,6 +97,9 @@ case "$1" in
*) *)
esac esac
# --- check required tools
ph.require ceph
readCephStatus readCephStatus
if [ ! -f $initfile ]; then if [ ! -f $initfile ]; then
echo " echo "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment