Robert Schweikert
59f2847b9b
fixed potential broken pipe error message when executing user script (bsc#903449) OBS-URL: https://build.opensuse.org/request/show/401599 OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=42
23 lines
868 B
Diff
23 lines
868 B
Diff
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)
|