This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Example CLI with using envirnment variables. | |
""" | |
# I wiill put this together as a class later. | |
def getenviron(prefix, **kwargs): | |
''' | |
Get a list of environment variables and return a list for ARG Parsing overrides |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
def runningInDocker(): | |
with open('/proc/self/cgroup', 'r') as procfile: | |
for line in procfile: | |
fields = line.strip().split('/') | |
if 'docker' in fields: | |
return True | |
return False |