forked from FNNDSC/pfioh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-entrypoint.py
executable file
·56 lines (38 loc) · 993 Bytes
/
docker-entrypoint.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python3
# Single entry point / dispatcher for simplified running of
#
## pman
## pfioh
## purl
#
import argparse
import os
str_desc = """
NAME
docker-entrypoint.py
SYNOPSIS
docker-entrypoint.py [optional cmd args for pfioh]
DESCRIPTION
'docker-entrypoint.py' is the main entry point for running the pfioh container.
"""
def pfioh_do(args, unknown):
str_otherArgs = ' '.join(unknown)
str_CMD = "/usr/local/bin/pfioh --forever %s" % (str_otherArgs)
return str_CMD
parser = argparse.ArgumentParser(description = str_desc)
parser.add_argument(
'--msg',
action = 'store',
dest = 'msg',
default = '',
help = 'JSON msg payload'
)
args, unknown = parser.parse_known_args()
if __name__ == '__main__':
try:
fname = 'pfioh_do(args, unknown)'
str_cmd = eval(fname)
# print(str_cmd)
os.system(str_cmd)
except:
print("Misunderstood container app... exiting.")