1 file changed, 2 insertions(+), 17 deletions(-)
tools/crm.in | 19 ++-----------------
# HG changeset patch
# User Dejan Muhamedagic <[EMAIL PROTECTED]>
# Date 1226420080 -3600
# Branch stable-1.0
# Node ID b91df25acab4041ed9972d89428766683a611980
# Parent 21556fcee3241da70173722bf16683fd8214d21a
Low (bnc#438278): Tools: cli: replace popen2 with the subprocess module
diff --git a/tools/crm.in b/tools/crm.in
--- a/tools/crm.in
+++ b/tools/crm.in
@@ -21,7 +21,7 @@ import shlex
import shlex
import os
from tempfile import mkstemp
-from popen2 import Popen3
+import subprocess
import sys
import time
import readline
@@ -203,19 +203,6 @@ def xml2doc(cmd):
# p.tochild.write(s)
# p.tochild.close()
# p.wait()
-
-# Stolen from crm_utils.py
-def os_system(cmd, print_raw=False):
- 'Run a program, collect and return stdout.'
- p = Popen3(add_sudo(cmd), None)
- p.tochild.close()
- result = p.fromchild.readlines()
- p.fromchild.close()
- p.wait()
- if print_raw:
- for line in result:
- print line.rstrip()
- return result
def str2tmp(s):
'''
@@ -2356,9 +2343,7 @@ class CibObjectSetRaw(CibObjectSet):
pipe_string(ptest,doc.toprettyxml())
doc.unlink()
if tmpfile:
- p = Popen3("%s %s" % (user_prefs.dotty,tmpfile), None)
- p.fromchild.close()
- p.tochild.close()
+ p = subprocess.Popen("%s %s" % (user_prefs.dotty,tmpfile), shell=True, bufsize=0, stdin=None, stdout=None, stderr=None, close_fds=True)
tmpfiles.append(tmpfile)
class CibObject(object):
_______________________________________________
Pacemaker mailing list
[email protected]
http://list.clusterlabs.org/mailman/listinfo/pacemaker