Skip to content
Merged
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
8 changes: 4 additions & 4 deletions manifests/07-downloads-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
- '-c'
- |
cat <<EOF >>/tmp/serve.py
import BaseHTTPServer, errno, os, re, signal, SimpleHTTPServer, socket, sys, tarfile, tempfile, threading, time, zipfile
import errno, http.server, os, re, signal, socket, sys, tarfile, tempfile, threading, time, zipfile

signal.signal(signal.SIGTERM, lambda signum, frame: sys.exit(0))

Expand Down Expand Up @@ -88,7 +88,7 @@ spec:
self.start()

def run(self):
httpd = BaseHTTPServer.HTTPServer(addr, SimpleHTTPServer.SimpleHTTPRequestHandler, False)
httpd = http.server.HTTPServer(addr, http.server.SimpleHTTPRequestHandler, False)

# Prevent the HTTP server from re-binding every handler.
# https://stackoverflow.com/questions/46210672/
Expand Down Expand Up @@ -135,7 +135,7 @@ spec:
for directory in directories:
write_index(
path=os.path.join(root, directory, 'index.html'),
message='<p>Directory listings are disabled. See <a href="">here</a> for available content.</p>'.format(root_link),
message='<p>Directory listings are disabled. See <a href="{}">here</a> for available content.</p>'.format(root_link),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but thanks for this fix :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found this testing the script with python3, but yes, it was broken before too. The root index.html still doesn't work as intended though, nor did it before, but I'm not sure how to fix it yet. (Nothing to do with this PR though.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spadgett something to potentially clean up in the future

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#464 has the remaining cleanup

)
write_index(
path=os.path.join(root, 'index.html'),
Expand Down Expand Up @@ -168,5 +168,5 @@ spec:
[Thread(i, socket=sock) for i in range(100)]
time.sleep(9e9)
EOF
exec python2 /tmp/serve.py # the cli image only has Python 2.7
exec python3 /tmp/serve.py
terminationGracePeriodSeconds: 1