v.licheni.net
/
stack
/
cam.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e1c1725
)
check for existance of configuration file.
author
ale
<ale@9de0ac56-b551-4d3d-a58d-d429de429fdc>
Wed, 2 Aug 2006 01:25:52 +0000
(
01:25
+0000)
committer
ale
<ale@9de0ac56-b551-4d3d-a58d-d429de429fdc>
Wed, 2 Aug 2006 01:25:52 +0000
(
01:25
+0000)
lib/cfg.py
patch
|
blob
|
history
diff --git
a/lib/cfg.py
b/lib/cfg.py
index
965e4a1
..
05c29ea
100644
(file)
--- a/
lib/cfg.py
+++ b/
lib/cfg.py
@@
-5,8
+5,16
@@
import os, sys
import ConfigParser
from utils import *
import ConfigParser
from utils import *
-cfg = ConfigParser.ConfigParser()
config_file_path = os.path.join(os.path.dirname(sys.argv[0]),'config')
config_file_path = os.path.join(os.path.dirname(sys.argv[0]),'config')
+if not os.path.exists(config_file_path):
+ print '''
+The configuration file '%s' does not exist.
+Please create this file and fill in the configuration data
+of your certificates so that 'cam' can operate.
+'''
+ sys.exit(1)
+
+cfg = ConfigParser.ConfigParser()
cfg.read(config_file_path)
ca = cfg2dict(cfg, 'ca')
ca_base = cfg.get('global', 'root')
cfg.read(config_file_path)
ca = cfg2dict(cfg, 'ca')
ca_base = cfg.get('global', 'root')