From f189b00932e67b6b01349b8cd7beac43e0ca1ea6 Mon Sep 17 00:00:00 2001 From: Jordan Rodgers Date: Mon, 19 Mar 2018 14:27:11 -0400 Subject: [PATCH] add logging to debug boot order issue on openshift --- proxstar/__init__.py | 2 ++ proxstar/static/js/script.js | 2 ++ proxstar/vm.py | 1 + 3 files changed, 5 insertions(+) diff --git a/proxstar/__init__.py b/proxstar/__init__.py index caa24c6..088bfa7 100644 --- a/proxstar/__init__.py +++ b/proxstar/__init__.py @@ -377,10 +377,12 @@ def boot_order(vmid): user = User(session['userinfo']['preferred_username']) proxmox = connect_proxmox() if user.rtp or int(vmid) in user.allowed_vms: + print(request.form) boot_order = [] for key, value in request.form.items(): boot_order.append(value) vm = VM(vmid) + print(boot_order) vm.set_boot_order(boot_order) return '', 200 else: diff --git a/proxstar/static/js/script.js b/proxstar/static/js/script.js index c92bcf9..8d46bc7 100644 --- a/proxstar/static/js/script.js +++ b/proxstar/static/js/script.js @@ -988,6 +988,8 @@ $("#edit-boot-order").click(function(){ var data = new FormData(); for (k = 0; k < boot_order.length; k++) { e = document.getElementById(`boot-order-${k + 1}`); + console.log(k + 1); + console.log(e.options[e.selectedIndex].value); data.append(`${k + 1}`, e.options[e.selectedIndex].value); } fetch(`/vm/${vmid}/boot_order`, { diff --git a/proxstar/vm.py b/proxstar/vm.py index 86f6f59..2f83c53 100644 --- a/proxstar/vm.py +++ b/proxstar/vm.py @@ -115,6 +115,7 @@ class VM(object): raw_boot_order = '' for i in range(0, len(boot_order)): raw_boot_order += boot_order_lookup[boot_order[i]] + print(raw_boot_order) proxmox.nodes(self.node).qemu(self.id).config.put(boot=raw_boot_order) @lazy_property