1
0
Fork 0
mirror of https://github.com/sileht/bird-lg.git synced 2024-12-22 20:44: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")
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 = unquote(query)
status, result = b.cmd(query)
b.close()
app.logger.debug(result)
if status: status = 200
else: status = 700
return result, status
# FIXME: use status
return result
if __name__ == "__main__":