Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set unbuffered through environment variable #39

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion contents/container-inspect
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env python -u
#!/usr/bin/env python
import argparse
import logging
import shlex
import sys
import os
from subprocess import Popen, PIPE, STDOUT

os.environ['PYTHONUNBUFFERED'] = '1'

if os.environ.get('RD_CONFIG_DEBUG') == 'true':
log_level = 'DEBUG'
else:
Expand Down Expand Up @@ -65,3 +67,4 @@ if exitcode != 0:

# done
sys.exit(exitcode)

5 changes: 4 additions & 1 deletion contents/container-kill
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env python -u
#!/usr/bin/env python
import argparse
import logging
import shlex
import sys
import os
from subprocess import Popen, PIPE, STDOUT

os.environ['PYTHONUNBUFFERED'] = '1'

if os.environ.get('RD_CONFIG_DEBUG') == 'true':
log_level = 'DEBUG'
else:
Expand Down Expand Up @@ -66,3 +68,4 @@ if exitcode != 0:

# done
sys.exit(exitcode)

5 changes: 4 additions & 1 deletion contents/container-pause
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env python -u
#!/usr/bin/env python
import argparse
import logging
import shlex
import sys
import os
from subprocess import Popen, PIPE, STDOUT

os.environ['PYTHONUNBUFFERED'] = '1'

if os.environ.get('RD_CONFIG_DEBUG') == 'true':
log_level = 'DEBUG'
else:
Expand Down Expand Up @@ -65,3 +67,4 @@ if exitcode != 0:

# done
sys.exit(exitcode)

5 changes: 4 additions & 1 deletion contents/container-stats
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env python -u
#!/usr/bin/env python
import argparse
import logging
import shlex
import sys
import os
from subprocess import Popen, PIPE, STDOUT

os.environ['PYTHONUNBUFFERED'] = '1'

if os.environ.get('RD_CONFIG_DEBUG') == 'true':
log_level = 'DEBUG'
else:
Expand Down Expand Up @@ -65,3 +67,4 @@ if exitcode != 0:

# done
sys.exit(exitcode)

5 changes: 4 additions & 1 deletion contents/container-unpause
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env python -u
#!/usr/bin/env python
import argparse
import logging
import shlex
import sys
import os
from subprocess import Popen, PIPE, STDOUT

os.environ['PYTHONUNBUFFERED'] = '1'

if os.environ.get('RD_CONFIG_DEBUG') == 'true':
log_level = 'DEBUG'
else:
Expand Down Expand Up @@ -65,3 +67,4 @@ if exitcode != 0:

# done
sys.exit(exitcode)

5 changes: 4 additions & 1 deletion contents/file-copier
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env python -u
#!/usr/bin/env python
import argparse
import logging
import sys
import os
from subprocess import Popen, PIPE, STDOUT

os.environ['PYTHONUNBUFFERED'] = '1'

if os.environ.get('RD_CONFIG_DEBUG') == 'true':
log_level = 'DEBUG'
else:
Expand Down Expand Up @@ -61,3 +63,4 @@ if exitcode != 0:

# done
sys.exit(exitcode)

5 changes: 4 additions & 1 deletion contents/model-source
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python -u
#!/usr/bin/env python
import argparse
import logging
import shlex
Expand All @@ -8,6 +8,8 @@ import json
import re
from subprocess import Popen, PIPE

os.environ['PYTHONUNBUFFERED'] = '1'

if os.environ.get('RD_CONFIG_DEBUG') == 'true':
log_level = 'DEBUG'
else:
Expand Down Expand Up @@ -281,3 +283,4 @@ for container in containers:

# done
print(json.dumps(node_set, indent=4, sort_keys=True))

7 changes: 5 additions & 2 deletions contents/node-execute
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env python -u
#!/usr/bin/env python
import argparse
import logging
import shlex
import sys
import os
from subprocess import Popen, PIPE, STDOUT

os.environ['PYTHONUNBUFFERED'] = '1'

if os.environ.get('RD_CONFIG_DEBUG') == 'true':
log_level = 'DEBUG'
else:
Expand Down Expand Up @@ -97,7 +99,7 @@ p = Popen(
while True:
line = p.stdout.readline().rstrip()
if line:
print(line.decode())
print(line)
if p.poll() is not None:
break

Expand All @@ -108,3 +110,4 @@ if exitcode != 0:

# done
sys.exit(exitcode)

5 changes: 4 additions & 1 deletion contents/run-image
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env python -u
#!/usr/bin/env python
import argparse
import logging
import shlex
import sys
import os
from subprocess import Popen, PIPE, STDOUT

os.environ['PYTHONUNBUFFERED'] = '1'

if os.environ.get('RD_CONFIG_DEBUG') == 'true':
log_level = 'DEBUG'
else:
Expand Down Expand Up @@ -108,3 +110,4 @@ if exitcode != 0:

# done
sys.exit(exitcode)