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

tlitovsk at redhat.com tlitovsk at redhat.com
Wed Nov 19 16:07:36 UTC 2014


Anatoly Litovsky has uploaded a new change for review.

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

Fixing correct terminal detection

Avoiding setting fonts of terminal if its not ttyxx terminal
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1162449
Change-Id: I010c2bf79bfe98b3b5ebc2f54246690c1bcfbffc
Signed-off-by: Tolik Litovsky <tlitovsk at redhat.com>
---
M src/ovirt/node/utils/console.py
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/48/35348/1

diff --git a/src/ovirt/node/utils/console.py b/src/ovirt/node/utils/console.py
index 238b6c9..8497c2b 100644
--- a/src/ovirt/node/utils/console.py
+++ b/src/ovirt/node/utils/console.py
@@ -25,6 +25,7 @@
 import os
 import termios
 import tty
+import re
 
 
 def is_terminal():
@@ -32,7 +33,8 @@
     Like the linux terminal console
     """
     ttyname = os.ttyname(sys.stdin.fileno())
-    return ttyname.startswith("/dev/tty") or ttyname == "/dev/console"
+    return re.search(ttyname, "/dev/tty(([0-9][10-99])|[0-9]|)") != None \
+           or ttyname == "/dev/console"
 
 
 def is_pty():


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I010c2bf79bfe98b3b5ebc2f54246690c1bcfbffc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Anatoly Litovsky <tlitovsk at redhat.com>



More information about the node-patches mailing list