Yedidyah Bar David has uploaded a new change for review.

Change subject: core: alert if executing with a non-string in env
......................................................................

core: alert if executing with a non-string in env

Related-To: https://bugzilla.redhat.com/1155596
Change-Id: I8d79c4e29451779a0d98942de3bca1525a15c0ab
Signed-off-by: Yedidyah Bar David <d...@redhat.com>
---
M src/otopi/plugin.py
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/otopi refs/changes/86/34486/1

diff --git a/src/otopi/plugin.py b/src/otopi/plugin.py
index 2a4378b..590f6b1 100644
--- a/src/otopi/plugin.py
+++ b/src/otopi/plugin.py
@@ -784,6 +784,21 @@
                 cwd,
                 env,
             )
+
+            for k,v in env.items():
+                if (
+                    not isinstance(v, str) and
+                    not isinstance(v, builtins.unicode)
+                ):
+                    raise RuntimeError(
+                        _(
+                            "executeRaw called with a non-string value in "
+                            "the environment for the key '{k}'"
+                        ).format(
+                            k=k,
+                        )
+                    )
+
             p = subprocess.Popen(
                 args,
                 executable=executable,


-- 
To view, visit http://gerrit.ovirt.org/34486
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d79c4e29451779a0d98942de3bca1525a15c0ab
Gerrit-PatchSet: 1
Gerrit-Project: otopi
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <d...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to