Sander Hoentjen has posted comments on this change.

Change subject: Use vncviewer passwordFile instead of passwdInput
......................................................................


Patch Set 2: (2 inline comments)

....................................................
File src/ovirtcli/platform/posix/vnc.py
Line 31:     if cmd is None:
Line 32:         raise Error, Messages.Error.NO_CONSOLE_FOUND % ('vnc', 'vnc')
Line 33:     cmd_passwd = util.which('vncpasswd')
Line 34:     if cmd_passwd is None:
Line 35:         raise Error, Messages.Error.NO_CONSOLE_FOUND % ('vncpasswd', 
'vncpasswd')
Done
Line 36:     p = Popen([cmd_passwd, "-f"], shell=False, stdin=PIPE, stdout=PIPE)
Line 37:     password = p.communicate(input=ticket)[0]
Line 38:     args = ['vncviewer', '%s::%s' % (host, port), '-passwordFile', 
'/dev/stdin' ]
Line 39:     pid, pstdin = util.spawn(cmd, args, debug)


Line 33:     cmd_passwd = util.which('vncpasswd')
Line 34:     if cmd_passwd is None:
Line 35:         raise Error, Messages.Error.NO_CONSOLE_FOUND % ('vncpasswd', 
'vncpasswd')
Line 36:     p = Popen([cmd_passwd, "-f"], shell=False, stdin=PIPE, stdout=PIPE)
Line 37:     password = p.communicate(input=ticket)[0]
I am not really a python programmer, but 
http://docs.python.org/2/library/subprocess.html says:
 Popen.communicate(input=None)ΒΆ

    Interact with process: Send data to stdin. Read data from stdout and 
stderr, until end-of-file is reached. Wait for process to terminate. The 
optional input argument should be a string to be sent to the child process, or 
None, if no data should be sent to the child.

So it seems communicate already waits. Am I mistaken here?
Line 38:     args = ['vncviewer', '%s::%s' % (host, port), '-passwordFile', 
'/dev/stdin' ]
Line 39:     pid, pstdin = util.spawn(cmd, args, debug)
Line 40:     os.write(pstdin, password)


--
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: 2
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: master
Gerrit-Owner: Sander Hoentjen <[email protected]>
Gerrit-Reviewer: Ewoud Kohl van Wijngaarden <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Sander Hoentjen <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to