diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2021-07-30 20:12:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2021-08-04 17:45:44 +0000 |
commit | 494fe42b27cf150df414a57eaf689dab431929c1 (patch) | |
tree | dfa0e9bbf2c2ab4fb0c3473f2fa53aac7960c059 /libexec/container | |
parent | Releasing version 20210804. (diff) | |
download | compute-tools-494fe42b27cf150df414a57eaf689dab431929c1.tar.xz compute-tools-494fe42b27cf150df414a57eaf689dab431929c1.zip |
python module (FIXME)next+python
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'libexec/container')
-rwxr-xr-x | libexec/container/version | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/libexec/container/version b/libexec/container/version index 3b33a4d..3cb0df8 100755 --- a/libexec/container/version +++ b/libexec/container/version @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/python3 # Copyright (C) 2014-2021 Daniel Baumann <daniel.baumann@open-infrastructure.net> # @@ -17,33 +17,36 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -set -e +from sys import exit -PROJECT="open-infrastructure" -SOFTWARE="compute-tools" -PROGRAM="container" -COMMAND="$(basename ${0})" +import compute_tools.container as container -HOOKS="/etc/${SOFTWARE}/hooks" -SHARE="/usr/share/${SOFTWARE}" +def main(): + # run + container.print_version() + + exit(0) + +if __name__ == '__main__': + main() -# Pre hooks -for FILE in "${HOOKS}/pre-${COMMAND}".* "${HOOKS}/${NAME}.pre-${COMMAND}" -do - if [ -x "${FILE}" ] - then - "${FILE}" - fi -done -# Run -cat "${SHARE}/VERSION.txt" + + +# Pre hooks +#for FILE in "${HOOKS}/pre-${COMMAND}".* "${HOOKS}/${NAME}.pre-${COMMAND}" +#do +# if [ -x "${FILE}" ] +# then +# "${FILE}" +# fi +#done # Post hooks -for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}" -do - if [ -x "${FILE}" ] - then - "${FILE}" - fi -done +#for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}" +#do +# if [ -x "${FILE}" ] +# then +# "${FILE}" +# fi +#done |