Alon Bar-Lev has uploaded a new change for review.

Change subject: core: plugin: add environment append to execute
......................................................................

core: plugin: add environment append to execute

Change-Id: I9e62ed1f47a2ed4d4660b90c6222bfe0a3e8b4a6
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M src/otopi/plugin.py
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/otopi refs/changes/17/11517/1

diff --git a/src/otopi/plugin.py b/src/otopi/plugin.py
index fd86503..fc6c509 100644
--- a/src/otopi/plugin.py
+++ b/src/otopi/plugin.py
@@ -21,6 +21,7 @@
 """Plugin interface."""
 
 
+import os
 import subprocess
 import gettext
 _ = lambda m: gettext.dgettext(message=m, domain='otopi')
@@ -305,6 +306,7 @@
         stdin=None,
         cwd=None,
         env=None,
+        envAppend=None,
     ):
         """Execute a process.
 
@@ -314,6 +316,7 @@
         stdin -- binary blob.
         cwd -- working directory.
         env -- environment dictionary.
+        envAppend -- append environment.
 
         Returns:
         (rc, stdout, stderr)
@@ -321,6 +324,12 @@
         stdour, stderr binary blobs.
         """
         try:
+            if envAppend is not None:
+                if env is None:
+                    env = os.environ
+                env = env.copy()
+                env.update(envAppend)
+
             self.logger.debug(
                 "execute: %s, executable='%s', cwd='%s', env=%s",
                 args,


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e62ed1f47a2ed4d4660b90c6222bfe0a3e8b4a6
Gerrit-PatchSet: 1
Gerrit-Project: otopi
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to