1
0
Fork 0
mirror of https://github.com/sileht/bird-lg.git synced 2024-11-22 06:54:43 +01:00

Use correct http code

This commit is contained in:
Mehdi Abaakouk 2012-01-26 17:38:57 +01:00
parent ec7e96cf5b
commit 3bddf7ccee

View file

@ -39,20 +39,15 @@ def bird():
if request.path == "/bird": b = BirdSocket(file="/var/run/bird.ctl") if request.path == "/bird": b = BirdSocket(file="/var/run/bird.ctl")
elif request.path == "/bird6": b = BirdSocket(file="/var/run/bird6.ctl") elif request.path == "/bird6": b = BirdSocket(file="/var/run/bird6.ctl")
else: return "No bird socket selected", 700 else: return "No bird socket selected"
query = request.args.get("q","") query = request.args.get("q","")
query = unquote(query) query = unquote(query)
status, result = b.cmd(query) status, result = b.cmd(query)
b.close() b.close()
# FIXME: use status
app.logger.debug(result) return result
if status: status = 200
else: status = 700
return result, status
if __name__ == "__main__": if __name__ == "__main__":