Fix all incorrect imports

This commit is contained in:
Galen Guyer 2019-11-01 17:03:35 -04:00
parent c6b6b8e38c
commit 0771e1343a
No known key found for this signature in database
GPG key ID: 6E39D00D77389D4E
2 changed files with 9 additions and 7 deletions

View file

@ -14,10 +14,11 @@ from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker from sqlalchemy.orm import sessionmaker
from flask import Flask, render_template, request, redirect, session, abort, url_for from flask import Flask, render_template, request, redirect, session, abort, url_for
from proxstar.db import (Base, datetime, get_pool_cache, renew_vm_expire, set_user_usage_limits, get_template, from proxstar.db import (Base, datetime, get_pool_cache, renew_vm_expire, set_user_usage_limits, get_template,
get_templates, get_allowed_users, add_ignored_pool, delete_ignored_pool, add_allowed_user, delete_allowed_user, get_templates, get_allowed_users, add_ignored_pool, delete_ignored_pool, add_allowed_user,
get_template_disk, set_template_info) delete_allowed_user,
get_template_disk, set_template_info)
from proxstar.vnc import (send_stop_ssh_tunnel, stop_ssh_tunnel, add_vnc_target, start_ssh_tunnel, get_vnc_targets, from proxstar.vnc import (send_stop_ssh_tunnel, stop_ssh_tunnel, add_vnc_target, start_ssh_tunnel, get_vnc_targets,
delete_vnc_target, stop_websockify) delete_vnc_target, stop_websockify)
from proxstar.auth import get_auth from proxstar.auth import get_auth
from proxstar.util import gen_password from proxstar.util import gen_password
from proxstar.starrs import check_hostname, renew_ip from proxstar.starrs import check_hostname, renew_ip
@ -63,7 +64,7 @@ starrs = psycopg2.connect(
from proxstar.vm import VM from proxstar.vm import VM
from proxstar.user import User from proxstar.user import User
from proxstar.tasks import (generate_pool_cache_task, process_expiring_vms_task, cleanup_vnc_task, from proxstar.tasks import (generate_pool_cache_task, process_expiring_vms_task, cleanup_vnc_task,
delete_vm_task, create_vm_task, setup_template_task) delete_vm_task, create_vm_task, setup_template_task)
if 'generate_pool_cache' not in scheduler: if 'generate_pool_cache' not in scheduler:
logging.info('adding generate pool cache task to scheduler') logging.info('adding generate pool cache task to scheduler')
@ -90,7 +91,7 @@ if 'cleanup_vnc' not in scheduler:
def add_rq_dashboard_auth(blueprint): def add_rq_dashboard_auth(blueprint):
@blueprint.before_request @blueprint.before_request
@auth.oidc_auth @auth.oidc_auth
def rq_dashboard_auth(*args, **kwargs): #pylint: disable=unused-argument,unused-variable def rq_dashboard_auth(*args, **kwargs): # pylint: disable=unused-argument,unused-variable
if 'rtp' not in session['userinfo']['groups']: if 'rtp' not in session['userinfo']['groups']:
abort(403) abort(403)
@ -534,7 +535,7 @@ def cleanup_vnc():
if tunnel: if tunnel:
if not next((conn for conn in psutil.net_connections() if not next((conn for conn in psutil.net_connections()
if conn.laddr[1] == int(target['port']) if conn.laddr[1] == int(target['port'])
and conn.status == 'ESTABLISHED'), None): and conn.status == 'ESTABLISHED'), None):
try: try:
tunnel.stop() tunnel.stop()
except: except:

View file

@ -1,8 +1,9 @@
from proxmoxer.core import ResourceException from proxmoxer.core import ResourceException
from rq.registry import StartedJobRegistry from rq.registry import StartedJobRegistry
from proxstar.ldapdb import is_active, is_user, is_current_student
from proxstar import db, q, redis_conn from proxstar import db, q, redis_conn
from proxstar.db import get_allowed_users, is_active, is_current_student, is_rtp, is_user, get_user_usage_limits from proxstar.db import get_allowed_users, get_user_usage_limits, is_rtp
from proxstar.proxmox import connect_proxmox, get_pools from proxstar.proxmox import connect_proxmox, get_pools
from proxstar.util import lazy_property from proxstar.util import lazy_property
from proxstar.vm import VM from proxstar.vm import VM