-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.py
More file actions
34 lines (22 loc) · 735 Bytes
/
testing.py
File metadata and controls
34 lines (22 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from flask import Flask, render_template
from fabric import tasks
from fabric.api import settings,hide,env,run
import time
app = Flask(__name__)
env.hosts = ['[email protected]:22']
env.passwords = {'[email protected]:22':'b101nf0'}
def test():
test = run('sleep 5 | echo "hello"').stdout.split("\r\n")
return test
@app.route("/")
def hello():
#task = tasks.execute(test,host='[email protected]:22')["[email protected]:22"]
return render_template("test.html")
@app.route("/check", methods=['GET','POST'])
def check_status():
print "hello"
time.sleep(2)
print "done"
return "success"
if __name__ == "__main__":
app.run(debug=True, host='10.182.131.21', port=5005)