Only write to stdin if it exists
@@ -143,6 +143,7 @@ def run_command(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
timeout_thread = eventlet.spawn(on_timeout_expired, timeout)
LOG.debug('Attaching to process.')
+ if stdin:
process.stdin.write(stdin)
if read_stdout_func and read_stderr_func:
