Changeset 2627

Show
Ignore:
Timestamp:
02/26/08 12:08:52 (9 months ago)
Author:
hans
Message:

Make cert daemon more robust

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/bos/projects/bos/m2/cert-daemon.lisp

    r2121 r2627  
    2929 
    3030(defun fill-forms (directory template-pathname) 
    31   (dolist (fdf-pathname (remove "fdf" (directory directory) 
    32                                 :test (complement #'string-equal) 
    33                                 :key #'pathname-type)) 
    34     (handler-case 
    35         (destructuring-bind (id &optional (country "en")) (split "-" (pathname-name fdf-pathname)) 
    36           (let ((language-specific-template-pathname (merge-pathnames (make-pathname :name (format nil "~A-~A" (pathname-name template-pathname) country)) 
    37                                                                       template-pathname)) 
    38                 (output-pathname (merge-pathnames (make-pathname :name id :type "pdf") fdf-pathname))) 
    39             (fill-form fdf-pathname (if (probe-file language-specific-template-pathname) 
    40                                         language-specific-template-pathname 
    41                                         template-pathname) 
    42                        output-pathname))) 
    43       (error (e) 
    44         (format "Error generating certificate from file ~A: ~A~%" fdf-pathname e))))) 
     31  (handler-case 
     32      (dolist (fdf-pathname (remove "fdf" (directory directory) 
     33                                    :test (complement #'string-equal) 
     34                                    :key #'pathname-type)) 
     35        (handler-case 
     36            (destructuring-bind (id &optional (country "en")) (split "-" (pathname-name fdf-pathname)) 
     37              (let ((language-specific-template-pathname (merge-pathnames (make-pathname :name (format nil "~A-~A" (pathname-name template-pathname) country)) 
     38                                                                          template-pathname)) 
     39                    (output-pathname (merge-pathnames (make-pathname :name id :type "pdf") fdf-pathname))) 
     40                (fill-form fdf-pathname (if (probe-file language-specific-template-pathname) 
     41                                            language-specific-template-pathname 
     42                                            template-pathname) 
     43                           output-pathname))) 
     44          (error (e) 
     45            (format t "Error generating certificate from file ~A: ~A~%" fdf-pathname e)))) 
     46    (error (e) 
     47      (format t "Error ~A scanning PDF directory.  Trying again later~%" e)))) 
    4548 
    4649(defun generate-certs ()