Skip to content

Commit

Permalink
Merge bin/opensvc into bin/om and remove bin/opensvc
Browse files Browse the repository at this point in the history
Point the nodemgr, svcmon, svcmgr symlinks to bin/om.
Create a opensvc symlink to bin/om, for backward compat.
  • Loading branch information
cvaroqui authored and cgalibern committed May 29, 2020
1 parent 18e0061 commit c1f9be2
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 80 deletions.
2 changes: 1 addition & 1 deletion bin/nodemgr
46 changes: 45 additions & 1 deletion bin/om
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,45 @@ then
fi

INTER="$OSVC_PYTHON $OSVC_PYTHON_ARGS"
BASENAME=`basename $0`

case $BASENAME in
om)
;;
opensvc)
#
# Use me as the shebang for python modules to be garantied the
# same python requirements than the agent are met (ie 2.6+).
#
# Example: #!/usr/bin/env opensvc
#
exec "$OSVC_PYTHON" "$@"
;;
nodemgr)
KIND=node
;;
svcmgr)
KIND=svc
;;
volmgr)
KIND=vol
;;
usrmgr)
KIND=usr
;;
secmgr)
KIND=sec
;;
cfgmgr)
KIND=cfg
;;
ccfgmgr)
KIND=ccfg
;;
svcmon)
KIND=mon
;;
esac

main() {
if test -z "$OSVC_CONTEXT"
Expand All @@ -40,14 +79,19 @@ main() {
;;
esac
fi
if test -n "$KIND"
then
$SUDO PYTHONPATH="$OSVC_ROOT_PATH" $INTER $OSVC_PYTHON_ARGS -m opensvc $KIND "$@"
return $?
fi
test -z "$SUDO" && SUDO=env || SUDO="$SUDO OSVC_NAMESPACE=$OSVC_NAMESPACE"
case $1 in
ns)
echo "The 'om' alias must be sourced to handle ns actions" >&2
exit 1
;;
*)
$SUDO PYTHONPATH=$OSVC_ROOT_PATH $INTER -m opensvc "$@"
$SUDO PYTHONPATH="$OSVC_ROOT_PATH" $INTER $OSVC_PYTHON_ARGS -m opensvc "$@"
;;
esac
}
Expand Down
76 changes: 0 additions & 76 deletions bin/opensvc

This file was deleted.

1 change: 1 addition & 0 deletions bin/opensvc
2 changes: 1 addition & 1 deletion bin/svcmgr
2 changes: 1 addition & 1 deletion bin/svcmon

0 comments on commit c1f9be2

Please sign in to comment.