Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: solve python output oddness
......................................................................

packaging: solve python output oddness

For some strange reason python loses sync with its handles when mixed
flush/fileno commands are used.

Effected command is 'print "something",', however when replaced with
sys.stdout.write("something") it works properly.

Steps to reproduce: unknown.

Solution: do not use print for formatted output.

Change-Id: I4f8e09d263990f16fb7d386cb45e68f0fe58bf1e
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M packaging/fedora/setup/engine-cleanup.py
M packaging/fedora/setup/engine-upgrade.py
M packaging/fedora/setup/setup_sequences.py
3 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/60/10960/1

diff --git a/packaging/fedora/setup/engine-cleanup.py 
b/packaging/fedora/setup/engine-cleanup.py
index cfe24a0..c9f62fc 100755
--- a/packaging/fedora/setup/engine-cleanup.py
+++ b/packaging/fedora/setup/engine-cleanup.py
@@ -393,7 +393,7 @@
         notifier.stop(True)
 
 def runFunc(funcs, dispString):
-    print "%s..." % (dispString),
+    sys.stdout.write("%s..." % dispString)
     sys.stdout.flush()
     spaceLen = basedefs.SPACE_LEN - len(dispString)
     try:
diff --git a/packaging/fedora/setup/engine-upgrade.py 
b/packaging/fedora/setup/engine-upgrade.py
index 45523be..6bc4b3b 100755
--- a/packaging/fedora/setup/engine-upgrade.py
+++ b/packaging/fedora/setup/engine-upgrade.py
@@ -583,7 +583,7 @@
     logging.debug("Post script completed successfully")
 
 def runFunc(funcList, dispString):
-    print "%s..."%(dispString),
+    sys.stdout.write("%s..." % dispString)
     sys.stdout.flush()
     spaceLen = basedefs.SPACE_LEN - len(dispString)
     try:
diff --git a/packaging/fedora/setup/setup_sequences.py 
b/packaging/fedora/setup/setup_sequences.py
index c36f598..6fd63b5 100644
--- a/packaging/fedora/setup/setup_sequences.py
+++ b/packaging/fedora/setup/setup_sequences.py
@@ -52,7 +52,7 @@
             if color in alignedTitle:
                 alignedTitle = string.replace(alignedTitle, color, '')
         spaceLen = basedefs.SPACE_LEN - len(alignedTitle)
-        print "%s..."%(self.getTitle()),
+        sys.stdout.write("%s..." % self.getTitle())
         sys.stdout.flush()
         for function in self.getFunctions():
             try:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f8e09d263990f16fb7d386cb45e68f0fe58bf1e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to