mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
check hostname for invalid characters
This commit is contained in:
parent
29873e2055
commit
f3d69381c1
4 changed files with 29 additions and 11 deletions
9
app.py
9
app.py
|
@ -46,8 +46,13 @@ def hostname(name):
|
|||
starrs = connect_starrs(
|
||||
app.config['STARRS_DB_NAME'], app.config['STARRS_DB_USER'],
|
||||
app.config['STARRS_DB_HOST'], app.config['STARRS_DB_PASS'])
|
||||
result = check_hostname(starrs, name)
|
||||
return str(result)
|
||||
valid, available = check_hostname(starrs, name)
|
||||
if not valid:
|
||||
return 'invalid'
|
||||
if not available:
|
||||
return 'taken'
|
||||
else:
|
||||
return 'ok'
|
||||
|
||||
|
||||
@app.route("/vm/<string:vmid>")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue