Ewoud Kohl van Wijngaarden has posted comments on this change. Change subject: Use vncviewer passwordFile instead of passwdInput ......................................................................
Patch Set 1: I would prefer that you didn't submit this (3 inline comments) .................................................... File src/ovirtcli/platform/posix/vnc.py Line 18: import os Line 19: from cli.error import Error Line 20: from ovirtcli.platform import util Line 21: from cli.messages import Messages Line 22: from subprocess import * Importing everything may not be needed. I'd just import Popen. Line 23: Line 24: Line 25: def launch_vnc_viewer(host, port, ticket, debug=False): Line 26: """Launch a VNC viewer on host::port with `password'.""" Line 29: raise Error, Messages.Error.INVALID_ENV_MODE_FOR_CONSOLE % 'vnc' Line 30: cmd = util.which('vncviewer') Line 31: if cmd is None: Line 32: raise Error, Messages.Error.NO_CONSOLE_FOUND % ('vnc', 'vnc') Line 33: p = Popen(["vncpasswd", "-f"], shell=False, stdin=PIPE, stdout=PIPE) Maybe use the same logic as above to check if vncpasswd is available? Line 34: pwd = p.communicate(input=ticket)[0] Line 35: args = ['vncviewer', '%s::%s' % (host, port), '-passwordFile', '/dev/stdin' ] Line 36: pid, pstdin = util.spawn(cmd, args, debug) Line 37: os.write(pstdin, pwd) Line 30: cmd = util.which('vncviewer') Line 31: if cmd is None: Line 32: raise Error, Messages.Error.NO_CONSOLE_FOUND % ('vnc', 'vnc') Line 33: p = Popen(["vncpasswd", "-f"], shell=False, stdin=PIPE, stdout=PIPE) Line 34: pwd = p.communicate(input=ticket)[0] I think password is a better name. I first thought pwd would be a path. Line 35: args = ['vncviewer', '%s::%s' % (host, port), '-passwordFile', '/dev/stdin' ] Line 36: pid, pstdin = util.spawn(cmd, args, debug) Line 37: os.write(pstdin, pwd) -- To view, visit http://gerrit.ovirt.org/11857 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I76178f15217c421d88879c88534d7cb3a7583426 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine-cli Gerrit-Branch: master Gerrit-Owner: Sander Hoentjen <san...@hoentjen.eu> Gerrit-Reviewer: Ewoud Kohl van Wijngaarden <ew...@kohlvanwijngaarden.nl> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches