Skip to content

Commit

Permalink
Fix WMKS link generation
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslavNqualisystems committed Aug 25, 2022
1 parent 7442514 commit 98598b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cloudshell/cp/vcenter/utils/get_vm_web_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"&sessionTicket={session_ticket}"
"&thumbprint={thumbprint}"
)

VM_WEB_CONSOLE_NEW_LINK_TPL = (
"https://{vcenter_ip}/ui/webconsole.html?"
"vmId={vm_moid}"
"&vmName={vm_name}"
"&numMksConnections={num_mks_connections}"
"&serverGuid={server_guid}"
"&host={vcenter_host}:443"
"&sessionTicket={session_ticket}"
"&thumbprint={thumbprint}"
"&locale=en-US"
)


Expand All @@ -41,7 +41,6 @@ def get_vm_console_link(
vc_cert = ssl.get_server_certificate((vcenter_host, HTTPS_PORT)).encode()
vc_pem = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, vc_cert)
thumbprint = vc_pem.digest("sha1")

link = VM_WEB_CONSOLE_NEW_LINK_TPL if new_version else VM_WEB_CONSOLE_OLD_LINK_TPL
return link.format(
vcenter_ip=vcenter_host,
Expand All @@ -52,4 +51,5 @@ def get_vm_console_link(
https_port=HTTPS_PORT,
session_ticket=quote(si.acquire_session_ticket()),
thumbprint=quote(thumbprint.decode()),
num_mks_connections=vm._entity.config.maxMksConnections,
)
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.7
4.2.8

0 comments on commit 98598b7

Please sign in to comment.