Move schema to homedir, add more docs

Update configs
This commit is contained in:
Will Nilges 2021-10-07 01:26:57 -04:00
parent 33a8cdb523
commit e3783a4919
6 changed files with 34 additions and 16109 deletions

View file

@ -203,10 +203,7 @@ def isos():
@app.route('/hostname/<string:name>')
@auth.oidc_auth
def hostname(name):
if app.config['USE_STARRS']:
valid, available = check_hostname(starrs, name)
else:
valid, available = (True, True)
valid, available = check_hostname(starrs, name) if app.config['USE_STARRS'] else (True, True)
if not valid:
return 'invalid'
if not available:
@ -468,10 +465,9 @@ def create():
if usage_check:
return usage_check
else:
if app.config['USE_STARRS']:
valid, available = check_hostname(starrs, name)
else:
valid, available = (True, True)
valid, available = (
check_hostname(starrs, name) if app.config['USE_STARRS'] else (True, True)
)
if valid and available:
if template == 'none':

View file

@ -196,12 +196,12 @@ def setup_template_task(template_id, name, user, ssh_key, cores, memory):
delete_vm_task(vmid)
return
vm = VM(vmid)
if app.config['USE_STARRS']:
logging.info('[{}] Registering in STARRS.'.format(name))
set_job_status(job, 'registering in STARRS')
ip = get_next_ip(starrs, app.config['STARRS_IP_RANGE'])
register_starrs(starrs, name, app.config['STARRS_USER'], vm.get_mac(), ip)
vm = VM(vmid)
get_vm_expire(db, vmid, app.config['VM_EXPIRE_MONTHS'])
logging.info('[{}] Setting CPU and memory.'.format(name))
set_job_status(job, 'setting CPU and memory')