Juan Hernandez has posted comments on this change.

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


Patch Set 2: (2 inline comments)

Some minor comments inside.

....................................................
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')
If you reuse the NO_CONSOLE_FOUND message the resulting text will be:

  vncpasswd viewer was not found, please install vncpasswd first.

It is a bit misleading, as vncpasswd is not a viewer. You can maybe add 
something like the following to the src/cli/messages.py file:

  NO_SUCH_COMMAND = '%s command was not found, please install it first.'

Then you can do the following win cmd_passwd is None:

  raise Error, Messages.Error.NO_SUCH_COMMAND % 'vncpasswd'
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 think it is good to add "p.wait()" 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