[PATCH] Use chvt command for tty switching
Brian C. Lane
bcl at redhat.com
Mon Aug 20 16:18:47 UTC 2012
On Mon, Aug 20, 2012 at 04:44:35PM +0200, Vratislav Podzimek wrote:
> isys.vtActivate is problematic when using tmux, chvt command works
> well and we use it so rarely that it should be okay to call an
> external command.
> ---
[snip]
> -def vtActivate (num):
> - if iutil.isS390():
> - return
> - _isys.vtActivate (num)
> -
> def isPseudoTTY (fd):
> return _isys.isPseudoTTY (fd)
[snip]
> +def vtActivate(num):
> + """
> + Try to switch to tty number $num.
> +
> + @type num: int
> + @return: whether the switch was successful or not
> + @rtype: bool
> +
> + """
> +
> + try:
> + ret = execWithRedirect("chvt", [num], stdout="/dev/tty5",
> + stderr="/dev/tty5")
> + except OSError as oserr:
> + ret = -1
> + log.error("Failed to run chvt: %s", oserr.strerror)
> +
> + if ret != 0:
> + log.error("Failed to switch tty to tty%d", num)
> +
> + return ret == 0
> +
Is it safe to drop the isS390() check?
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20120820/ce633196/attachment.sig>
More information about the anaconda-patches
mailing list