PATCH: avoid hiding serious errors (show esception), add newline in serial.txt

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

 



Hello,

please consider applying the following two patches.

The first one shows the exception before raising that sanitized
codes.FuncException. It helped me to find a typo I managed to do
in the code.

The second just adds newline to the end of the serial.txt -- it makes
the output of cat /etc/pki/func/ca/serial.txt a bit more readable.

commit e1bf96e98a58b42d7c7fd616292e080cb9dc7af7
Author: Jan Pazdziora <adelton@xxxxxxxxxxxxxxxxx>
Date:   Wed Jan 16 21:22:26 2008 +0100

    For the generic Exception, we really want to show the original error (it might as well be typo in our code that we mask this way).

diff --git a/func/minion/utils.py b/func/minion/utils.py
index bb715b3..1ae6e88 100755
--- a/func/minion/utils.py
+++ b/func/minion/utils.py
@@ -18,6 +18,7 @@ import time
 import traceback
 import xmlrpclib
 import glob
+import traceback
 
 import codes
 from func import certs
@@ -93,7 +94,8 @@ def create_minion_keys():
             if not keypair:
                 keypair = certs.retrieve_key_from_file(key_file)
             csr = certs.make_csr(keypair, dest=csr_file)
-    except Exception, e: # need a little more specificity here
+    except Exception, e:
+        traceback.print_exc()
         raise codes.FuncException, "Could not create local keypair or csr for minion funcd session"
 
     result = False

commit 4de89989bbbac7ed1f9285ffcc628dd4ce380220
Author: Jan Pazdziora <adelton@xxxxxxxxxxxxxxxxx>
Date:   Wed Jan 16 21:21:27 2008 +0100

    Append newline to serial.txt.

diff --git a/func/certs.py b/func/certs.py
index bb44b0d..22af866 100644
--- a/func/certs.py
+++ b/func/certs.py
@@ -118,7 +118,7 @@ def _get_serial_number(cadir):
 def _set_serial_number(cadir, last):
     serial = '%s/serial.txt' % cadir
     f = open(serial, 'w')
-    f.write(str(last))
+    f.write(str(last) + '\n')
     f.close()
             
-- 
Jan Pazdziora

_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list

[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux