summaryrefslogtreecommitdiff
path: root/contrib/python/podman/examples/run_example.sh
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-01-10 11:11:46 -0800
committerGitHub <noreply@github.com>2019-01-10 11:11:46 -0800
commit6524041fb0ebfc35dafe3bb7bebbd4dfa27ba5e8 (patch)
treecf6e4191124ea1c44b9cadb504c0b2f5e6269a50 /contrib/python/podman/examples/run_example.sh
parente4525cf844535014923a2253e8531d92d9e556e5 (diff)
parent45fb935fe44a383ae14f16ab533281687d642c5e (diff)
downloadpodman-6524041fb0ebfc35dafe3bb7bebbd4dfa27ba5e8.tar.gz
podman-6524041fb0ebfc35dafe3bb7bebbd4dfa27ba5e8.tar.bz2
podman-6524041fb0ebfc35dafe3bb7bebbd4dfa27ba5e8.zip
Merge pull request #2119 from jwhonce/wip/python_podman
Move python code from contrib to it's own repo python-podman
Diffstat (limited to 'contrib/python/podman/examples/run_example.sh')
-rwxr-xr-xcontrib/python/podman/examples/run_example.sh43
1 files changed, 0 insertions, 43 deletions
diff --git a/contrib/python/podman/examples/run_example.sh b/contrib/python/podman/examples/run_example.sh
deleted file mode 100755
index d81ddf456..000000000
--- a/contrib/python/podman/examples/run_example.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-export PYTHONPATH=..
-
-function examples {
- for file in $@; do
- python3 -c "import ast; f=open('"${file}"'); t=ast.parse(f.read()); print(ast.get_docstring(t) + ' -- "${file}"')"
- done
-}
-
-while getopts "lh" arg; do
- case $arg in
- l ) examples $(ls eg_*.py); exit 0 ;;
- h ) echo 1>&2 $0 [-l] [-h] filename ; exit 2 ;;
- esac
-done
-shift $((OPTIND-1))
-
-# podman needs to play some games with resources
-if [[ $(id -u) != 0 ]]; then
- echo 1>&2 $0 must be run as root.
- exit 2
-fi
-
-if ! systemctl --quiet is-active io.podman.socket; then
- echo 1>&2 'podman is not running. systemctl enable --now io.podman.socket'
- exit 1
-fi
-
-function cleanup {
- podman rm $1 >/dev/null 2>&1
-}
-
-# Setup storage with an image and container
-podman pull alpine:latest >/tmp/podman.output 2>&1
-CTNR=$(podman create alpine)
-trap "cleanup $CTNR" EXIT
-
-if [[ -f $1 ]]; then
- python3 $1
-else
- python3 $1.py
-fi