SHA256
1
0
forked from pool/cloud-init
cloud-init/cloud-init-python2-sigpipe.patch

23 lines
868 B
Diff
Raw Normal View History

Index: cloud-init-0.7.6/cloudinit/util.py
===================================================================
--- cloud-init-0.7.6.orig/cloudinit/util.py
+++ cloud-init-0.7.6/cloudinit/util.py
@@ -59,6 +59,7 @@ from cloudinit import version
from cloudinit.settings import (CFG_BUILTIN)
+from signal import signal, SIGPIPE, SIG_DFL
_DNS_REDIRECT_IP = None
LOG = logging.getLogger(__name__)
@@ -1559,7 +1560,8 @@ def subp(args, data=None, rcs=None, env=
stdin = subprocess.PIPE
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(cmd=args, reason=e)