X-Git-Url: https://pwan.org/git/?p=certmaster.git;a=blobdiff_plain;f=certmaster%2Fconfig.py;h=bf9b87bad2a47f83266a75bfe5147e83b707a828;hp=7f7e62310b50ebc4879cf142ef865c53041b3db4;hb=HEAD;hpb=240ba9b7e2ee00a8f6014c7d597a5afd1f96249c diff --git a/certmaster/config.py b/certmaster/config.py index 7f7e623..bf9b87b 100644 --- a/certmaster/config.py +++ b/certmaster/config.py @@ -17,12 +17,12 @@ import os import sys -import warnings import copy import urlparse from ConfigParser import NoSectionError, NoOptionError, ConfigParser from ConfigParser import ParsingError import exceptions +import warnings CONFIG_FILE = "/etc/certmaster/certmaster.conf" @@ -448,7 +448,7 @@ class BaseConfig(object): self.cfg.write(fileobj) def getConfigOption(self, option, default=None): - warnings.warn('getConfigOption() will go away in a future version of Yum.\n' + warnings.warn('getConfigOption() will go away in a future version of certmaster.\n' 'Please access option values as attributes or using getattr().', DeprecationWarning) if hasattr(self, option): @@ -456,7 +456,7 @@ class BaseConfig(object): return default def setConfigOption(self, option, value): - warnings.warn('setConfigOption() will go away in a future version of Yum.\n' + warnings.warn('setConfigOption() will go away in a future version of certmaster.\n' 'Please set option values as attributes or using setattr().', DeprecationWarning) if hasattr(self, option): @@ -478,15 +478,10 @@ def read_config(config_file, BaseConfigDerived): ## build up the cas structure opts.ca = {} -# opts.ca[''] = {} ## Add the default items when just using a single ca -# main_items = confparser.items('main') -# for (key,value) in main_items: -# if key in ['autosign','cadir','cert_dir','certroot','csrroot']: -# print "main ca: key: %s, value: %s" % (key,value) -# opts.ca[''][key] = value opts.ca[''] = BaseConfigDerived() + opts.ca[''].hash_function = "sha256" opts.ca[''].populate(confparser,'main') ## Add additonal ca sections @@ -494,11 +489,8 @@ def read_config(config_file, BaseConfigDerived): for a_section in sections: if a_section.startswith('ca:'): ca_name = a_section[3:] -# items = confparser.items(a_section) -# opts.ca[ca_name] = {} -# for (key,value) in items: -# opts.ca[ca_name][key] = value opts.ca[ca_name] = BaseConfigDerived() + opts.ca[ca_name].hash_function = "sha256" opts.ca[ca_name].populate(confparser,a_section) opts.ca[ca_name].cakey = None opts.ca[ca_name].cacert = None