Commit 9174e666 authored by Chris Hines's avatar Chris Hines
Browse files

proxy download service didn't seem to like being on route /download

parent 3bcb2865
......@@ -2,8 +2,8 @@ from flask import Flask, request
import flask
app = Flask(__name__)
@app.route("/download", methods=['GET'])
def download():
@app.route("/retrieve", methods=['GET'])
def retrieve():
url = request.args.get('url')
import logging
logger = logging.debug("get creds from {}".format(url))
......@@ -16,7 +16,10 @@ def get_credentials(url):
import os
import requests
s = requests.Session()
r = s.get(url)
try:
r = s.get(url)
except:
return (None,None,None)
data = r.json()
return(data['key'],data['cert'],data['uri'])
......@@ -24,6 +27,8 @@ def use_ssh(url):
import os
(key,cert,uri) = get_credentials(url)
if key is None:
return "Sorry, I can't do that Dave"
username,hostpath = uri.split('@')
print(uri)
host,path = hostpath.split(':')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment