Skip to content

Commit

Permalink
Merge pull request #26 from gmerritt/main
Browse files Browse the repository at this point in the history
Removing "temporary code to debug the elastic beanstalk run context"
  • Loading branch information
gmerritt authored Mar 7, 2024
2 parents 6f4a796 + 0d8401d commit f43bb48
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions application.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,6 @@
>>> flask initdb
"""

# temporary code to debug the elastic beanstalk run context
# run the shell command pwd using os.system and append stdout and stderr to the file /tmp/commands.txt
os.system('/usr/bin/pwd >> /tmp/commands.txt 2>&1')
# run the shell command whoami using os.system and append stdout and stderr to the file /tmp/commands.txt
os.system('/usr/bin/whoami >> /tmp/commands.txt 2>&1')
# run the shell command ls using os.system and append stdout and stderr to the file /tmp/commands.txt
os.system('/usr/bin/ls >> /tmp/commands.txt 2>&1')
# run the shell command ls * using os.system and append stdout and stderr to the file /tmp/commands.txt
os.system('/usr/bin/ls * >> /tmp/commands.txt 2>&1')
# run the shell command which python using os.system and append stdout and stderr to the file /tmp/commands.txt
os.system('/usr/bin/which python >> /tmp/commands.txt 2>&1')

# read the file /tmp/commands.txt and print the contents to the console
with open('/tmp/commands.txt', 'r') as file:
print(file.read())


# When running under WSGI, system environment variables are not automatically made available to Python code, and
# an app restart will result in configurations being lost. We work around this with an explicit load from the shell
# environment, sourcing from the Elastic Beanstalk-provided /opt/python/current/env file if available.
Expand Down

0 comments on commit f43bb48

Please sign in to comment.