[PATCH 6/6] use self.conf.* values when rpmdb queries fail (bugzilla needs to know at least valid component name)

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

 



(cherry-picked from 0a02db895d3955cd154abd24e2f055aec672c7cd)
---
 meh/dump.py    |   10 ++++++----
 meh/handler.py |    6 ++++++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/meh/dump.py b/meh/dump.py
index 754c43b..7e01d39 100644
--- a/meh/dump.py
+++ b/meh/dump.py
@@ -199,8 +199,8 @@ class ExceptionDump(object):
         try:
             package, component = get_package_and_component()
         except RPMinfoError as rpmierr:
-            package = str(rpmierr)
-            component = str(rpmierr)
+            package = None
+            component = None
 
         release_ver = get_release_version()
         other_packages = ", ".join(get_other_packages(self))
@@ -210,10 +210,12 @@ class ExceptionDump(object):
         ret["cmdline"] = "{0} {1} {2}".format(sys.executable,
                     " ".join(get_python_opts()),
                     " ".join(sys.argv))
-        ret["component"] = component
+        if component:
+            ret["component"] = component
         ret["executable"] = sys.argv[0]
         ret["kernel"] = os.uname()[2]
-        ret["package"] = package
+        if package:
+            ret["package"] = package
         ret["release"] = get_release_version()
         ret["other involved packages"] = other_packages
         ret["environ"] = "\n".join(get_environment_variables())
diff --git a/meh/handler.py b/meh/handler.py
index c4f3f8a..143c1b9 100644
--- a/meh/handler.py
+++ b/meh/handler.py
@@ -197,6 +197,12 @@ class ExceptionHandler(object):
 
         params = dict()
         params.update(self.exn.environment_info)
+        #if rpmdb queries fail (anaconda), use self.conf.* values
+        if "component" not in params:
+            params["component"] = self.conf.programName
+        if "package" not in params:
+            params["package"] = \
+                    "{0.programName}-{0.programVersion}".format(self.conf)
         params["hashmarkername"] = self.conf.programName
         params["duphash"] = self.exn.hash
         params["reason"] = self.exn.desc
-- 
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux