[node-patches] Change in ovirt-node[master]: Fixing correct terminal detection

fabiand at redhat.com fabiand at redhat.com
Wed Nov 19 16:36:11 UTC 2014


Fabian Deutsch has posted comments on this change.

Change subject: Fixing correct terminal detection
......................................................................


Patch Set 1:

(1 comment)

See my inline comment

http://gerrit.ovirt.org/#/c/35348/1/src/ovirt/node/utils/console.py
File src/ovirt/node/utils/console.py:

Line 32:     """Is true if the terminal is a real one
Line 33:     Like the linux terminal console
Line 34:     """
Line 35:     ttyname = os.ttyname(sys.stdin.fileno())
Line 36:     return re.search(ttyname, "/dev/tty(([0-9][10-99])|[0-9]|)") != None \
That expression can be much simpler:

    re.match("/dev/tty[0-9]")

Which basically means that it will match any string starting with /dev/tttyNUMBER
Line 37:            or ttyname == "/dev/console"
Line 38: 
Line 39: 
Line 40: def is_pty():


-- 
To view, visit http://gerrit.ovirt.org/35348
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I010c2bf79bfe98b3b5ebc2f54246690c1bcfbffc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Anatoly Litovsky <tlitovsk at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes



More information about the node-patches mailing list