mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-02-12 04:51:51 +00:00
Linting
This commit is contained in:
parent
19f0437a40
commit
8ed767060b
3 changed files with 9 additions and 2 deletions
|
@ -2,6 +2,7 @@ import os
|
|||
import subprocess
|
||||
|
||||
from flask import Flask
|
||||
|
||||
app = Flask(__name__)
|
||||
if os.path.exists(os.path.join(app.config.get('ROOT_DIR', os.getcwd()), "config_local.py")):
|
||||
config = os.path.join(app.config.get('ROOT_DIR', os.getcwd()), "config_local.py")
|
||||
|
|
|
@ -336,7 +336,11 @@ def vm_console(vmid):
|
|||
# import pdb; pdb.set_trace()
|
||||
vm = VM(vmid)
|
||||
vnc_ticket, vnc_port = open_vnc_session(
|
||||
vmid, vm.node, app.config['PROXMOX_USER'], app.config['PROXMOX_TOKEN_NAME'], app.config['PROXMOX_TOKEN_VALUE']
|
||||
vmid,
|
||||
vm.node,
|
||||
app.config['PROXMOX_USER'],
|
||||
app.config['PROXMOX_TOKEN_NAME'],
|
||||
app.config['PROXMOX_TOKEN_VALUE'],
|
||||
)
|
||||
node = f'{vm.node}.csh.rit.edu'
|
||||
token = add_vnc_target(node, vnc_port)
|
||||
|
|
|
@ -90,7 +90,9 @@ def open_vnc_session(vmid, node, proxmox_user, proxmox_token_name, proxmox_token
|
|||
verify=False,
|
||||
timeout=5,
|
||||
params=proxy_params,
|
||||
headers={'Authorization': f"PVEAPIToken={proxmox_user}!{proxmox_token_name}={proxmox_token_value}"},
|
||||
headers={
|
||||
'Authorization': f'PVEAPIToken={proxmox_user}!{proxmox_token_name}={proxmox_token_value}'
|
||||
},
|
||||
).json()['data']
|
||||
|
||||
return urllib.parse.quote_plus(vncproxy_response_data['ticket']), vncproxy_response_data['port']
|
||||
|
|
Loading…
Reference in a new issue