mirror of
https://github.com/retspen/webvirtmgr.git
synced 2026-04-25 15:45:51 +03:00
[PR #497] [MERGED] String substitution throws TypeError, preventing VNC SSH Tunnel #673
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/retspen/webvirtmgr/pull/497
Author: @alexdo
Created: 2/7/2015
Status: ✅ Merged
Merged: 2/9/2015
Merged by: @retspen
Base:
master← Head:hotfix/console-ssh-type-error📝 Commits (3)
95092f8Fixes a TypeError just before SSH connect08af85bAdds reference to github PR #497 after creationc63ff1aCS: Properly break line to stay within line length📊 Changes
1 file changed (+7 additions, -4 deletions)
View changed files
📝
console/webvirtmgr-console(+7 -4)📄 Description
Hi there,
I just came across an error regarding the noVNC console.
For security reasons, I only want VNC to listen on the loopback interface. In order to do so, I changed my connection type to SSH and set up authentication like described in the wiki.
However, I was unable to connect to the VMs Console via Webvirtmgr.
Skipping through the logs, I found the following exception:
Strangely,
not all arguments converted during string formattingis a TypeError occuring during sprintf-like functions.Digging into
console/webvirtmgr-consoleI tracked the error back to the following block:Unfortunately, string substitution won't work here. Python substitutes the placeholders first, connects the string afterwards. As a result, a TypeError is thrown because six variables are supplied for a string with only one placeholder.
I noticed you strictly use 80 chars per line at max, so my approach is to save the debug message into a variable
error_msg, which will then be substituted with placeholders during the call toself.msg.Feel free to change this however you think would be a better style. These are probably the only three lines of Python I've written in the last five years 😉
Cheers, 🍻
Alexander
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.