]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: process: disable stdin param of run() 19276/head
authorKefu Chai <kchai@redhat.com>
Fri, 1 Dec 2017 16:43:21 +0000 (00:43 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 4 Dec 2017 14:38:22 +0000 (22:38 +0800)
we cannot use process.communicate() to feed the Popen with input,
because, upon return of process.communicate() the stdout,stderr are
closed. see https://docs.python.org/2/library/subprocess.html#subprocess.Popen.communicate .

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/ceph-volume/ceph_volume/process.py

index 4b6a9c284741f50d5cb22644214a0293d19c266f..7bc97a99b2039be367708308ad3dd33cba3bfdcc 100644 (file)
@@ -99,22 +99,18 @@ def run(command, **kw):
     """
     stop_on_error = kw.pop('stop_on_error', True)
     command_msg = obfuscate(command, kw.pop('obfuscate', None))
-    stdin = kw.pop('stdin', None)
     logger.info(command_msg)
     terminal.write(command_msg)
     terminal_logging = kw.pop('terminal_logging', True)
 
     process = subprocess.Popen(
         command,
-        stdin=subprocess.PIPE,
         stdout=subprocess.PIPE,
         stderr=subprocess.PIPE,
         close_fds=True,
         **kw
     )
 
-    if stdin:
-        process.communicate(stdin)
     while True:
         reads, _, _ = select(
             [process.stdout.fileno(), process.stderr.fileno()],