mirror of
https://github.com/itsdave-de/msp_remoteadmin.git
synced 2025-05-07 12:45:13 +02:00
debug
This commit is contained in:
parent
7cbe7d92b4
commit
0fcafe9260
@ -12,9 +12,6 @@ PROTOCOL_PORT = {
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def create_session(doc, protocol):
|
def create_session(doc, protocol):
|
||||||
# DEBUG
|
|
||||||
print(f"Values from form: {doc}")
|
|
||||||
|
|
||||||
guaca_config = frappe.get_single('Remote Connections Settings')
|
guaca_config = frappe.get_single('Remote Connections Settings')
|
||||||
guacamole_url = f'{guaca_config.guacamole_server}/api/tokens'
|
guacamole_url = f'{guaca_config.guacamole_server}/api/tokens'
|
||||||
auth = {
|
auth = {
|
||||||
@ -22,7 +19,9 @@ def create_session(doc, protocol):
|
|||||||
'password': guaca_config.get_password('guacamole_pass')
|
'password': guaca_config.get_password('guacamole_pass')
|
||||||
}
|
}
|
||||||
response = requests.post(guacamole_url, data=auth)
|
response = requests.post(guacamole_url, data=auth)
|
||||||
|
|
||||||
print(f"Response CODE: {response.status_code}\nResponde Content: {response.text}")
|
print(f"Response CODE: {response.status_code}\nResponde Content: {response.text}")
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
try:
|
try:
|
||||||
token = response.json()['authToken']
|
token = response.json()['authToken']
|
||||||
@ -32,6 +31,7 @@ def create_session(doc, protocol):
|
|||||||
if token:
|
if token:
|
||||||
print(f"Token: {token}")
|
print(f"Token: {token}")
|
||||||
# Get credentials from IT User Account
|
# Get credentials from IT User Account
|
||||||
|
print(f"Values from form: {doc}")
|
||||||
acc_doc = frappe.get_doc('IT User Account', doc.link)
|
acc_doc = frappe.get_doc('IT User Account', doc.link)
|
||||||
print(f"Print doc values: {acc_doc}")
|
print(f"Print doc values: {acc_doc}")
|
||||||
username = acc_doc.username
|
username = acc_doc.username
|
||||||
|
Loading…
x
Reference in New Issue
Block a user