[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 5/6] add info about environment variables



(cherry-picked from 04b70ff43483d7079217ea0b440f86cb3f5a47c9)
---
 meh/dump.py |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/meh/dump.py b/meh/dump.py
index 025ae5a..754c43b 100644
--- a/meh/dump.py
+++ b/meh/dump.py
@@ -176,7 +176,25 @@ class ExceptionDump(object):
                 pass
             return packages
 
+        def get_environment_variables():
+            """
+            Returns a list of strings containing defined environment
+            variables and their values in the following format:
+
+            VARIABLE=VALUE
+
+            @rtype: list
+
+            """
+
+            ret = list()
+            for (key, value) in os.environ.iteritems():
+                ret.append("{0}={1}".format(key, value))
+
+            return ret
+
 
+        #--begining of the method _get_environment_info--
         package, component = None, None
         try:
             package, component = get_package_and_component()
@@ -198,6 +216,7 @@ class ExceptionDump(object):
         ret["package"] = package
         ret["release"] = get_release_version()
         ret["other involved packages"] = other_packages
+        ret["environ"] = "\n".join(get_environment_variables())
 
         return ret
 
-- 
1.7.4.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]