LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File cloud-init-python2-sigpipe.patch of Package cloud-init (Project Cloud:Tools)

--- cloudinit/util.py.orig
+++ cloudinit/util.py
@@ -35,6 +35,7 @@ import time
 from errno import ENOENT, ENOEXEC
 
 from base64 import b64decode, b64encode
+from signal import signal, SIGPIPE, SIG_DFL
 from six.moves.urllib import parse as urlparse
 
 import six
@@ -1868,7 +1869,8 @@ def subp(args, data=None, rcs=None, env=
     try:
         sp = subprocess.Popen(args, stdout=stdout,
                               stderr=stderr, stdin=stdin,
-                              env=env, shell=shell)
+                              env=env, shell=shell,
+                              preexec_fn=lambda: signal(SIGPIPE, SIG_DFL))
         (out, err) = sp.communicate(data)
     except OSError as e:
         raise ProcessExecutionError(