mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
Merge pull request #84 from mxmeinhold/boot-order-and-fixes
Boot Ordering and other fixes
This commit is contained in:
commit
f8af77469e
2 changed files with 4 additions and 3 deletions
|
@ -406,7 +406,7 @@ def delete(vmid):
|
|||
|
||||
@app.route('/vm/<string:vmid>/boot_order', methods=['POST'])
|
||||
@auth.oidc_auth
|
||||
def get_boot_order(vmid):
|
||||
def set_boot_order(vmid):
|
||||
user = User(session['userinfo']['preferred_username'])
|
||||
connect_proxmox()
|
||||
if user.rtp or int(vmid) in user.allowed_vms:
|
||||
|
|
|
@ -27,8 +27,8 @@ from proxstar.vnc import send_stop_ssh_tunnel
|
|||
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
|
||||
|
||||
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')
|
||||
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')
|
||||
else:
|
||||
config = os.path.join(app.config.get('ROOT_DIR', os.getcwd()), 'config.py')
|
||||
app.config.from_pyfile(config)
|
||||
|
@ -90,6 +90,7 @@ def create_vm_task(user, name, cores, memory, disk, iso):
|
|||
register_starrs(starrs, name, app.config['STARRS_USER'], vm.get_mac(), ip)
|
||||
set_job_status(job, 'setting VM expiration')
|
||||
get_vm_expire(db, vmid, app.config['VM_EXPIRE_MONTHS'])
|
||||
vm.set_boot_order(['Hard Disk', 'CD-ROM', 'Network'])
|
||||
logging.info('[{}] VM successfully provisioned.'.format(name))
|
||||
set_job_status(job, 'complete')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue