check for existance of configuration file.
[stack/cam.git] / lib / files.py
1
2 import os
3 from cfg import *
4 from paths import *
5
6 fields = [
7     ('conf', 'OpenSSL configuration file'),
8     ('rsa_key', 'RSA private key'),
9     ('rsa_crt', 'RSA certificate'),
10     ('dsa_key', 'DSA private key'),
11     ('dsa_crt', 'DSA certificate'),
12     ('dsa_parms', 'DSA parameters'),
13     ('public_crt', 'public certificates bundle'),
14     ('singlefile', 'single cert. file (with keys)')
15     ]
16
17 def files(tag):
18     print '''
19
20 Files related to the '%s' certificates:
21
22 ''' % tag
23     for k, desc in fields:
24         p = getpath(k, tag)
25         star = ' '
26         if not os.path.exists(p):
27             star = '*'
28         print '%-30s %s%s' % (desc, star, p)
29
30     print '(* = not found)'
31     print
32