mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-02-12 21:11:53 +00:00
properly validate hostname properly (hopefully for the last time)
This commit is contained in:
parent
7db17ab91d
commit
e608c0dc10
1 changed files with 7 additions and 0 deletions
|
@ -1,3 +1,6 @@
|
|||
import psycopg2
|
||||
|
||||
|
||||
def get_next_ip(starrs, range_name):
|
||||
c = starrs.cursor()
|
||||
try:
|
||||
|
@ -42,6 +45,10 @@ def renew_ip(starrs, addr):
|
|||
def check_hostname(starrs, hostname):
|
||||
c = starrs.cursor()
|
||||
try:
|
||||
c.execute("BEGIN")
|
||||
c.callproc("api.initialize", ('root', ))
|
||||
c.callproc("api.validate_name", (hostname, ))
|
||||
c.execute("COMMIT")
|
||||
c.execute("BEGIN")
|
||||
c.callproc("api.initialize", ('root', ))
|
||||
c.callproc("api.validate_domain", (hostname, 'csh.rit.edu'))
|
||||
|
|
Loading…
Reference in a new issue