X-Git-Url: https://pwan.org/git/?a=blobdiff_plain;ds=sidebyside;f=certmaster%2Fconfig.py;h=2cec66f7d83bb6df99ad6462a8eb54b6d4ed1db7;hb=88c38a52cf4da57c8b0a910762ca69cc8dbec61f;hp=4cf2a7fa0ed8779d15913f60abd0984fba00118e;hpb=d7a437a33c7767917fdc963953a39286a01db696;p=certmaster.git diff --git a/certmaster/config.py b/certmaster/config.py index 4cf2a7f..2cec66f 100644 --- a/certmaster/config.py +++ b/certmaster/config.py @@ -60,7 +60,7 @@ class Option(object): @param obj: The configuration instance to modify. @param objtype: The type of the config instance (not used). @return: The parsed option value or the default value if the value - wasn't set in the configuration file. + was not set in the configuration file. ''' if obj is None: return self @@ -475,4 +475,22 @@ def read_config(config_file, BaseConfigDerived): print >> sys.stderr, "Error reading config file: %s" % e sys.exit(1) opts.populate(confparser, 'main') + + ## build up the cas structure + opts.ca = {} + + ## Add the default items when just using a single ca + opts.ca[''] = BaseConfigDerived() + opts.ca[''].populate(confparser,'main') + + ## Add additonal ca sections + sections = confparser.sections() + for a_section in sections: + if a_section.startswith('ca:'): + ca_name = a_section[3:] + opts.ca[ca_name] = BaseConfigDerived() + opts.ca[ca_name].populate(confparser,a_section) + opts.ca[ca_name].cakey = None + opts.ca[ca_name].cacert = None + return opts